Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package checks;

//The test unit is set to report the first brain method issue + the 10% of the total brain method issues found,
//The test unit is set to report the first brain method issue + the total brain method issues found divided by 15,
//ordered by general complexity.
//In this file there are 10 issues found, so a total of 1 + (10% of 10 = 1) = 2 issues will be raised
//In this file there are 10 issues found, so a total of 1 + (10 / 15 = 0) = 1 issue will be raised
class BrainMethodCheckSubsetOfIssues {

void method1(String a, String b) { // Noncompliant
void method1(String a, String b) { // Compliant: this will be skipped since the following method is more complex
if (a != null) {
System.out.println(a + b);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private static boolean isExcluded(MethodTree methodTree) {
@Override
public void endOfAnalysis(ModuleScannerContext context) {
if (issuesFound.size() > numberOfIssuesToReport) {
numberOfIssuesToReport += issuesFound.size() / 10;
numberOfIssuesToReport += issuesFound.size() / 15;
issuesFound.sort((a, b) -> b.brainScore - a.brainScore);
} else {
numberOfIssuesToReport = issuesFound.size();
Expand Down
Loading