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
anna425912anna425912 

Code Coverage discrepancies and blank lines showing uncovered

I'm trying to increase our code coverage percentage and finding many issues with actually determining what a class or trigger's coverage is. My current frustration is with a specific class and test.  In our full copy sandbox, I'm getting 96% coverage, 24/25 lines. In production, I'm getting 57% coverage, 16/28 lines.  I know that one of those lines (the one showing up in fullcopy) is actually uncovered; however the other lines that are showing as uncovered in production are close brackets and blank lines.  I tried clearing all test history as that was a suggestion, but it did not fix the problem.  Additionally, when I run the test to cover that class, and click on the specific methods to see all the classes and triggers that it covers, it says 80% coverage, 20/25 lines.  On the class page, it shows the 57% number.  
Steve_EarlySteve_Early
Hi Anna:

I don't know if this is relevant, but - did you happen to activate the new feature for de-duping in Spring '15 under Data.com? I just had a situation where I did turn this feature on, and my code coverage went from 90% to 29% !!  I may not have had the matching rules in the de-duping program set right, but I couldn't deploy anything. I had to de-activate this feature to deploy a change set.
 
anna425912anna425912
Hi Steve, 

We don't have any active matching rules currently, and only activated a couple for a few hours to test so I'm not sure if it affected our code coverage at all.  
Steve_EarlySteve_Early
Hi Anna - I de-activated all the Data.com de-duplication stuff and ran my code tests and it all went back to 90%. Then I re-activated the Data.com stuff and it stayed at 90%. It is all very strange.