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
Raj88Raj88 

Code Coverage mismatch

After running the test class when i open the class file, the code coverage is 100%. But the total number of lines of the class is 954. its showing only 182.

User-added image

when i open Developer consiole and check the same class it is showing only 45%.

User-added image

Can anyone help me what is the issue with this.?
Subramani_SFDCSubramani_SFDC
This is a known problem and MVPs like Jeff and Wes have good posts about the same. Here are links for reference:

http://th3silverlining.com/2011/11/30/salesforce-different-percentage-code-coverage-in-different-environments/

http://blog.jeffdouglas.com/2011/11/22/apex-test-coverage-does-not-match/

I think one way is to clear the Test execution history from "Setup > Develop > Apex test execution", and try again. Running all tests might help getting more accurate coverage after cleaning the stale results.


source: http://salesforce.stackexchange.com/questions/4165/why-are-code-coverage-results-different-in-ide-and-developer-console