function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RedSalesRedSales 

How To Find Out Why Class is Dirty?

Hi, I am working on a class in the Force.Com IDE.  The class compiles ok but when I try to save it to the server it states the class is dirty. This is ok & I understand there may be differences between my workspace & the server however I cannot find out what is causing it to be dirty. Is there a way of deterninining/viewing what within the class is "dirty"? is there a report or log for example within the IDE which contains such information?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
RedSalesRedSales

Hi,

 

I found out my class was dirty because there was an extra close bracket in the code. It allowed the class to be saved locally though, not  throwing any error however there was an error due to the extra closed bracket.  In effect when saving locally it did not provide a compile error.

 

Thanks all the same for the help!

All Answers

Glen.ax1034Glen.ax1034

I think that this is mostly misperception... that the code didn't compile on the server side the last time you pushed it there and hasn't passed the checks..

 

i ignore this error and force it to save to server.

SKhodiyarSKhodiyar

Well, There is a difference between a code running and a code being clean. You call a code to be dirty when it is very complex, has unused variables, and possibly memory leaks.

 

A dirty code simply means that your program is not as memory efficient as it can be.

RedSalesRedSales

Hi,

 

I found out my class was dirty because there was an extra close bracket in the code. It allowed the class to be saved locally though, not  throwing any error however there was an error due to the extra closed bracket.  In effect when saving locally it did not provide a compile error.

 

Thanks all the same for the help!

This was selected as the best answer