public class NPathComplexityRule extends AbstractStatisticalJavaRule
propertyDescriptors, propertyValuesByDescriptor
MINIMUM_DESCRIPTOR, SIGMA_DESCRIPTOR, TOP_SCORE_DESCRIPTOR
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
Constructor and Description |
---|
NPathComplexityRule() |
Modifier and Type | Method and Description |
---|---|
Object[] |
getViolationParameters(DataPoint point) |
static int |
sumExpressionComplexity(ASTExpression expr)
Calculate the boolean complexity of the given expression.
|
Object |
visit(ASTConditionalExpression node,
Object data) |
Object |
visit(ASTDoStatement node,
Object data) |
Object |
visit(ASTForStatement node,
Object data) |
Object |
visit(ASTIfStatement node,
Object data) |
Object |
visit(ASTMethodDeclaration node,
Object data) |
Object |
visit(ASTReturnStatement node,
Object data) |
Object |
visit(ASTSwitchStatement node,
Object data) |
Object |
visit(ASTTryStatement node,
Object data) |
Object |
visit(ASTWhileStatement node,
Object data) |
Object |
visit(JavaNode node,
Object data) |
addDataPoint, apply
getDeclaringType, importsPackage, isQualifiedName, isSuppressed, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll
addExample, addRuleChainVisit, addRuleChainVisit, addViolation, addViolation, addViolation, addViolationWithMessage, addViolationWithMessage, addViolationWithMessage, deepCopyValuesTo, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getParserOptions, getPriority, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution
copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addExample, addRuleChainVisit, addRuleChainVisit, end, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getParserOptions, getPriority, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution
definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues
public Object visit(ASTMethodDeclaration node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(JavaNode node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTIfStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTWhileStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTDoStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTForStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTReturnStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTSwitchStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTTryStatement node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public Object visit(ASTConditionalExpression node, Object data)
visit
in interface JavaParserVisitor
visit
in class AbstractJavaRule
public static int sumExpressionComplexity(ASTExpression expr)
Note that this calculation applies to Cyclomatic Complexity as well.
expr
- control structure expressionpublic Object[] getViolationParameters(DataPoint point)
getViolationParameters
in interface StatisticalRule
getViolationParameters
in class AbstractStatisticalJavaRule
Copyright © 2002–2017 PMD. All rights reserved.