Class ExcessivePublicCountRule
- java.lang.Object
-
- net.sourceforge.pmd.properties.AbstractPropertySource
-
- net.sourceforge.pmd.lang.rule.AbstractRule
-
- net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
-
- net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule
-
- net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTTypeDeclaration>
-
- net.sourceforge.pmd.lang.java.rule.design.ExcessivePublicCountRule
-
- All Implemented Interfaces:
AstVisitor
,JavaVisitor
,Rule
,PropertySource
public class ExcessivePublicCountRule extends net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTTypeDeclaration>
Rule attempts to count all public methods and public attributes defined in a class.If a class has a high number of public operations, it might be wise to consider whether it would be appropriate to divide it into subclasses.
A large proportion of public members and operations means the class has high potential to be affected by external classes. Futhermore, increased effort will be required to thoroughly test the class.
- Author:
- aglover
-
-
Field Summary
-
Fields inherited from interface net.sourceforge.pmd.lang.rule.Rule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
-
-
Constructor Summary
Constructors Constructor Description ExcessivePublicCountRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
defaultReportLevel()
protected boolean
isViolation(ASTTypeDeclaration node, int reportLevel)
-
Methods inherited from class net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule
isIgnored, visitJavaNode
-
Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule
buildTargetSelector
-
Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
apply, visitNode
-
Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule
addExample, asCtx, deepCopy, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getPriority, getPropertySourceType, getRuleClass, getRuleSetName, getSince, getTargetSelector, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, start
-
Methods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
definePropertyDescriptor, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.AstVisitor
cannotVisit
-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaVisitor
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, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty
-
Methods inherited from interface net.sourceforge.pmd.lang.rule.Rule
initialize
-
-
-
-
Method Detail
-
defaultReportLevel
protected int defaultReportLevel()
- Specified by:
defaultReportLevel
in classnet.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTTypeDeclaration>
-
isViolation
protected boolean isViolation(ASTTypeDeclaration node, int reportLevel)
- Specified by:
isViolation
in classnet.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTTypeDeclaration>
-
-