net.sourceforge.pmd.lang.java.rule.codesize

## Class ExcessivePublicCountRule

- java.lang.Object
- - net.sourceforge.pmd.AbstractPropertySource
  - - net.sourceforge.pmd.lang.rule.AbstractRule
    - - net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
      - - net.sourceforge.pmd.lang.java.rule.AbstractStatisticalJavaRule
        - - net.sourceforge.pmd.lang.java.rule.design.ExcessiveNodeCountRule
          - - net.sourceforge.pmd.lang.java.rule.codesize.ExcessivePublicCountRule

All Implemented Interfaces:
  JavaParserVisitor, ImmutableLanguage, StatisticalRule, PropertySource, Rule

    public class ExcessivePublicCountRule
    extends ExcessiveNodeCountRule

Author:
  aglover

  Class Name: ExcessivePublicCount

  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.

### Field Summary

### Fields inherited from class net.sourceforge.pmd.AbstractPropertySource

`propertyDescriptors, propertyValuesByDescriptor`

### Fields inherited from interface net.sourceforge.pmd.lang.rule.stat.StatisticalRule

`MINIMUM_DESCRIPTOR, SIGMA_DESCRIPTOR, TOP_SCORE_DESCRIPTOR`

### Fields inherited from interface net.sourceforge.pmd.Rule

`VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR`

### Constructor Summary

Constructors
Constructor and Description
`ExcessivePublicCountRule()`

### Method Summary

Methods
`Object` `visit(ASTFieldDeclaration node, Object data)` Method counts ONLY public class attributes which are not PUBLIC and static- these usually represent constants....
`Object` `visit(ASTMethodDeclarator node, Object data)` Method counts ONLY public methods.

### Methods inherited from class net.sourceforge.pmd.lang.java.rule.design.ExcessiveNodeCountRule

`visit`

### Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractStatisticalJavaRule

`addDataPoint, apply, getViolationParameters`

### Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRule

`getDeclaringType, importsPackage, isQualifiedName, 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, visitAll`

### Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule

`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`

### Methods inherited from class net.sourceforge.pmd.AbstractPropertySource

`copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.sourceforge.pmd.Rule

`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`

### Methods inherited from interface net.sourceforge.pmd.PropertySource

`definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Constructor Detail

#### ExcessivePublicCountRule

    public ExcessivePublicCountRule()

### Method Detail

#### visit

    public Object visit(ASTMethodDeclarator node,
               Object data)

Method counts ONLY public methods.

Specified by:
  `visit` in interface `JavaParserVisitor`
Overrides:
  `visit` in class `AbstractJavaRule`

#### visit

    public Object visit(ASTFieldDeclaration node,
               Object data)

Method counts ONLY public class attributes which are not PUBLIC and static- these usually represent constants....

Specified by:
  `visit` in interface `JavaParserVisitor`
Overrides:
  `visit` in class `AbstractJavaRule`