Update ExcessiveXX rules in design.xml
ExcessiveClassLengthRule ExcessiveImportsRule ExcessiveMethodLengthRule ExcessiveParameterListRule ExcessivePublicCountRule
This commit is contained in:
7 files changed
+3
-8
No files matched your search
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
-1
@@ -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
|
||||
}
|
||||
-1
@@ -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
|
||||
}
|
||||
-1
@@ -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
|
||||
}
|
||||
-1
@@ -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
|
||||
}
|
||||
-1
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user