Update ExcessiveXX rules in design.xml

ExcessiveClassLengthRule
ExcessiveImportsRule
ExcessiveMethodLengthRule
ExcessiveParameterListRule
ExcessivePublicCountRule
This commit is contained in:
Clément Fournier committed 2021-05-28 15:35:39 +02:00
1 parent 6e4be5093e
commit c3fedf747f
7 files changed
+3 -8

No files matched your search

@@ -30,6 +30,6 @@ public class ExcessiveImportsRule extends AbstractJavaCounterCheckRule<ASTCompil
@Override
protected boolean isViolation(ASTCompilationUnit node, int reportLevel) {
return node.findChildrenOfType(ASTImportDeclaration.class).size() >= reportLevel;
return node.children(ASTImportDeclaration.class).count() >= reportLevel;
}
}
@@ -7,6 +7,7 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.java.ast.ASTConstructorDeclaration;
import net.sourceforge.pmd.lang.java.ast.ASTFormalParameters;
import net.sourceforge.pmd.lang.java.ast.AccessNode.Visibility;
import net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule;
/**
@@ -33,8 +34,7 @@ public class ExcessiveParameterListRule extends AbstractJavaCounterCheckRule<AST
private boolean areParametersOfPrivateConstructor(ASTFormalParameters params) {
Node parent = params.getParent();
if (parent instanceof ASTConstructorDeclaration) {
ASTConstructorDeclaration constructor = (ASTConstructorDeclaration) parent;
return constructor.isPrivate();
return ((ASTConstructorDeclaration) parent).getVisibility() == Visibility.V_PRIVATE;
}
return false;
}
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ExcessiveClassLengthTest extends PmdRuleTst {
// no additional unit tests
}
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ExcessiveImportsTest extends PmdRuleTst {
// no additional unit tests
}
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ExcessiveMethodLengthTest extends PmdRuleTst {
// no additional unit tests
}
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ExcessiveParameterListTest extends PmdRuleTst {
// no additional unit tests
}
@@ -6,7 +6,6 @@ package net.sourceforge.pmd.lang.java.rule.design;
import net.sourceforge.pmd.testframework.PmdRuleTst;
@org.junit.Ignore("Rule has not been updated yet")
public class ExcessivePublicCountTest extends PmdRuleTst {
// no additional unit tests
}