| net.sourceforge.pmd.stat.StatisticalRule net.sourceforge.pmd.rules.design.NpathComplexity
NpathComplexity | public class NpathComplexity extends StatisticalRule (Code) | | NPath complexity is a measurement of the acyclic execution paths through a
function. See Nejmeh, Communications of the ACM Feb 1988 pp 188-200.
author: Jason Bennett |
Method Summary | |
protected void | makeViolations(RuleContext ctx, Set<DataPoint> p) | public static int | sumExpressionComplexity(ASTExpression expr) Calculate the boolean complexity of the given expression. | public Object | visit(ASTMethodDeclaration node, Object data) | public Object | visit(SimpleJavaNode node, Object data) | public Object | visit(ASTIfStatement node, Object data) | public Object | visit(ASTWhileStatement node, Object data) | public Object | visit(ASTDoStatement node, Object data) | public Object | visit(ASTForStatement node, Object data) | public Object | visit(ASTReturnStatement node, Object data) | public Object | visit(ASTSwitchStatement node, Object data) | public Object | visit(ASTTryStatement node, Object data) | public Object | visit(ASTConditionalExpression node, Object data) |
sumExpressionComplexity | public static int sumExpressionComplexity(ASTExpression expr)(Code) | | Calculate the boolean complexity of the given expression. NPath boolean
complexity is the sum of && and || tokens. This is calculated by summing
the number of children of the &&'s (minus one) and the children of the ||'s
(minus one).
Note that this calculation applies to Cyclomatic Complexity as well.
Parameters: expr - control structure expression complexity of the boolean expression |
Fields inherited from net.sourceforge.pmd.stat.StatisticalRule | final public static double DELTA(Code)(Java Doc)
|
|
|