Class ExcessiveImportsRule

All Implemented Interfaces:
AstVisitor, JavaVisitor, Rule, 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

      @Deprecated protected boolean isViolation(ASTCompilationUnit node, int reportLevel)
      Deprecated.
      since 7.18.0. This method is not used anymore and shouldn't be implemented.
    • getMetric

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