Class ExcessiveImportsRule

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<ASTCompilationUnit>
net.sourceforge.pmd.lang.java.rule.design.ExcessiveImportsRule
All Implemented Interfaces:
net.sourceforge.pmd.lang.ast.AstVisitor, JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

public class ExcessiveImportsRule extends net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTCompilationUnit>
ExcessiveImports attempts to count all unique imports a class contains. This rule will count a "import com.something.*;" as a single import. This is a unique situation and I'd like to create an audit type rule that captures those.
Author:
aglover
Since:
Feb 21, 2003
  • Constructor Details

    • ExcessiveImportsRule

      public ExcessiveImportsRule()
  • Method Details

    • defaultReportLevel

      protected int defaultReportLevel()
      Specified by:
      defaultReportLevel in class net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTCompilationUnit>
    • isViolation

      protected boolean isViolation(ASTCompilationUnit node, int reportLevel)
      Specified by:
      isViolation in class net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule<ASTCompilationUnit>