Fixed problem where constructors were not testing the reporting level.

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1409 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Don Leckie
2003-02-07 21:55:15 +00:00
parent dd82e9730e
commit 1946ab8439

View File

@ -243,6 +243,8 @@ public class CyclomaticComplexityRule extends AbstractRule
classEntry.m_highestDecisionPoints = constructorDecisionPointCount;
}
if (constructorEntry.m_decisionPoints >= getIntProperty("reportLevel"))
{
// The {0} "{1}" has a cyclomatic complexity of {2}.
RuleContext ruleContext = (RuleContext) data;
String template = getMessage();
@ -253,6 +255,7 @@ public class CyclomaticComplexityRule extends AbstractRule
int lineNumber = node.getBeginLine();
RuleViolation ruleViolation = createRuleViolation(ruleContext, lineNumber, message);
ruleContext.getReport().addRuleViolation(ruleViolation);
}
return data;
}