Class ExcessiveParameterListRule

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
com.qulice.pmd.rules.ExcessiveParameterListRule
All Implemented Interfaces:
net.sourceforge.pmd.lang.ast.AstVisitor, net.sourceforge.pmd.lang.java.ast.JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

public final class ExcessiveParameterListRule extends net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule
Rule to check that a method does not take too many parameters. Unlike the PMD built-in ExcessiveParameterList rule, which exempts private constructors only, this implementation skips every constructor: a value object with many immutable attributes gets a parameter count that tracks its field count rather than its complexity, and the class has nowhere else to accept those attributes. The rule stays active for methods, where a long parameter list is a design smell worth reporting. Skipping constructors here instead of through a violationSuppressXPath keeps a redundant @SuppressWarnings("PMD.ExcessiveParameterList") visible to UnnecessaryWarningSuppression, which PMD credits to the annotation whenever the annotation suppressor runs first.
Since:
1.0
  • 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
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    visit(net.sourceforge.pmd.lang.java.ast.ASTFormalParameters params, Object data)
     

    Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule

    buildTargetSelector, visitJavaNode

    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, dysfunctionReason, 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

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

    definePropertyDescriptor, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty

    Methods inherited from interface net.sourceforge.pmd.lang.rule.Rule

    initialize
  • Constructor Details

    • ExcessiveParameterListRule

      public ExcessiveParameterListRule()
      Default constructor.
  • Method Details

    • visit

      public Object visit(net.sourceforge.pmd.lang.java.ast.ASTFormalParameters params, Object data)