If you analyze the following source code with the NcssMethodCountRule
@isTest
private class AcceptanceTests_Test {
@isTest
private static void test() {
// Setup
Opportunity o1 = new Opportunity()
.add(new Contact().foo(1) .bar(1).year(2012) .bar(1).price(5) .vol(100))
.add(new Contact().foo(1) .bar(2).year(2013) .bar(1).price(5) .vol(110))
.add(new Contact().foo(1) .bar(3).year(2014) .bar(1).price(5) .vol(120))
.add(new Contact().foo(1) .bar(4).year(2015) .bar(1).price(5) .vol(130))
.persist();
Opportunity o2 = new Opportunity()
.add(new Contact().foo(1) .PRS(1).year(2012) .bar(1).price(5) .vol(110))
.add(new Contact().foo(1) .PRS(2).year(2013) .bar(1).price(5) .vol(120))
.add(new Contact().foo(1) .PRS(3).year(2014) .bar(1).price(5) .vol(130))
.add(new Contact().foo(1) .PRS(4).year(2015) .bar(1).price(5) .vol(140))
.persist();
Opportunity o3 = new Opportunity()
.add(new Contact().foo(1) .PRS(1).year(2012) .bar(1).price(5) .vol(110))
.add(new Contact().foo(1) .PRS(2).year(2013) .bar(1).price(5) .vol(120))
.add(new Contact().foo(1) .PRS(3).year(2014) .bar(1).price(5) .vol(130))
.add(new Contact().foo(1) .PRS(4).year(2015) .bar(1).price(5) .vol(140))
.persist();
// Exercise
callMethod();
// Verify
System.assert(attribute());
}
}
the test method marked as issue with over 80 NCSS. Actually it is less than 30. The method chaining in // Setup seems to confuse the PMD line detection.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4