Class ExcessivePublicCountRule

  • All Implemented Interfaces:
    ApexParserVisitor, ApexVisitor<Object,​Object>, AstVisitor<Object,​Object>, PropertySource, Rule

    public class ExcessivePublicCountRule
    extends net.sourceforge.pmd.lang.apex.rule.internal.AbstractCounterCheckRule<ASTUserClass>
    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:
    ported from Java original of aglover
    • Constructor Detail

      • ExcessivePublicCountRule

        public ExcessivePublicCountRule()
    • Method Detail

      • defaultReportLevel

        protected int defaultReportLevel()
        Specified by:
        defaultReportLevel in class net.sourceforge.pmd.lang.apex.rule.internal.AbstractCounterCheckRule<ASTUserClass>
      • getMetric

        protected int getMetric​(ASTUserClass node)
        Specified by:
        getMetric in class net.sourceforge.pmd.lang.apex.rule.internal.AbstractCounterCheckRule<ASTUserClass>
      • getViolationParameters

        protected Object[] getViolationParameters​(ASTUserClass node,
                                                  int metric,
                                                  int limit)
        Overrides:
        getViolationParameters in class net.sourceforge.pmd.lang.apex.rule.internal.AbstractCounterCheckRule<ASTUserClass>