The NCSS complexity checker reported an incorrect fileMax value (bug #2161419).
This commit is contained in:
parent
7f92af2b87
commit
0cc473e04f
|
|
@ -200,7 +200,7 @@ public class JavaNCSSCheck extends Check
|
|||
final int count = counter.getCount();
|
||||
if (count > mFileMax) {
|
||||
log(aRootAST.getLineNo(), aRootAST.getColumnNo(), "ncss.file",
|
||||
count, mMethodMax);
|
||||
count, mFileMax);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,18 +18,18 @@ public class JavaNCSSCheckTest extends BaseCheckTestSupport
|
|||
DefaultConfiguration checkConfig = createCheckConfig(JavaNCSSCheck.class);
|
||||
|
||||
checkConfig.addAttribute("methodMaximum", "0");
|
||||
checkConfig.addAttribute("classMaximum", "0");
|
||||
checkConfig.addAttribute("fileMaximum", "0");
|
||||
checkConfig.addAttribute("classMaximum", "1");
|
||||
checkConfig.addAttribute("fileMaximum", "2");
|
||||
|
||||
String[] expected = {
|
||||
"2:1: NCSS for this file is 35 (max allowed is 0).",
|
||||
"9:1: NCSS for this class is 22 (max allowed is 0).",
|
||||
"2:1: NCSS for this file is 35 (max allowed is 2).",
|
||||
"9:1: NCSS for this class is 22 (max allowed is 1).",
|
||||
"14:5: NCSS for this method is 2 (max allowed is 0).",
|
||||
"21:5: NCSS for this method is 4 (max allowed is 0).",
|
||||
"30:5: NCSS for this method is 12 (max allowed is 0).",
|
||||
"42:13: NCSS for this method is 2 (max allowed is 0).",
|
||||
"49:5: NCSS for this class is 2 (max allowed is 0).",
|
||||
"56:1: NCSS for this class is 10 (max allowed is 0).",
|
||||
"49:5: NCSS for this class is 2 (max allowed is 1).",
|
||||
"56:1: NCSS for this class is 10 (max allowed is 1).",
|
||||
"61:5: NCSS for this method is 8 (max allowed is 0).",};
|
||||
|
||||
verify(checkConfig, getPath("metrics" + File.separator
|
||||
|
|
|
|||
|
|
@ -28,7 +28,10 @@
|
|||
|
||||
<p>Fixed Bugs:</p>
|
||||
<ul>
|
||||
<li>...</li>
|
||||
<li>
|
||||
The NCSS complexity checker reported an incorrect fileMax value
|
||||
(bug #2161419).
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p>Notes:</p>
|
||||
|
|
|
|||
Loading…
Reference in New Issue