You need to sign in to do that
Don't have an account?
Sachin30
test coverage is being calculated incorrectly
Strange behavior while calculating code coverage:
if I mention method call with parameters in different lines, salesforce consider it as different lines while calculating code coverage e.g
if I mention method call with parameters in different lines, salesforce consider it as different lines while calculating code coverage e.g
myMethod(p1, p2, p3, p4);Test coverage consider it as 4 lines. Instead it should be only one line as it is nothing but representation of one method call.
myMethod(p1,p2,p3,p4);This makes the code writing highly inefficient as unwrapped long lines in editor are very difficult to manage for a developer.
This is the reason we check classes for testing anti-patterns or redundant code that are oriented to increase code coverage without being valid functional tests. Examples of anti patterns are classes with a considerable number of characters and which just declare dummy variables and assign them dummy values:
Integer i1;
i1 = 1;
...
Integer i1000;
i1000 = 1;
Earlier, the Overall Code Coverage calculation used to count every line of untested class code, including the likes of debug lines, blank lines and comments. However, this has been fixed
http://https://trailblazer.salesforce.com/issues_view?id=a1p30000000T1m1AAC&title=calculating-number-of-rows-incorrectly-for-classes-with-no-code-coverage
Let me know if it helps