01: /**
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */package net.sourceforge.pmd.rules.design;
04:
05: import net.sourceforge.pmd.ast.ASTFormalParameter;
06: import net.sourceforge.pmd.ast.ASTFormalParameters;
07: import net.sourceforge.pmd.util.NumericConstants;
08:
09: /**
10: * This rule detects an abnormally long parameter list.
11: * Note: This counts Nodes, and not necessarily parameters,
12: * so the numbers may not match up. (But topcount and sigma
13: * should work.)
14: */
15: // FUTURE Rename to ExcessiveParameterListRule
16: public class LongParameterListRule extends ExcessiveNodeCountRule {
17: public LongParameterListRule() {
18: super (ASTFormalParameters.class);
19: }
20:
21: // Count these nodes, but no others.
22: public Object visit(ASTFormalParameter node, Object data) {
23: return NumericConstants.ONE;
24: }
25: }
|