• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pmd / pmd / 167

19 Sep 2025 02:08PM UTC coverage: 78.657% (+0.003%) from 78.654%
167

push

github

adangel
[java] Fix #5878: DontUseFloatTypeForLoopIndices now checks the UpdateStatement as well (#6024)

18176 of 23959 branches covered (75.86%)

Branch coverage included in aggregate %.

39694 of 49614 relevant lines covered (80.01%)

0.81 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.31
/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/design/ExcessiveParameterListRule.java
1
/*
2
 * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
3
 */
4

5
package net.sourceforge.pmd.lang.java.rule.design;
6

7
import net.sourceforge.pmd.lang.ast.Node;
8
import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
9
import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters;
10
import net.sourceforge.pmd.lang.java.ast.ModifierOwner.Visibility;
11
import net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule;
12

13
/**
14
 * This rule detects an abnormally long parameter list. Note: This counts Nodes,
15
 * and not necessarily parameters, so the numbers may not match up. (But
16
 * topcount and sigma should work.)
17
 */
18
public class ExcessiveParameterListRule extends AbstractJavaCounterCheckRule<ASTFormalParameters> {
19

20
    public ExcessiveParameterListRule() {
21
        super(ASTFormalParameters.class);
1✔
22
    }
1✔
23

24
    @Override
25
    protected int defaultReportLevel() {
26
        return 10;
1✔
27
    }
28

29
    @Override
30
    protected boolean isIgnored(ASTFormalParameters node) {
31
        return areParametersOfPrivateConstructor(node);
1✔
32
    }
33

34
    private boolean areParametersOfPrivateConstructor(ASTFormalParameters params) {
35
        Node parent = params.getParent();
1✔
36
        return parent instanceof ASTConstructorDeclaration
1✔
37
                && ((ASTConstructorDeclaration) parent).getVisibility() == Visibility.V_PRIVATE;
1✔
38
    }
39

40
    /**
41
     * @deprecated since 7.18.0. This method is not used anymore and shouldn't be implemented.
42
     */
43
    @Deprecated
44
    protected boolean isViolation(ASTFormalParameters node, int reportLevel) {
45
        throw new UnsupportedOperationException("method is deprecated and not supported anymore.");
×
46
    }
47

48
    @Override
49
    protected int getMetric(ASTFormalParameters node) {
50
        return node.size();
1✔
51
    }
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc