Fork me on GitHub

Surefire Report

Summary

[Summary] [Package List] [Test Cases]


Tests Errors Failures Skipped Success Rate Time
2471 0 0 5 99.798% 31.667

Note: failures are anticipated and checked for with assertions while errors are unanticipated.


Package List

[Summary] [Package List] [Test Cases]


Package Tests Errors Failures Skipped Success Rate Time
net.sourceforge.pmd.lang.java.rule.comments 14 0 0 0 100% 0.017
net.sourceforge.pmd.lang.java.rule.codesize 71 0 0 0 100% 0.161
net.sourceforge.pmd.lang.java.rule.unnecessary 79 0 0 1 98.734% 0.136
net.sourceforge.pmd.lang.java.ast 148 0 0 0 100% 0.195
net.sourceforge.pmd.lang.java.rule.junit 110 0 0 0 100% 0.195
net.sourceforge.pmd.lang.java 17 0 0 0 100% 0.033
net.sourceforge.pmd.lang.java.rule.design 433 0 0 1 99.769% 4.016
net.sourceforge.pmd.lang.java.rule.unusedcode 155 0 0 1 99.355% 0.255
net.sourceforge.pmd.lang.java.rule.basic 158 0 0 0 100% 1.892
net.sourceforge.pmd.typeresolution 18 0 0 0 100% 0.015
net.sourceforge.pmd.lang.java.rule.typeresolution.xml 1 0 0 1 0% 0
net.sourceforge.pmd.cpd 19 0 0 0 100% 0.115
net.sourceforge.pmd.lang.java.rule.javabeans 23 0 0 0 100% 0.038
net.sourceforge.pmd.lang.java.rule.empty 43 0 0 0 100% 0.042
net.sourceforge.pmd 30 0 0 0 100% 1.509
net.sourceforge.pmd.lang.java.rule.coupling 42 0 0 0 100% 0.085
net.sourceforge.pmd.lang.java.rule.imports 71 0 0 0 100% 0.123
net.sourceforge.pmd.lang.java.rule.optimizations 99 0 0 0 100% 0.254
net.sourceforge.pmd.lang.java.dfa 47 0 0 0 100% 0.046
net.sourceforge.pmd.lang.java.rule.controversial 115 0 0 0 100% 3.212
net.sourceforge.pmd.lang.java.rule.clone 15 0 0 0 100% 0.021
net.sourceforge.pmd.lang.java.rule.loggingjakartacommons 23 0 0 0 100% 0.052
net.sourceforge.pmd.lang.java.rule 6 0 0 0 100% 0.011
net.sourceforge.pmd.lang.java.rule.typeresolution 52 0 0 0 100% 0.086
net.sourceforge.pmd.lang.java.rule.strictexception 45 0 0 0 100% 0.111
net.sourceforge.pmd.lang.java.symboltable 96 0 0 0 100% 0.008
net.sourceforge.pmd.lang.java.rule.sunsecure 30 0 0 0 100% 0.034
net.sourceforge.pmd.lang.java.rule.migrating 39 0 0 0 100% 0.083
net.sourceforge.pmd.lang.java.rule.loggingjava 23 0 0 0 100% 0.044
net.sourceforge.pmd.lang.java.rule.naming 112 0 0 0 100% 0.178
net.sourceforge.pmd.ant 10 0 0 0 100% 1.353
net.sourceforge.pmd.lang.java.rule.finalizers 20 0 0 0 100% 0.021
net.sourceforge.pmd.cli 10 0 0 0 100% 0.385
net.sourceforge.pmd.jaxen 12 0 0 0 100% 0.056
net.sourceforge.pmd.lang.java.rule.j2ee 25 0 0 0 100% 0.037
net.sourceforge.pmd.lang.java.rule.strings 233 0 0 1 99.571% 0.525
net.sourceforge.pmd.coverage 2 0 0 0 100% 16.261
net.sourceforge.pmd.lang.java.rule.android 8 0 0 0 100% 0.026
net.sourceforge.pmd.lang.java.rule.braces 17 0 0 0 100% 0.036

Note: package statistics are not computed recursively, they only sum up all of its testsuites numbers.

net.sourceforge.pmd.lang.java.rule.comments

Class Tests Errors Failures Skipped Success Rate Time
CommentRulesTest 12 0 0 0 100% 0.017
AbstractCommentRuleTest 2 0 0 0 100% 0

net.sourceforge.pmd.lang.java.rule.codesize

Class Tests Errors Failures Skipped Success Rate Time
CodesizeRulesTest 71 0 0 0 100% 0.161

net.sourceforge.pmd.lang.java.rule.unnecessary

Class Tests Errors Failures Skipped Success Rate Time
UnnecessaryRulesTest 79 0 0 1 98.734% 0.136

net.sourceforge.pmd.lang.java.ast

Class Tests Errors Failures Skipped Success Rate Time
ASTMethodDeclarationTest 1 0 0 0 100% 0
JDKVersionTest 33 0 0 0 100% 0.026
ASTInitializerTest 1 0 0 0 100% 0.019
ASTPackageDeclarationTest 1 0 0 0 100% 0
SimpleNodeTest 21 0 0 0 100% 0.012
ASTSwitchLabelTest 2 0 0 0 100% 0.001
EncodingTest 1 0 0 0 100% 0
ASTLocalVariableDeclarationTest 3 0 0 0 100% 0.005
ASTAnnotationTest 3 0 0 0 100% 0.046
ASTPrimarySuffixTest 2 0 0 0 100% 0.001
ASTBooleanLiteralTest 2 0 0 0 100% 0.001
MethodDeclTest 8 0 0 0 100% 0.001
ASTLiteralTest 11 0 0 0 100% 0.004
ASTAssignmentOperatorTest 3 0 0 0 100% 0.002
AccessNodeTest 13 0 0 0 100% 0.008
ASTFormalParameterTest 1 0 0 0 100% 0
ASTBlockStatementTest 2 0 0 0 100% 0.002
FieldDeclTest 7 0 0 0 100% 0.006
ASTThrowStatementTest 2 0 0 0 100% 0.001
ParserCornersTest 12 0 0 0 100% 0.051
ASTFieldDeclarationTest 5 0 0 0 100% 0.002
ASTImportDeclarationTest 4 0 0 0 100% 0.001
ASTVariableDeclaratorIdTest 5 0 0 0 100% 0.004
ClassDeclTest 5 0 0 0 100% 0.002

net.sourceforge.pmd.lang.java.rule.junit

Class Tests Errors Failures Skipped Success Rate Time
JunitRulesTest 110 0 0 0 100% 0.195

net.sourceforge.pmd.lang.java

Class Tests Errors Failures Skipped Success Rate Time
SuppressWarningsTest 17 0 0 0 100% 0.033

net.sourceforge.pmd.lang.java.rule.design

Class Tests Errors Failures Skipped Success Rate Time
DesignRulesTest 433 0 0 1 99.769% 4.016

net.sourceforge.pmd.lang.java.rule.unusedcode

Class Tests Errors Failures Skipped Success Rate Time
UnusedCodeRulesTest 155 0 0 1 99.355% 0.255

net.sourceforge.pmd.lang.java.rule.basic

Class Tests Errors Failures Skipped Success Rate Time
BasicRulesTest 158 0 0 0 100% 1.892

net.sourceforge.pmd.typeresolution

Class Tests Errors Failures Skipped Success Rate Time
PMDASMClassLoaderTest 3 0 0 0 100% 0
ClassTypeResolverTest 15 0 0 0 100% 0.015

net.sourceforge.pmd.lang.java.rule.typeresolution.xml

Class Tests Errors Failures Skipped Success Rate Time
MyTestCase 1 0 0 1 0% 0

net.sourceforge.pmd.cpd

Class Tests Errors Failures Skipped Success Rate Time
JavaTokensTokenizerTest 11 0 0 0 100% 0.011
MatchAlgorithmTest 2 0 0 0 100% 0.014
CPDCommandLineInterfaceTest 6 0 0 0 100% 0.09

net.sourceforge.pmd.lang.java.rule.javabeans

Class Tests Errors Failures Skipped Success Rate Time
JavabeansRulesTest 23 0 0 0 100% 0.038

net.sourceforge.pmd.lang.java.rule.empty

Class Tests Errors Failures Skipped Success Rate Time
EmptyRulesTest 43 0 0 0 100% 0.042

net.sourceforge.pmd

Class Tests Errors Failures Skipped Success Rate Time
ReportTest 6 0 0 0 100% 0.048
LanguageVersionDiscovererTest 3 0 0 0 100% 0
ExcludeLinesTest 2 0 0 0 100% 0.127
LanguageVersionTest 14 0 0 0 100% 0.015
RuleSetFactoryTest 5 0 0 0 100% 1.319

net.sourceforge.pmd.lang.java.rule.coupling

Class Tests Errors Failures Skipped Success Rate Time
CouplingRulesTest 42 0 0 0 100% 0.085

net.sourceforge.pmd.lang.java.rule.imports

Class Tests Errors Failures Skipped Success Rate Time
ImportsRulesTest 71 0 0 0 100% 0.123

net.sourceforge.pmd.lang.java.rule.optimizations

Class Tests Errors Failures Skipped Success Rate Time
OptimizationsRulesTest 99 0 0 0 100% 0.254

net.sourceforge.pmd.lang.java.dfa

Class Tests Errors Failures Skipped Success Rate Time
AcceptanceTest 31 0 0 0 100% 0.029
StructureTest 1 0 0 0 100% 0
DAAPathFinderTest 1 0 0 0 100% 0.001
StatementAndBraceFinderTest 6 0 0 0 100% 0.016
GeneralFiddlingTest 2 0 0 0 100% 0
VariableAccessTest 1 0 0 0 100% 0
DataFlowNodeTest 5 0 0 0 100% 0

net.sourceforge.pmd.lang.java.rule.controversial

Class Tests Errors Failures Skipped Success Rate Time
ControversialRulesTest 115 0 0 0 100% 3.212

net.sourceforge.pmd.lang.java.rule.clone

Class Tests Errors Failures Skipped Success Rate Time
CloneRulesTest 15 0 0 0 100% 0.021

net.sourceforge.pmd.lang.java.rule.loggingjakartacommons

Class Tests Errors Failures Skipped Success Rate Time
LoggingJakartaCommonsRulesTest 23 0 0 0 100% 0.052

net.sourceforge.pmd.lang.java.rule

Class Tests Errors Failures Skipped Success Rate Time
JavaRuleViolationTest 2 0 0 0 100% 0.001
XPathRuleTest 4 0 0 0 100% 0.01

net.sourceforge.pmd.lang.java.rule.typeresolution

Class Tests Errors Failures Skipped Success Rate Time
CloneMethodMustImplementCloneableTest 12 0 0 0 100% 0.009
UnusedImportsTest 16 0 0 0 100% 0.024
SignatureDeclareThrowsExceptionTest 12 0 0 0 100% 0.017
LooseCouplingTest 12 0 0 0 100% 0.036

net.sourceforge.pmd.lang.java.rule.strictexception

Class Tests Errors Failures Skipped Success Rate Time
StrictExceptionRulesTest 45 0 0 0 100% 0.111

net.sourceforge.pmd.lang.java.symboltable

Class Tests Errors Failures Skipped Success Rate Time
NameOccurrencesTest 7 0 0 0 100% 0
SourceFileScopeTest 4 0 0 0 100% 0
ScopeCreationVisitorTest 1 0 0 0 100% 0
MethodNameDeclarationTest 1 0 0 0 100% 0
MethodScopeTest 3 0 0 0 100% 0
GlobalScopeTest 2 0 0 0 100% 0
ApplierTest 1 0 0 0 100% 0
VariableUsageFinderFunctionTest 1 0 0 0 100% 0
ScopeAndDeclarationFinderTest 1 0 0 0 100% 0
VariableNameDeclarationTest 8 0 0 0 100% 0
ImageFinderFunctionTest 2 0 0 0 100% 0
SimpleTypedNameDeclarationTest 1 0 0 0 100% 0
TypeSetTest 26 0 0 0 100% 0
AcceptanceTest 8 0 0 0 100% 0.001
LocalScopeTest 8 0 0 0 100% 0
ClassScopeTest 22 0 0 0 100% 0.007

net.sourceforge.pmd.lang.java.rule.sunsecure

Class Tests Errors Failures Skipped Success Rate Time
SunSecureRulesTest 30 0 0 0 100% 0.034

net.sourceforge.pmd.lang.java.rule.migrating

Class Tests Errors Failures Skipped Success Rate Time
MigratingRulesTest 39 0 0 0 100% 0.083

net.sourceforge.pmd.lang.java.rule.loggingjava

Class Tests Errors Failures Skipped Success Rate Time
LoggingJavaRulesTest 23 0 0 0 100% 0.044

net.sourceforge.pmd.lang.java.rule.naming

Class Tests Errors Failures Skipped Success Rate Time
NamingRulesTest 112 0 0 0 100% 0.178

net.sourceforge.pmd.ant

Class Tests Errors Failures Skipped Success Rate Time
PMDTaskTest 10 0 0 0 100% 1.353

net.sourceforge.pmd.lang.java.rule.finalizers

Class Tests Errors Failures Skipped Success Rate Time
FinalizersRulesTest 20 0 0 0 100% 0.021

net.sourceforge.pmd.cli

Class Tests Errors Failures Skipped Success Rate Time
XPathCLITest 1 0 0 0 100% 0.022
CLITest 9 0 0 0 100% 0.363

net.sourceforge.pmd.jaxen

Class Tests Errors Failures Skipped Success Rate Time
RegexpAcceptanceTest 1 0 0 0 100% 0.003
DocumentNavigatorTest 11 0 0 0 100% 0.053

net.sourceforge.pmd.lang.java.rule.j2ee

Class Tests Errors Failures Skipped Success Rate Time
J2EERulesTest 25 0 0 0 100% 0.037

net.sourceforge.pmd.lang.java.rule.strings

Class Tests Errors Failures Skipped Success Rate Time
StringsRulesTest 229 0 0 1 99.563% 0.525
AvoidDuplicateLiteralsRuleTest 4 0 0 0 100% 0

net.sourceforge.pmd.coverage

Class Tests Errors Failures Skipped Success Rate Time
PMDCoverageTest 2 0 0 0 100% 16.261

net.sourceforge.pmd.lang.java.rule.android

Class Tests Errors Failures Skipped Success Rate Time
AndroidRulesTest 8 0 0 0 100% 0.026

net.sourceforge.pmd.lang.java.rule.braces

Class Tests Errors Failures Skipped Success Rate Time
BracesRulesTest 17 0 0 0 100% 0.036

Test Cases

[Summary] [Package List] [Test Cases]

JavaTokensTokenizerTest

testDiscardImports 0
testCommentsIgnored 0
testDiscardSimpleOneLineAnnotation 0.008
test1 0.001
test2 0
testDiscardPkgStmts 0
testIgnoreComments 0.001
testIgnoreBetweenSpecialAnnotation 0
testIgnoreBetweenSpecialAnnotationAndIgnoreAnnotations 0
testDiscardSemicolons 0.001
testDiscardOneLineAnnotationWithParams 0

ASTMethodDeclarationTest

testGetVariableName 0

JavabeansRulesTest

BeanMembersShouldSerialize::0 private String, no accessor 0
BeanMembersShouldSerialize::1 private static String 0.002
BeanMembersShouldSerialize::2 private transient String 0.002
BeanMembersShouldSerialize::3 getter, no setter 0
BeanMembersShouldSerialize::4 setter, no getter 0.002
BeanMembersShouldSerialize::5 both accessors, yay! 0.001
BeanMembersShouldSerialize::6 setFoo and isFoo is OK for booleans 0.001
BeanMembersShouldSerialize::7 setFoo and isFoo is not OK for Strings 0.001
BeanMembersShouldSerialize::8 prefix is off by default 0.001
BeanMembersShouldSerialize::9 valid prefix 0.001
BeanMembersShouldSerialize::10 invalid prefix 0.001
BeanMembersShouldSerialize::11 interface 0.002
BeanMembersShouldSerialize::12 @SuppressWarnings("serial") 0
BeanMembersShouldSerialize::13 ClassCastException on generic method 0.002
BeanMembersShouldSerialize::14 #881 private final without setter is flagged 0.001
MissingSerialVersionUID::0 Happy case 0.005
MissingSerialVersionUID::1 Simple failure case 0
MissingSerialVersionUID::2 failure using java.io.Serializable 0
MissingSerialVersionUID::3 implements Serializable and provides a serialVersionUID 0
MissingSerialVersionUID::4 TEST5 0
MissingSerialVersionUID::5 interface 0
MissingSerialVersionUID::6 abstract case 0.016
MissingSerialVersionUID::7 @SuppressWarnings("serial") 0

NameOccurrencesTest

testQualifiedOccurrence 0
testSuper 0
testThis 0
testSimpleVariableOccurrence 0
testNameLinkage 0
testIsSelfAssignment 0
testEnumStaticUsage 0

AcceptanceTest

test_10 0
test_11 0.001
test_12 0.001
test_13 0.001
test_14 0.001
test_15 0.001
test_16 0
test_17 0.001
test_18 0
test_19 0.002
test_20 0.001
test_21 0.001
test_22 0
test_23 0.001
test_24 0.001
test_25 0.001
test_26 0.003
test_27 0.001
test_28 0.002
test_29 0.001
test_30 0.002
testLabelledBreakLockup 0.001
testbook 0
test_1 0.001
test_2 0.001
test_3 0.001
test_4 0
test_6 0.001
test_7 0.001
test_8 0
test_9 0.001

SourceFileScopeTest

testPackageIsEmptyString 0
testNestedClasses 0
testClassDeclAppears 0
testPackageNameFound 0

CommentRulesTest

CommentContent::0 Includes bad words 0.001
CommentRequired::0 Missing comments - all required (default). 0.007
CommentRequired::1 All elements have javadoc comments. 0
CommentRequired::2 Missing comments - only class level required. 0
CommentRequired::3 Too many comments - all comments are unwanted. 0
CommentRequired::4 #1115 commentRequiredRule in pmd 5.1 is not working properly 0.004
CommentRequired::5 #1115 commentRequiredRule in pmd 5.1 is not working properly - without new lines 0
CommentRequired::6 #1289 CommentRequired not ignored if javadoc {@inheritDoc} anon inner classes 0
CommentRequired::7 #1434 CommentRequired raises violation on serialVersionUID field 0.001
CommentRequired::8 comment required on serialVersionUID of wrong type 0.001
CommentRequired::9 serialVersionUID comment required 0.002
CommentSize::0 Too many lines 0.001

JDKVersionTest

testMultipleGenerics 0
testGenericsInMethodCall 0
testTryWithResourcesWithAnnotations 0.001
testMulticatchWithAnnotations 0.001
testTryWithResourcesMulti 0.001
testTryWithResources 0.001
testJDK15GenericsSyntaxShouldPassWith15 0
testJDK15ForLoopSyntaxShouldPassWith15 0.001
testJDK15ForLoopSyntaxWithModifiers 0
testVariousParserBugs 0.001
testNestedClassInMethodBug 0.002
testTryWithResourcesSemi 0
testAssertAsVariableDeclIdentifierFailsWith1_4 0.001
testVarargsShouldFailWith14 0.001
testEnumAsKeywordShouldFailWith14 0
testBinaryAndUnderscoresInNumericalLiterals 0.002
testAssertAsKeywordFailsWith1_3 0.003
testVarargsShouldPassWith15 0.001
testEnumAsKeywordShouldPassWith15 0
testJDK15ForLoopShouldFailWith14 0.002
testAssertAsKeywordVariantsSucceedWith1_4 0
testAssertAsIdentifierSucceedsWith1_3 0.001
testGenericINAnnotation 0
testMulticatch 0
testAnnotatedLocals 0
testGenericDiamond 0.001
testAnnotatedParams 0
testStringInSwitch 0.001
testAssertAsMethodNameIdentifierFailsWith1_4 0
testGenericReturnType 0.001
testAssertAsIdentifierSucceedsWith1_3_test2 0.004
testEnumAsIdentifierShouldFailWith15 0
testEnumAsIdentifierShouldPassWith14 0

CodesizeRulesTest

CyclomaticComplexity::0 Simple method 0.001
CyclomaticComplexity::1 testLessComplicatedThanReportLevel 0.003
CyclomaticComplexity::2 Complicated method 0.004
CyclomaticComplexity::3 Constructor 0.007
CyclomaticComplexity::4 Testing new parameter showClassMethods 0.002
CyclomaticComplexity::5 Testing new parameter showMethodsMethods 0.001
CyclomaticComplexity::6 Testing default value of showClassMethods and showClassesComplexity 0.004
CyclomaticComplexity::7 #984 Cyclomatic complexity should treat constructors like methods: 1 - showMethodsComplexity=true 0.012
CyclomaticComplexity::8 #984 Cyclomatic complexity should treat constructors like methods: 2 - showMethodsComplexity=false 0.002
CyclomaticComplexity::9 #985 Suppressed methods shouldn't affect avg CyclomaticComplexity 0.003
ExcessiveClassLength::0 short 0.001
ExcessiveClassLength::1 long 0.006
ExcessiveClassLength::2 long class - changed minimum 0.002
ExcessiveMethodLength::0 short 0.001
ExcessiveMethodLength::1 long, normal range 0.002
ExcessiveMethodLength::2 long, minimum with longer range 0.003
ExcessiveMethodLength::3 not quite long 0.002
ExcessiveMethodLength::4 long 0.002
ExcessiveParameterList::0 short 0.002
ExcessiveParameterList::1 long 0.002
ExcessivePublicCount::0 Few public fields 0.001
ExcessivePublicCount::1 Too many public fields 0.002
ExcessivePublicCount::2 Static final 0.001
ExcessivePublicCount::3 Some public methods 0.008
ExcessivePublicCount::4 Reduced minimum 0
ExcessivePublicCount::5 Private fields 0.002
ExcessivePublicCount::6 Private methods 0.002
ModifiedCyclomaticComplexity::0 Simple method 0.002
ModifiedCyclomaticComplexity::1 testLessComplicatedThanReportLevel 0.001
ModifiedCyclomaticComplexity::2 Complicated method 0.003
ModifiedCyclomaticComplexity::3 Constructor 0.002
NPathComplexity::0 ok 0.003
NPathComplexity::1 fail, with minimum 0.003
NPathComplexity::2 failure case 0.005
NPathComplexity::3 test case for bug 3484404 (Invalid NPath calculation in return statement) 0.002
NPathComplexity::4 test case for bug 3484404 (Invalid NPath calculation in return statement) with minimum 25 0.005
NcssConstructorCount::0 short 0.002
NcssConstructorCount::1 lots of comments 0.002
NcssConstructorCount::2 long method 0.002
NcssConstructorCount::3 long method - changed minimum 0.001
NcssMethodCount::0 short 0.002
NcssMethodCount::1 lots of comments 0.001
NcssMethodCount::2 long method 0.002
NcssMethodCount::3 long method - changed minimum 0.002
NcssTypeCount::0 short 0.003
NcssTypeCount::1 lots of comments 0
NcssTypeCount::2 long method 0.004
NcssTypeCount::3 long method - changed minimum 0.002
StdCyclomaticComplexity::0 Simple method 0.001
StdCyclomaticComplexity::1 Simple method 0.001
StdCyclomaticComplexity::2 Complicated method 0.002
StdCyclomaticComplexity::3 Constructor 0.002
StdCyclomaticComplexity::4 Testing new parameter showClassMethods 0.001
StdCyclomaticComplexity::5 Testing new parameter showMethodsMethods 0.001
StdCyclomaticComplexity::6 Testing default value of showClassMethods and showClassesComplexity 0.002
StdCyclomaticComplexity::7 #984 Cyclomatic complexity should treat constructors like methods: 1 - showMethodsComplexity=true 0.003
StdCyclomaticComplexity::8 #984 Cyclomatic complexity should treat constructors like methods: 2 - showMethodsComplexity=false 0.001
StdCyclomaticComplexity::9 #985 Suppressed methods shouldn't affect avg CyclomaticComplexity 0.002
TooManyFields::0 3 fields, max is 15 0.001
TooManyFields::1 3 fields, reduced max to 2 0.001
TooManyFields::2 16 fields, bad 0.001
TooManyFields::3 12 fields, but 6 in inner and 6 in outer 0.001
TooManyFields::4 outer class, inner interface, both OK 0.002
TooManyFields::5 interface with 10 fields 0.001
TooManyFields::6 2 inner classes, each with > 10 fields 0.003
TooManyFields::7 anonymous class with a field 0.001
TooManyFields::8 lots of static finals, those are ok 0.002
TooManyMethods::0 Less than 10 methods. 0.001
TooManyMethods::1 More than 10 methods. 0.001
TooManyMethods::2 Less than 10 methods, with getter/setter... 0.002
TooManyMethods::3 #1457 TooManyMethods counts inner class methods 0.001

StringsRulesTest

AppendCharacterWithChar::0 appending single character string, should fail 0.002
AppendCharacterWithChar::1 appending single char, should be ok 0.004
AppendCharacterWithChar::2 this is probably wrong, but shouldn't fail 0.002
AppendCharacterWithChar::3 concatenates a three character int 0.002
AppendCharacterWithChar::4 concatenates a string explicitly set to 1 character, not explicitly checking right now 0.003
AppendCharacterWithChar::5 for statement 0.003
AppendCharacterWithChar::6 concatenates an escaped character 0.003
AppendCharacterWithChar::7 concatenates all escaped characters 0.003
AppendCharacterWithChar::8 concatenates a single upper case 0.001
AppendCharacterWithChar::9 concatenates a single number 0.002
AppendCharacterWithChar::10 concatenates a single character & 0.002
AppendCharacterWithChar::11 concatenates two characters 0.002
AppendCharacterWithChar::12 a single octal character 0.002
AppendCharacterWithChar::13 octal character in longer string 0.003
AvoidDuplicateLiterals::0 duplicate literals in argument list 0.003
AvoidDuplicateLiterals::1 literal int argument, ok for now 0.002
AvoidDuplicateLiterals::2 duplicate literals in field decl 0.002
AvoidDuplicateLiterals::3 duplicate literals in annotations 0.002
AvoidDuplicateLiterals::4 duplicate literals in annotations, skipped 0.004
AvoidDuplicateLiterals::5 threshold property 0.002
AvoidDuplicateLiterals::6 exception list property 0.003
AvoidDuplicateLiterals::7 exception list and separator properties 0.002
AvoidDuplicateLiterals::8 minimum length property, minimum length reached 0.002
AvoidDuplicateLiterals::9 minimum length property, minimum length not reached 0.003
AvoidDuplicateLiterals::10 minimum length property, default value 0.002
AvoidDuplicateLiterals::11 #1425 Invalid XML Characters in Output 0.002
AvoidStringBufferField::0 Basic test case for AvoidStringBufferField 0.001
ConsecutiveAppendsShouldReuse::0 1, Single append, should be ok 0.006
ConsecutiveAppendsShouldReuse::1 2, Consecutive appends with reuse, should be ok 0.003
ConsecutiveAppendsShouldReuse::2 3, Single append on different method, should be ok 0.004
ConsecutiveAppendsShouldReuse::3 4, Single append on different objects, should be ok 0.003
ConsecutiveAppendsShouldReuse::4 5, Consecutive literal appends without reuse, not ok 0.003
ConsecutiveAppendsShouldReuse::5 6, Consecutive variable appends without reuse, not ok 0.003
ConsecutiveAppendsShouldReuse::6 7, Consecutive appends in different blocks, should be ok 0.004
ConsecutiveAppendsShouldReuse::7 #1180 False Positive for ConsecutiveAppendsShouldReuse on different variable names 0.001
ConsecutiveAppendsShouldReuse::8 #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer 0.002
ConsecutiveAppendsShouldReuse::9 #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer - part 2 0.001
ConsecutiveAppendsShouldReuse::10 #1370 ConsecutiveAppendsShouldReuse not detected properly on StringBuffer - part 3 0.002
ConsecutiveLiteralAppends::0 1, Single append, should be ok 0.003
ConsecutiveLiteralAppends::1 2, Back to back append, not ok 0.001
ConsecutiveLiteralAppends::2 2, re-running with threshold 0.003
ConsecutiveLiteralAppends::3 3, Appends broken up by variable 0.002
ConsecutiveLiteralAppends::4 4, Appends with literal appends 0.002
ConsecutiveLiteralAppends::5 5, Appends broken up by while loop 0.003
ConsecutiveLiteralAppends::6 6, Appends, then a variable 0.002
ConsecutiveLiteralAppends::7 7, Appends, then a variable 0.003
ConsecutiveLiteralAppends::8 8, Appends, then a while 0.002
ConsecutiveLiteralAppends::9 9, Multiple appends in same while 0.003
ConsecutiveLiteralAppends::10 10, Multiple appends in same while, with multiple outside that while 0.002
ConsecutiveLiteralAppends::11 11, Multiple appends in same while, none outside the loop 0.002
ConsecutiveLiteralAppends::12 12, Two loops, not concurrent appends though 0.003
ConsecutiveLiteralAppends::13 13, A bunch of loops, but nothing concurrent 0.004
ConsecutiveLiteralAppends::14 14, A bunch of loops, one concurrent 0.003
ConsecutiveLiteralAppends::15 15, A bunch of loops, none concurrent, separated by else 0.004
ConsecutiveLiteralAppends::16 16, Additive Expression 1 0.002
ConsecutiveLiteralAppends::17 17, Additive Expression 2 0.005
ConsecutiveLiteralAppends::18 18, End with literal append 0.002
ConsecutiveLiteralAppends::19 19, A bunch of appends 0.002
ConsecutiveLiteralAppends::20 20, Suffix append follwed by real append 0.002
ConsecutiveLiteralAppends::21 21, Appends separated by an if 0.003
ConsecutiveLiteralAppends::22 22, calls to methods in append 0.001
ConsecutiveLiteralAppends::23 23, force 2 failures on 3 lines 0.003
ConsecutiveLiteralAppends::24 23, re-running with threshold 0.002
ConsecutiveLiteralAppends::25 24, Appends from within switch statement 0.003
ConsecutiveLiteralAppends::26 25, Appends from within several different ifs 0.006
ConsecutiveLiteralAppends::27 26, One append in if, one in else 0
ConsecutiveLiteralAppends::28 27, Concurrent Appends from within switch statement 0.001
ConsecutiveLiteralAppends::29 28, Additive inside an if statement 0.003
ConsecutiveLiteralAppends::30 29, Adding two strings only 0.002
ConsecutiveLiteralAppends::31 30, Method call in append 0.002
ConsecutiveLiteralAppends::32 31, Adding two strings together then another append 0.002
ConsecutiveLiteralAppends::33 32, Including the constructor's string 0.002
ConsecutiveLiteralAppends::34 33, Additive in the constructor 0.002
ConsecutiveLiteralAppends::35 34, Additive in the constructor 0.003
ConsecutiveLiteralAppends::36 35, For block without braces 0.002
ConsecutiveLiteralAppends::37 36, Appends broken up by method call 0.002
ConsecutiveLiteralAppends::38 37, Intervening method call not related to append 0.001
ConsecutiveLiteralAppends::39 38, Intervening method call not related to append 0.002
ConsecutiveLiteralAppends::40 39, Buffer as class variable, accessed in 2 methods 0.002
ConsecutiveLiteralAppends::41 40, Call to external method with subtraction 0.005
ConsecutiveLiteralAppends::42 41, Call to external method with addition, not string appending 0.002
ConsecutiveLiteralAppends::43 42, Using variable string array 0.005
ConsecutiveLiteralAppends::44 43, Using variable char array 0
skipped
ConsecutiveLiteralAppends::44 43, Using variable char array 0
ConsecutiveLiteralAppends::45 44, Appending of not String additive expressions 0.005
ConsecutiveLiteralAppends::46 #1175 false positive for StringBuilder.append called 2 consecutive times 0
ConsecutiveLiteralAppends::47 #1369 ConsecutiveLiteralAppends not detected properly on StringBuffer 0.003
ConsecutiveLiteralAppends::48 #1384 NullPointerException in ConsecutiveLiteralAppendsRule - 1 0.001
ConsecutiveLiteralAppends::49 #1384 NullPointerException in ConsecutiveLiteralAppendsRule - 2 0.002
ConsecutiveLiteralAppends::50 #1401 False positive for StringBuilder.append called with constructor 0.002
InefficientEmptyStringCheck::0 test is ok, ok 0.005
InefficientEmptyStringCheck::1 String.trim.length is called, should have failed 0.002
InefficientEmptyStringCheck::2 String.trim.length not is called, ok 0.001
InefficientEmptyStringCheck::3 String.trim.length is called, should have failed 0.002
InefficientEmptyStringCheck::4 String.trim.length is called, assigned to int, ok 0.002
InefficientEmptyStringCheck::5 String.trim.length is called, assigned to boolean, should have failed 0.001
InefficientEmptyStringCheck::6 Using trim.length to find the length and compare to 1, OK 0.002
InefficientEmptyStringCheck::7 Passes trim().length() and 0 to another method 0.002
InefficientEmptyStringCheck::8 Compares the length against a mathematical function 0.002
InefficientStringBuffering::0 concatenating a literal to a method return value 0.002
InefficientStringBuffering::1 same as TEST1, but in SB constructor 0.002
InefficientStringBuffering::2 chained appends 0.002
InefficientStringBuffering::3 concatenating two literals in SB constructor 0.002
InefficientStringBuffering::4 concatenating two literals post-construction 0.001
InefficientStringBuffering::5 case where concatenation is not a child of a BlockStatement, but instead is a child of an ExplicitConstructorInvocation 0.002
InefficientStringBuffering::6 don't error out on array instantiation 0.002
InefficientStringBuffering::7 usage of the StringBuffer constructor that takes an int 0.002
InefficientStringBuffering::8 nested 0.002
InefficientStringBuffering::9 looking up too high 0.002
InefficientStringBuffering::10 looking too deep 0.002
InefficientStringBuffering::11 concatenating two non-literals 0.002
InefficientStringBuffering::12 concatenating method + int 0.017
InefficientStringBuffering::13 JTextArea.append 0
InefficientStringBuffering::14 don't get thrown off by a buried literal 0
InefficientStringBuffering::15 sb.delete shouldn't trigger it 0
InefficientStringBuffering::16 skip additions involving static finals, compiler will do constant folding for these 0
InefficientStringBuffering::17 for statement without braces 0
InefficientStringBuffering::18 if statement without braces 0
InefficientStringBuffering::19 3 args version of StringBuffer.append 0.003
InefficientStringBuffering::20 compile-time concats are ok 0.002
InefficientStringBuffering::21 compile-time concats are ok, v2 0.002
InefficientStringBuffering::22 1503099, init with two string lengths 0.003
InefficientStringBuffering::23 1503099, append with two string lengths 0.002
InefficientStringBuffering::24 3109408, false + with adding two integers in constructor 0.003
InefficientStringBuffering::25 1503099, adding two integers 0.001
InsufficientStringBufferDeclaration::0 1, StringBuffer allocated with enough space 0.002
InsufficientStringBufferDeclaration::1 2, StringBuffer not allocated with enough space 0.002
InsufficientStringBufferDeclaration::2 3, StringBuffer allocated with space 0.003
InsufficientStringBufferDeclaration::3 4, StringBuffer allocated from variable 0.006
InsufficientStringBufferDeclaration::4 5, creating a new StringBuffer 0.002
InsufficientStringBufferDeclaration::5 6, Initialize with a specific String 0.018
InsufficientStringBufferDeclaration::6 7, appends inside if statements 0
InsufficientStringBufferDeclaration::7 8, Field level variable 0
InsufficientStringBufferDeclaration::8 9, Field level variable 0
InsufficientStringBufferDeclaration::9 10, Appending non-literals 0
InsufficientStringBufferDeclaration::10 11, Initialized to null 0
InsufficientStringBufferDeclaration::11 12, Passed in as parameter 0
InsufficientStringBufferDeclaration::12 13, compound append 0.002
InsufficientStringBufferDeclaration::13 14, Compound append, presized just fine 0.003
InsufficientStringBufferDeclaration::14 15, Append int, incorrect presize 0.002
InsufficientStringBufferDeclaration::15 16, Append int, properly presized 0.005
InsufficientStringBufferDeclaration::16 17, Append char, incorrect presize 0.002
InsufficientStringBufferDeclaration::17 18, Append char, properly presized 0.013
InsufficientStringBufferDeclaration::18 19, String concatenation, incorrect presize 0.003
InsufficientStringBufferDeclaration::19 20, String concatenation with non-literal, incorrect presize 0.002
InsufficientStringBufferDeclaration::20 21, Incorrectly presized twice 0.015
InsufficientStringBufferDeclaration::21 22, appends inside if/else if/else statements 0
InsufficientStringBufferDeclaration::22 23, appends inside if/else if/else statements 0
InsufficientStringBufferDeclaration::23 24, appends inside if/else if/else statements 0
InsufficientStringBufferDeclaration::24 25, Compound ifs 0
InsufficientStringBufferDeclaration::25 26, Compound if, pushed over the edge 0.002
InsufficientStringBufferDeclaration::26 28, Compound if, pushed over the edge 0.003
InsufficientStringBufferDeclaration::27 27, Switch statement doesn't exceed 16 characters 0.002
InsufficientStringBufferDeclaration::28 29, Appending from a cast 0.002
InsufficientStringBufferDeclaration::29 30, Appending chars 0.002
InsufficientStringBufferDeclaration::30 31, Appending from a cast in ifs 0.002
InsufficientStringBufferDeclaration::31 32, Constructor from math 0.002
InsufficientStringBufferDeclaration::32 33, Uses setLength 0.003
InsufficientStringBufferDeclaration::33 34, Uses setLength incorrectly 0.002
InsufficientStringBufferDeclaration::34 35, Append of 'null' literal. 0.002
InsufficientStringBufferDeclaration::35 36, Append of boolean literal. 0.002
InsufficientStringBufferDeclaration::36 37, Initialization with multiply - bug 1743938 0.002
InsufficientStringBufferDeclaration::37 38, Uses setLength 0 with subsequently more than 16, but less than initial 0.002
InsufficientStringBufferDeclaration::38 3175710: NPE in InsufficientStringBufferDeclaration 0.002
InsufficientStringBufferDeclaration::39 3516101: InsufficientStringBufferDeclaration fails to parse hex 0.017
InsufficientStringBufferDeclaration::40 Append a hex int 0
InsufficientStringBufferDeclaration::41 #1371 InsufficientStringBufferDeclaration not detected properly on StringBuffer 0
InsufficientStringBufferDeclaration::42 #1380 InsufficientStringBufferDeclaration false positive when literal string passed to a lookup service 0
InsufficientStringBufferDeclaration::43 #1409 NullPointerException in InsufficientStringBufferRule 0
InsufficientStringBufferDeclaration::44 #1413 False positive StringBuffer constructor with ?: int value 0
StringBufferInstantiationWithChar::0 OK 0
StringBufferInstantiationWithChar::1 failure case 0
StringInstantiation::0 new 'new String's 0
StringInstantiation::1 new String array 0.002
StringInstantiation::2 using multiple parameter constructor 0.001
StringInstantiation::3 using 4 parameter constructor 0.002
StringInstantiation::4 byte array constructor is ok 0.002
StringInstantiation::5 Method returning new String 0.002
StringInstantiation::6 Not a new String 0.001
StringInstantiation::7 Returns new String(str) 0.002
StringToString::0 local var 0.001
StringToString::1 parameter 0.002
StringToString::2 field 0.002
StringToString::3 primitive 0.001
StringToString::4 multiple similar params 0.002
StringToString::5 string array 0.002
StringToString::6 ToString on String Array Object 0.001
StringToString::7 Should only look at toString's of Arrays 0.001
StringToString::8 #959 StringToString False Positive 0.003
StringToString::9 #1397 StringToString should ignore method references 0.003
UnnecessaryCaseChange::0 failure case with toUpperCase().equals() 0.002
UnnecessaryCaseChange::1 failure case with toLowerCase().equals() 0.017
UnnecessaryCaseChange::2 failure case with toUpperCase().equalsIgnoreCase() 0
UnnecessaryCaseChange::3 don't flag toUpperCase() invocations with Locale args 0
UnnecessaryCaseChange::4 failure case with toLowerCase().equals() 0
UseEqualsToCompareStrings::0 failure case using == 0
UseEqualsToCompareStrings::1 failure case using != 0
UseEqualsToCompareStrings::2 using equals, OK 0
UseEqualsToCompareStrings::3 using compareTo, OK 0
UseEqualsToCompareStrings::4 using length, OK 0
UseIndexOfChar::0 failure case 0.001
UseIndexOfChar::1 using single quotes, OK 0.002
UseIndexOfChar::2 indexOf multi-character literal, OK 0.002
UseIndexOfChar::3 using indexOf(singleCharString, int) 0.001
UseIndexOfChar::4 using lastIndexOf(singleCharString) 0.002
UseIndexOfChar::5 complicated expressions are ok 0.002
UseIndexOfChar::6 all escaped characters 0.001
UseIndexOfChar::7 a single octal character 0.002
UseIndexOfChar::8 octal character in longer string 0.002
UseIndexOfChar::9 UseIndexOfChar: null pointer with lambdas 0.002
UseIndexOfChar::10 #1211 PMD is failing with NPE for rule UseIndexOfChar while analyzing Jdk 8 Lambda expression 0.003
UseStringBufferLength::0 Using length properly 0.002
UseStringBufferLength::1 StringBuffer.toString.equals(""), bad 0.002
UseStringBufferLength::2 StringBuffer.toString.equals("foo"), ok 0.002
UseStringBufferLength::3 StringBuffer.toString.length(), bad 0.002
UseStringBufferLength::4 no literals 0.002
UseStringBufferLength::5 empty + non-empty string sb.toString().equals("" + "x"), ok (as in: do not use StringBuffer.length()) 0.001
UseStringBufferLength::6 sb.toString().trim().equals(""), ok (as in: do not use StringBuffer.length()) 0.002
UseStringBufferLength::7 sb.toString().equals(baz("")), ok 0.016
UseStringBufferLength::8 sb.toString().trim().length == 0, ok (as in: do not use StringBuffer.length()) 0
UseStringBufferLength::9 #1177 Incorrect StringBuffer warning when that class is not used 0
UselessStringValueOf::0 valueOf in concatenation 0
UselessStringValueOf::1 valueOf in String conversion 0
UselessStringValueOf::2 valueOf as first expression in concatenation 0
UselessStringValueOf::3 valueOf as first/last expression in concatenation 0
UselessStringValueOf::4 valueOf as first/last expression in concatenation 0
UselessStringValueOf::5 [ 1977438 ] False positive for UselessStringValueOf 0.001
UselessStringValueOf::6 #976 False positive for UselessStringValueOf 0.001
UselessStringValueOf::7 #1084 NPE at UselessStringValueOfRule.java:36 0.003

ScopeCreationVisitorTest

testScopesAreCreated 0

UnnecessaryRulesTest

UnnecessaryConversionTemporary::0 all glommed together 0.002
UnnecessaryConversionTemporary::1 called on String 0.001
UnnecessaryFinalModifier::0 TEST1 0.001
UnnecessaryFinalModifier::1 TEST2 0.001
UnnecessaryFinalModifier::2 TEST3 0.002
UnnecessaryFinalModifier::3 TEST4 0.001
UnnecessaryFinalModifier::4 TEST5 0.001
UnnecessaryFinalModifier::5 TEST6 0.002
UnnecessaryFinalModifier::6 final method in inner class of non-final outer class 0.001
UnnecessaryFinalModifier::7 final method in inner final class 0.001
UnnecessaryFinalModifier::8 #1464 UnnecessaryFinalModifier false positive on a @SafeVarargs method 0.002
UnnecessaryReturn::0 bad 0.002
UnnecessaryReturn::1 ok since method is not void 0.001
UnnecessaryReturn::2 ok since return is in sub block 0.002
UnnecessaryReturn::3 interface methods don't have return statements 0.001
UnnecessaryReturn::4 abstract methods don't have return statements 0.001
UnnecessaryReturn::5 return inside a catch - ok 0.002
UnusedNullCheckInEquals::0 failure case 0.002
UnusedNullCheckInEquals::1 different var, 'tis ok 0.002
UnusedNullCheckInEquals::2 proper usage 0.001
UnusedNullCheckInEquals::3 variation of correct usage 0.001
UnusedNullCheckInEquals::4 var is not used in equals() call 0.001
UnusedNullCheckInEquals::5 [ 1481051 ] false + UnusedNullCheckInEquals 0.019
UnusedNullCheckInEquals::6 shouldn't this fail? Yes, it should. Fixed it, so that method calls to equals on variables are considered, too. 0
UnusedNullCheckInEquals::7 Arrays can't be compared directly but with Arrays.equals(). 0
UselessOperationOnImmutable::0 useless operation on BigDecimal 0
UselessOperationOnImmutable::1 useless operation on BigInteger 0
UselessOperationOnImmutable::2 using the result, so OK 0
UselessOperationOnImmutable::3 using the result in a method call, so OK 0
UselessOperationOnImmutable::4 BigInteger obtained from compound method call 0
UselessOperationOnImmutable::5 Using generics on List, OK 0
UselessOperationOnImmutable::6 BigInteger in conditional statement 0.001
UselessOperationOnImmutable::7 1702782, Immutable used in comparison 0.002
UselessOperationOnImmutable::8 String calls in expressions 0.002
UselessOperationOnImmutable::9 BigInteger calls in expression 0.003
UselessOperationOnImmutable::10 2645268, ClassCastException using Annotation on Local Field 0.002
UselessOverridingMethod::0 call super 0.002
UselessOverridingMethod::1 call super with same argument 0.001
UselessOverridingMethod::2 call super with different argument 0.001
UselessOverridingMethod::3 call super with different argument 2 0.002
UselessOverridingMethod::4 call super with different argument 3 0.001
UselessOverridingMethod::5 call super with inverted arguments 0.001
UselessOverridingMethod::6 return value of super 0.001
UselessOverridingMethod::7 return value of super with argument 0.002
UselessOverridingMethod::8 return value of super after adding a string 0.002
UselessOverridingMethod::9 do not crash on abstract methods 0.001
UselessOverridingMethod::10 do not crash on interfaces 0.002
UselessOverridingMethod::11 do not crash on empty returns 0.001
UselessOverridingMethod::12 do not crash on super 0.002
UselessOverridingMethod::13 call super with different argument 4 0.001
UselessOverridingMethod::14 adding final is OK 0.003
UselessOverridingMethod::15 adding synchronized is OK 0.001
UselessOverridingMethod::16 Constructors are OK 0.001
UselessOverridingMethod::17 Should ignore clone implementation ( see bug 1522517) 0.001
UselessOverridingMethod::18 clone method with arguments should not be ignored 0.002
UselessOverridingMethod::19 False +: Overriding method merely calls super (see bug 1415525) 0
skipped
UselessOverridingMethod::19 False +: Overriding method merely calls super (see bug 1415525) 0
UselessOverridingMethod::20 [ 1977230 ] false positive: UselessOverridingMethod 0.003
UselessOverridingMethod::21 [ 2142986 ] UselessOverridingMethod doesn't consider annotations, ignoreAnnotations property set to true 0.002
UselessOverridingMethod::22 [ 2142986 ] UselessOverridingMethod doesn't consider annotations 0.002
UselessOverridingMethod::23 [ 2142986 ] UselessOverridingMethod doesn't consider annotations, @Override only 0.002
UselessParentheses::0 failure case, return statement 0.002
UselessParentheses::1 failure case, assignement 0.002
UselessParentheses::2 failure case, condition 1 0.002
UselessParentheses::3 failure case, condition 2 0.002
UselessParentheses::4 useful parentheses, arithmetic 0.002
UselessParentheses::5 useful parentheses, logic 0.002
UselessParentheses::6 typecast, ok 0.002
UselessParentheses::7 typecast with extra, bad 0.002
UselessParentheses::8 false negatives 0.003
UselessParentheses::9 Parentheses around binary expressions are really necessary 0.003
UselessParentheses::10 3526992, false +. In this case the parentheses must stay. 0.002
UselessParentheses::11 #1012 False positive: Useless parentheses. 0.002
UselessParentheses::12 #1111 False positive: Useless parentheses 0.004
UselessParentheses::13 #1102 False positive: shift operator parenthesis 0
UselessParentheses::14 #1243 Useless Parentheses False Positive 0.003
UselessParentheses::15 #1282 False Positive with implicit String.valuesOf() (Java) 0.001
UselessParentheses::16 #1366 UselessParentheses false positive on multiple equality operators 0.002
UselessParentheses::17 #1407 UselessParentheses "&" and "+" operator precedence 0.003

ControversialRulesTest

AssignmentInOperand::0 bad 0.002
AssignmentInOperand::1 ok 0.002
AssignmentInOperand::2 assignment in if conditional expression 0.002
AssignmentInOperand::3 assignment in while conditional expression 0.002
AssignmentInOperand::4 ok 0.002
AssignmentInOperand::5 assignment in for conditional expression 0.003
AssignmentInOperand::6 increment in if conditional expression 0.002
AssignmentInOperand::7 assignment in while conditional expression, allowed 0.002
AssignmentInOperand::8 assignment in if conditional expression, allowed 0.003
AssignmentInOperand::9 assignment in for conditional expression, allowed 0.002
AssignmentInOperand::10 increment in if conditional expression, allowed 0.002
AtLeastOneConstructor::0 ok 0.002
AtLeastOneConstructor::1 simple failure case 0.002
AtLeastOneConstructor::2 inner bad, outer ok 0.003
AtLeastOneConstructor::3 inner ok, outer bad 0.002
AtLeastOneConstructor::4 inner and outer both bad 0.002
AtLeastOneConstructor::5 inner and outer both ok 0.002
AtLeastOneConstructor::6 skip interfaces 0.002
AtLeastOneConstructor::7 skip static classes 0.002
AtLeastOneConstructor::8 skip classes with only static methods 0.005
AtLeastOneConstructor::9 Don't skip classes with non-static methods; #1216 AtLeastOneConstructor ignores classes with *any* methods 0
AvoidFinalLocalVariable::0 Basic, common test case. 0.001
AvoidFinalLocalVariable::1 Other use of final should not raise violations. 0.002
AvoidFinalLocalVariable::2 Bug 2027626, False + : AvoidFinalLocalVariable 0.003
AvoidFinalLocalVariable::3 #1095 AvoidFinalLocalVariable false positive 0.002
AvoidLiteralsInIfCondition::0 basic test 0.004
AvoidLiteralsInIfCondition::1 basic test, part2 0.005
AvoidLiteralsInIfCondition::2 allow null literal 0.003
AvoidLiteralsInIfCondition::3 #1213 AvoidLiteralsInIfCondition -- switch for integer comparison with 0 0.005
AvoidLiteralsInIfCondition::4 #1213 AvoidLiteralsInIfCondition -- switch for integer comparison with 0.0 0.005
AvoidLiteralsInIfCondition::5 XPath error: An empty sequence is not allowed as the second argument of index-of() 0.004
AvoidPrefixingMethodParameters::0 AvoidPrefixingMethodParameters basic test case 0.003
AvoidPrefixingMethodParameters::1 AvoidPrefixingMethodParameters basic test case, no violation 0.003
AvoidPrefixingMethodParameters::2 AvoidPrefixingMethodParameters basic test case, only one parameter is prefixed 0.002
AvoidPrefixingMethodParameters::3 AvoidPrefixingMethodParameters limit: if parameters is named in or out, report a violation. 0.002
AvoidPrefixingMethodParameters::4 AvoidPrefixingMethodParameters basic test case: in is not a prefix, not using camel case in parameter name. 0.001
AvoidUsingNativeCode::0 Basic test case : using native code 0.001
AvoidUsingShortType::0 Short as field 0.002
AvoidUsingShortType::1 Short as local variable 0.003
AvoidUsingShortType::2 Short as method return type 0.002
AvoidUsingShortType::3 Short as method return type 0.002
AvoidUsingShortType::4 #1449 false positive when casting a variable to short 0.004
AvoidUsingVolatile::0 Basic test case 0.002
BooleanInversion::0 failure, unary assignment 0.003
BooleanInversion::1 pass, bitwise assignment 0.002
BooleanInversion::2 pass, not a straight unary inversion 0.002
CallSuperInConstructor::0 TEST1 0.002
CallSuperInConstructor::1 TEST2 0.002
CallSuperInConstructor::2 don't flag classes w/o extends 0.002
CallSuperInConstructor::3 Enum 0.003
DataflowAnomalyAnalysis::0 ok 0.003
DataflowAnomalyAnalysis::1 DD anomaly 0.002
DataflowAnomalyAnalysis::2 DU anomaly 0.002
DataflowAnomalyAnalysis::3 UR anomaly 0.003
DataflowAnomalyAnalysis::4 more komplex anomalysis 0.003
DataflowAnomalyAnalysis::5 #1393 PMD hanging during DataflowAnomalyAnalysis 2.88
DefaultPackage::0 ok 0.002
DefaultPackage::1 bad 0.002
DefaultPackage::2 interface methods are always public 0
DefaultPackage::3 interface field are always public 0.001
DefaultPackage::4 bad 0.002
DefaultPackage::5 #1410 DefaultPackage triggers on field annotated with @VisibleForTesting 0.001
DoNotCallGarbageCollectionExplicitly::0 Basic test case 0.002
DoNotCallGarbageCollectionExplicitly::1 Alernate Basic test case 0.001
DoNotCallGarbageCollectionExplicitly::2 Call in a constructor 0.001
DontImportSun::0 bad, import from sun. 0.002
DontImportSun::1 ok, signal is ok 0.001
NullAssignment::0 initial assignment 0.002
NullAssignment::1 bad assignment 0.004
NullAssignment::2 check test 0.002
NullAssignment::3 null param on right hand sidel 0.002
NullAssignment::4 null assignment in ternary 0.003
NullAssignment::5 null assignment in ternary, part deux 0.002
NullAssignment::6 comparison is not assignment 0.003
NullAssignment::7 final fields must be assigned 0.003
NullAssignment::8 1556594 - Wonky detection of NullAssignment 0.003
OneDeclarationPerLine::0 OneDeclarationPerLine's basic test case 0.005
OneDeclarationPerLine::1 OneDeclarationPerLine's potential false+ 0.003
OneDeclarationPerLine::2 #1221 OneDeclarationPerLine really checks for one declaration each statement 0.004
OneDeclarationPerLine::3 #1221 OneDeclarationPerLine really checks for one declaration each statement 0.003
OnlyOneReturn::0 two returns 0.003
OnlyOneReturn::1 one 0.002
OnlyOneReturn::2 none 0.002
OnlyOneReturn::3 void 0.002
OnlyOneReturn::4 finally 0.003
OnlyOneReturn::5 return inside anonymous inner class 0.004
OnlyOneReturn::6 #1353 False positive "Only One Return" with lambda 0.024
SuspiciousOctalEscape::0 should be flagged 0.003
SuspiciousOctalEscape::1 should be flagged - different octal 0.002
SuspiciousOctalEscape::2 should be flagged - different octal 0.002
SuspiciousOctalEscape::3 [ 2050064 ] False + SuspiciousOctalEscape with backslash literal 0.002
SuspiciousOctalEscape::4 [ 2050064 ] False + SuspiciousOctalEscape with backslash literal, second test case 0.002
UnnecessaryConstructor::0 simple failure case 0.002
UnnecessaryConstructor::1 private constructor 0.002
UnnecessaryConstructor::2 constructor with arguments 0.002
UnnecessaryConstructor::3 constructor with contents 0.002
UnnecessaryConstructor::4 constructor throws exception 0.002
UnnecessaryConstructor::5 two constructors 0.005
UnnecessaryConstructor::6 inner class with unnecessary constructor 0.024
UnnecessaryConstructor::7 inner and outer both have unnecessary constructors 0.002
UnnecessaryConstructor::8 inner and outer, both ok 0.002
UnnecessaryConstructor::9 inner ok, outer bad 0.002
UnnecessaryConstructor::10 inner ok due to nonpublic constructor 0.002
UnnecessaryConstructor::11 constructor calls super 0.002
UnnecessaryConstructor::12 constructor calls super, no args 0.002
UnnecessaryParentheses::0 failure case, returning literal 0.003
UnnecessaryParentheses::1 ok, complex expression 0.006
UnnecessaryParentheses::2 bad, returning variable in parens 0.004
UnnecessaryParentheses::3 ok, returning comparison 0.012
UnnecessaryParentheses::4 typecast 0.002
UseConcurrentHashMap::0 Basic use case 0.004
UseConcurrentHashMap::1 #1034 UseConcurrentHashMap flags calls to methods that return Map 0.002
UseConcurrentHashMap::2 #1342 UseConcurrentHashMap false positive (with documentation example) 0.003
UseObjectForClearerAPI::0 No issues here 0.003
UseObjectForClearerAPI::1 0.001

LoggingJavaRulesTest

AvoidPrintStackTrace::0 simple failure 0
AvoidPrintStackTrace::1 ok 0
GuardLogStatementJavaUtil::0 Guarded call - OK 0
GuardLogStatementJavaUtil::1 Unguarded call - KO 0.002
GuardLogStatementJavaUtil::2 #1203 GuardLogStatementJavaUtil issues warning for severe level not being specified as property 0.002
GuardLogStatementJavaUtil::3 #1227 GuardLogStatementJavaUtil doesn't catch log(Level.FINE, "msg" + " msg") calls 0.002
GuardLogStatementJavaUtil::4 #1335 GuardLogStatementJavaUtil should not apply to SLF4J Logger 0.002
GuardLogStatementJavaUtil::5 #1347 False positive for GuardLogStatementJavaUtil 0.001
GuardLogStatementJavaUtil::6 #1398 False positive for GuardLogStatementJavaUtil with Log4j 0.002
LoggerIsNotStaticFinal::0 ok 0.002
LoggerIsNotStaticFinal::1 two bad loggers 0.001
LoggerIsNotStaticFinal::2 ok with internal class 0.006
LoggerIsNotStaticFinal::3 ok with local var 0.001
MoreThanOneLogger::0 ok 0.002
MoreThanOneLogger::1 two loggers 0.001
MoreThanOneLogger::2 different logger for inner class 0.002
MoreThanOneLogger::3 ok, fixing NPE bug 0.018
MoreThanOneLogger::4 https://github.com/pmd/pmd/pull/42: Add SLF4j Logger type 0
MoreThanOneLogger::5 https://github.com/pmd/pmd/pull/42: Add SLF4j Logger type: Two Loggers 0
SystemPrintln::0 one 0
SystemPrintln::1 many 0
SystemPrintln::2 none 0
SystemPrintln::3 #1217 SystemPrintln always says "System.out.print is used" 0

ASTInitializerTest

testDontCrashOnBlockStatement 0.019

ASTPackageDeclarationTest

testPackageName 0

JavaRuleViolationTest

testMethodName 0.001
testASTFormalParameterVariableName 0

DesignRulesTest

AbstractClassWithoutAbstractMethod::0 concrete class 0.007
AbstractClassWithoutAbstractMethod::1 failure case 0.008
AbstractClassWithoutAbstractMethod::2 failure case, 1 method 0.009
AbstractClassWithoutAbstractMethod::3 abstract class with abstract method 0.009
AbstractClassWithoutAbstractMethod::4 abstract class implements interface 0.008
AbstractClassWithoutAnyMethod::0 Empty abstract method should trigger the rule nonetheless 0.008
AbstractClassWithoutAnyMethod::1 An abstract method without any method at all (Basic test case) 0.009
AbstractClassWithoutAnyMethod::2 An abstract method with constructors 0.009
AbstractClassWithoutAnyMethod::3 An abstract class with method, no violation 0.006
AccessorClassGeneration::0 inner class has private constructor 0.007
AccessorClassGeneration::1 inner class has public constructor 0.013
AccessorClassGeneration::2 outer class has public constructor 0
AccessorClassGeneration::3 final inner class 0.008
AccessorClassGeneration::4 interface inner class has private constructor 0.011
AccessorClassGeneration::5 there's a check for int declaration - not sure right now why 0.009
AccessorClassGeneration::6 #1452 ArrayIndexOutOfBoundsException with Annotations for AccessorClassGenerationRule 0.01
AssignmentToNonFinalStatic::0 clear rule violation 0.017
AssignmentToNonFinalStatic::1 ok 0.012
AvoidConstantsInterface::0 clear rule violation 0.009
AvoidConstantsInterface::1 ok 0.017
AvoidDeeplyNestedIfStmts::0 Bad, very deep 0.014
AvoidDeeplyNestedIfStmts::1 OK, not so deep 0.013
AvoidInstanceofChecksInCatchClause::0 bad, instanceof FooException 0.008
AvoidInstanceofChecksInCatchClause::1 ok, no instanceof 0.008
AvoidProtectedFieldInFinalClass::0 ok, protected field in non final class 0.012
AvoidProtectedFieldInFinalClass::1 bad, protected field in final class 0.01
AvoidProtectedFieldInFinalClass::2 ok, private field in final class 0.011
AvoidProtectedFieldInFinalClass::3 protected field in inner class is ok 0.006
AvoidProtectedMethodInFinalClassNotExtending::0 ok, protected method in non final class 0.017
AvoidProtectedMethodInFinalClassNotExtending::1 bad, protected method in final class that doesn't extend anything 0.012
AvoidProtectedMethodInFinalClassNotExtending::2 bad, protected method in final class that doesn't extend anything but implements interface 0.008
AvoidProtectedMethodInFinalClassNotExtending::3 ok, protected method in final class that does extend something 0.015
AvoidProtectedMethodInFinalClassNotExtending::4 ok, private method in final class 0.025
AvoidProtectedMethodInFinalClassNotExtending::5 protected method in non-final inner class is ok 0
AvoidProtectedMethodInFinalClassNotExtending::6 protected method in final inner class that extends something is ok 0.002
AvoidProtectedMethodInFinalClassNotExtending::7 protected method in final inner class that does not extend something is bad 0.007
AvoidProtectedMethodInFinalClassNotExtending::8 #1241 False+ AvoidProtectedMethodInFinalClassNotExtending 0.009
AvoidReassigningParameters::0 reassigned parameter, bad 0.007
AvoidReassigningParameters::1 one parameter, not reassigned, good 0.011
AvoidReassigningParameters::2 instance variable and parameter have same name 0.01
AvoidReassigningParameters::3 qualified instance variable same name as parameter 0.009
AvoidReassigningParameters::4 qualified name same as parameter 0.009
AvoidReassigningParameters::5 assignment to parameter public field 0.01
AvoidReassigningParameters::6 assignment to array parameter slot 0.013
AvoidReassigningParameters::7 throws a stacktrace 0.011
AvoidReassigningParameters::8 postfix increment in array dereference is bad 0.011
AvoidReassigningParameters::9 assignment to array slot 0.011
AvoidReassigningParameters::10 assignment to array 0.008
AvoidReassigningParameters::11 The rule should also detect parameter reassignement in constructors (at least to help young programmers still learning java basic) 0.01
AvoidReassigningParameters::12 The rule should take into account uses of field names, inherited or not, matching the method parameter name. 0.009
AvoidReassigningParameters::13 parameter name starting with "this" or "super" should still be flagged 0.007
AvoidReassigningParameters::14 local variables should not be flagged 0.009
AvoidReassigningParameters::15 2410201, False+ AvoidReassigningParameters 0.013
AvoidReassigningParameters::16 #1330 AvoidReassigningParameters does not work with varargs 0.007
AvoidSynchronizedAtMethodLevel::0 TEST1 0.01
AvoidSynchronizedAtMethodLevel::1 TEST2 0.007
AvoidSynchronizedAtMethodLevel::2 #991 AvoidSynchronizedAtMethodLevel for static methods - bad case 0.007
AvoidSynchronizedAtMethodLevel::3 #991 AvoidSynchronizedAtMethodLevel for static methods - good case 0.008
BadComparison::0 comparison to Double.NaN 0.008
BadComparison::1 ok equality comparison 0.009
BadComparison::2 comparison to Float.NaN 0.01
ClassWithOnlyPrivateConstructorsShouldBeFinal::0 Simple violation 0.011
ClassWithOnlyPrivateConstructorsShouldBeFinal::1 ok, class is final 0.007
ClassWithOnlyPrivateConstructorsShouldBeFinal::2 One public constructor, not required to be final 0.009
ClassWithOnlyPrivateConstructorsShouldBeFinal::3 Ok, subclass using the private constructor 0.009
ClassWithOnlyPrivateConstructorsShouldBeFinal::4 Ok, subclass using the private constructor of another subclass 0.01
ClassWithOnlyPrivateConstructorsShouldBeFinal::5 Ok, two classes 0.01
ClassWithOnlyPrivateConstructorsShouldBeFinal::6 One protected constructor, not required to be final 0.011
ClassWithOnlyPrivateConstructorsShouldBeFinal::7 One package private constructor, not required to be final 0.008
CloseResource::0 connection is closed, ok 0.01
CloseResource::1 connection not closed, should have failed 0.009
CloseResource::2 ResultSet not closed, should have failed 0.013
CloseResource::3 Statement not closed, should have failed 0.01
CloseResource::4 Bad, no closeTargets properties for statements 0.017
CloseResource::5 Ok, closeTargets properties for statements 0.012
CloseResource::6 Add type param 0.014
CloseResource::7 OK 0.008
CloseResource::8 New use case 0.011
CloseResource::9 [1964798] 3 bugs in CloseResourceRule : Case failing with complete name 0.01
CloseResource::10 [1964798] 3 bugs in CloseResourceRule : null object is passed to close conection method (1) 0.009
CloseResource::11 [1964798] 3 bugs in CloseResourceRule : null object is passed to close conection method (2) 0.011
CloseResource::12 [1964798] 3 bugs in CloseResourceRule : If connection is returned, we should not log a violation. 0.008
CloseResource::13 invoke an external method that close the resource bug 2920057 0.01
CloseResource::14 invoke an external method that closes the resource, but one is not the right method and an another is not the right variable see bug 2920057 0.013
CloseResource::15 #1011 CloseResource Rule ignores Constructors 0.011
CloseResource::16 #1011 CloseResource Rule ignores Constructors - closed in finally 0.011
CloseResource::17 #1011 CloseResource Rule ignores Constructors - not a problem - instance variable 0.01
CloseResource::18 #1029 No instance level check in the close resource rule 0.007
CloseResource::19 #947 CloseResource rule fails if field is marked with annotation 0.009
CloseResource::20 #992 Class java.beans.Statement triggered in CloseResource rule 0.011
CloseResource::21 Custom close method, should be ok 0.009
CloseResource::22 bug #1131 CloseResource should complain if code betwen declaration of resource and try: Code betwen declaration and try, should fail 0.007
CloseResource::23 bug #1131 CloseResource should complain if code betwen declaration of resource and try: Creation inside try, ok 0.013
CloseResource::24 bug #1131 CloseResource should complain if code betwen declaration of resource and try: No sentences between creation and try, ok 0.01
CloseResource::25 #1259 CloseResource rule ignores conditionnals within finally blocks 0.013
CloseResource::26 #1375 CloseResource not detected properly - ok 0.012
CloseResource::27 #1375 CloseResource not detected properly - false negative 0.013
CloseResource::28 #1372 False Negative for CloseResource rule. 0.016
CloseResource::29 #1387 CloseResource has false positive for ResultSet 0.013
CloseResource::30 Verify closeAsDefaultTarget property 0.012
CompareObjectsWithEquals::0 simple failure with method params 0.011
CompareObjectsWithEquals::1 primitives are ok 0.01
CompareObjectsWithEquals::2 skip nulls 0.011
CompareObjectsWithEquals::3 missed hit - qualified names. that's ok, we can't resolve the types yet, so better to skip this for now 0.012
CompareObjectsWithEquals::4 more qualified name skippage 0.011
CompareObjectsWithEquals::5 locals 0.011
CompareObjectsWithEquals::6 2 locals declared on one line 0.015
CompareObjectsWithEquals::7 array element comparison 0.011
CompareObjectsWithEquals::8 Comparing against new object should always return false 0.01
CompareObjectsWithEquals::9 qualified call in allocation 0.011
CompareObjectsWithEquals::10 #1028 False-positive: Compare objects with equals for Enums 0.011
CompareObjectsWithEquals::11 #1128 CompareObjectsWithEquals False Positive comparing boolean (primitive) values 0.012
CompareObjectsWithEquals::12 #1376 CompareObjectsWithEquals fails for type annotated method parameter 0.012
ConfusingTernary::0 !=, bad 0.024
ConfusingTernary::1 ==, good 0.023
ConfusingTernary::2 != inside if, bad 0.028
ConfusingTernary::3 match && match, not confusing, OK 0.016
ConfusingTernary::4 A couple of bad and good cases 0.021
ConfusingTernary::5 #1161 Confusing Ternary should skip else if statements (or have a property to do so) (ignoreElseIf=false) 0.014
ConfusingTernary::6 #1161 Confusing Ternary should skip else if statements (or have a property to do so) (ignoreElseIf=true) 0.011
ConfusingTernary::7 #1198 ConfusingTernary does not ignore else if blocks even when property is set 0.015
ConstructorCallsOverridableMethod::0 calling public method from constructor 0.027
ConstructorCallsOverridableMethod::1 calling protected method from constructor 0.01
ConstructorCallsOverridableMethod::2 calling package private method from constructor 0.011
ConstructorCallsOverridableMethod::3 calling private method, ok 0.011
ConstructorCallsOverridableMethod::4 overloaded constructors, calling public method 0.026
ConstructorCallsOverridableMethod::5 calling method on literal bug 0.012
ConstructorCallsOverridableMethod::6 method in anonymous inner class is ok 0.012
ConstructorCallsOverridableMethod::7 bug report 975407 0.024
ConstructorCallsOverridableMethod::8 ignore abstract methods 0.013
ConstructorCallsOverridableMethod::9 Generics 0.012
ConstructorCallsOverridableMethod::10 985989, base line 0.022
ConstructorCallsOverridableMethod::11 985989, inner static class should be checked as well 0.014
ConstructorCallsOverridableMethod::12 bug #1005 False + for ConstructorCallsOverridableMethod - overloaded methods 0.026
ConstructorCallsOverridableMethod::13 bug #1127 False positive: Constructor Calls Overridable Method 0.016
ConstructorCallsOverridableMethod::14 NullPointer while analyzing ExcessiveLengthRule 0.015
ConstructorCallsOverridableMethod::15 #1388 ConstructorCallsOverridableMethodRule doesn't work with params? 0.01
DefaultLabelNotLastInSwitchStmt::0 ok 0.013
DefaultLabelNotLastInSwitchStmt::1 bad 0.006
DefaultLabelNotLastInSwitchStmt::2 ok, no default 0.005
EmptyMethodInAbstractClassShouldBeAbstract::0 void return method, with no return statement. 0.007
EmptyMethodInAbstractClassShouldBeAbstract::1 non-void return method, with just a, most likely, dummy return statement. 0.008
EmptyMethodInAbstractClassShouldBeAbstract::2 A method with just a return statement, but a meaningful one. 0.008
EmptyMethodInAbstractClassShouldBeAbstract::3 Other valid methods. 0.01
EmptyMethodInAbstractClassShouldBeAbstract::4 nested abstract class 0.011
EmptyMethodInAbstractClassShouldBeAbstract::5 nested class in abstract class 0.01
EmptyMethodInAbstractClassShouldBeAbstract::6 Bug 1888967 : Detection of dummy method 0.014
EmptyMethodInAbstractClassShouldBeAbstract::7 Bug 1888967 : Those methods should not be detected as a violation. 0.011
EmptyMethodInAbstractClassShouldBeAbstract::8 Bug 1888967 : This method should not be detected as a violation. 0.01
EmptyMethodInAbstractClassShouldBeAbstract::9 Bug 1932242 : False +, returning a String does not count as an Empty Method 0.007
EmptyMethodInAbstractClassShouldBeAbstract::10 #1147 EmptyMethodInAbstractClassShouldBeAbstract false positives 0.007
EmptyMethodInAbstractClassShouldBeAbstract::11 Detect empty statements 0.006
EqualsNull::0 object.equals(null), bad 0.006
EqualsNull::1 object == null, ok 0.021
EqualsNull::2 object.method().equals(null), bad 0.007
EqualsNull::3 object.equals(null, other), ok 0.008
EqualsNull::4 #1120 equalsnull false positive 0.008
FieldDeclarationsShouldBeAtStartOfClass::0 basic test 0.007
FieldDeclarationsShouldBeAtStartOfClass::1 basic test, not OK 0.006
FieldDeclarationsShouldBeAtStartOfClass::2 inner class, OK 0.011
FieldDeclarationsShouldBeAtStartOfClass::3 Initial report where rule was introduced, [ 2487971 ] False positive with field-level annotations 0.011
FieldDeclarationsShouldBeAtStartOfClass::4 #1126 False positive with FieldDeclarationsShouldBeAtStartOfClass for static enums 0.017
FieldDeclarationsShouldBeAtStartOfClass::5 #1126 Do not ignore enums 0.012
FieldDeclarationsShouldBeAtStartOfClass::6 #1244 FieldDeclarationsShouldBeAtStartOfClass and anonymous classes, ok 0.015
FieldDeclarationsShouldBeAtStartOfClass::7 #1244 FieldDeclarationsShouldBeAtStartOfClass and anonymous classes, fail 0.008
FieldDeclarationsShouldBeAtStartOfClass::8 #1354 Complex FieldDeclarationsShouldBeAtStartOfClass false positive with Spring annotations 0.006
FieldDeclarationsShouldBeAtStartOfClass::9 #1364 FieldDeclarationsShouldBeAtStartOfClass false positive using multiple annotations 0.008
FinalFieldCouldBeStatic::0 simple failure case 0.006
FinalFieldCouldBeStatic::1 already static, OK 0.007
FinalFieldCouldBeStatic::2 non-final, OK 0.014
FinalFieldCouldBeStatic::3 non-primitive failure case - only works for String 0.01
FinalFieldCouldBeStatic::4 final field that's a thread, OK 0.01
FinalFieldCouldBeStatic::5 don't flag interfaces 0.01
FinalFieldCouldBeStatic::6 bug #1002 False +: FinalFieldCouldBeStatic on inner class 0.011
GodClass::0 Simple god class 0.017
GodClass::1 #1085 NullPointerException by at net.sourceforge.pmd.lang.java.rule.design.GodClassRule.visit(GodClassRule.java:313) 0.009
IdempotentOperations::0 assignment of a variable (local or field) to itself 0.013
IdempotentOperations::1 assignment of one array element to another 0.021
IdempotentOperations::2 qualified names causing NPE troubleshooting 0.007
IdempotentOperations::3 check for method calls 0.011
IdempotentOperations::4 compound assignments are OK 0.011
IdempotentOperations::5 #1104 IdempotentOperation false positive 0.018
ImmutableField::0 could be immutable, only assigned in constructor 0.006
ImmutableField::1 could be immutable, only assigned in decl 0.01
ImmutableField::2 ok, assigned twice 0.009
ImmutableField::3 ok, static field 0.008
ImmutableField::4 ok, one constructor assigns, one doesn't 0.018
ImmutableField::5 ok, assignment via postfix expression 0.01
ImmutableField::6 postfix expressions imply mutability 0.009
ImmutableField::7 compound assignment 0.014
ImmutableField::8 preincrement 0.011
ImmutableField::9 predecrement 0.01
ImmutableField::10 compound assignment 2 0.008
ImmutableField::11 rhs 2 0.006
ImmutableField::12 assignment in constructor is in try block 0.007
ImmutableField::13 assignment in method is in try block 0.01
ImmutableField::14 assignment in constructor in loop is ok 0.009
ImmutableField::15 assignment in anonymous inner class method is OK 0.01
ImmutableField::16 assignment through this 0.008
ImmutableField::17 volatile variables can't be final 0.006
ImmutableField::18 Bug 1740480, optional override of default value based on constructor argument check 0.006
ImmutableField::19 Bug 1740480, assignment in single constructor based on constructor argument check 0.006
ImmutableField::20 3526212, pmd-5.0.0: ImmutableField false positive on self-inc/dec 0.006
ImmutableField::21 #946 ImmutableField false + 0.015
ImmutableField::22 #1032 ImmutableField Rule: Private field in inner class gives false positive 0.005
InstantiationToGetClass::0 simple failure case 0.006
InstantiationToGetClass::1 ok 0.006
InstantiationToGetClass::2 should catch param to constructor 0.007
LogicInversion::0 failure case, inequality 0.006
LogicInversion::1 failure case, comparison 0.018
LogicInversion::2 correct inequality 0
LogicInversion::3 correct comparison 0.003
MissingBreakInSwitch::0 one case, which is not empty 0.009
MissingBreakInSwitch::1 just skip empty switch 0.007
MissingBreakInSwitch::2 one break, but two cases + one default case. But there is an intentional fall through - because there are no statemenets between case 1 and case 2. 0.007
MissingBreakInSwitch::3 each case stmt has a return 0.007
MissingBreakInSwitch::4 all cases have return or throw 0.019
MissingBreakInSwitch::5 3496028: False- 0
MissingBreakInSwitch::6 #1246 False positive from MissingBreakInSwitch 0.007
MissingBreakInSwitch::7 #550 False +: MissingBreakInSwitch 0.01
MissingBreakInSwitch::8 #1262 False positive for MissingBreakInSwitch 0.009
MissingStaticMethodInNonInstantiatableClass::0 ok 0.006
MissingStaticMethodInNonInstantiatableClass::1 ok, default constructor 0.009
MissingStaticMethodInNonInstantiatableClass::2 simple failure 0.01
MissingStaticMethodInNonInstantiatableClass::3 failure with multiple constructors 0.01
MissingStaticMethodInNonInstantiatableClass::4 protected constructor is ok 0.01
MissingStaticMethodInNonInstantiatableClass::5 ok, one static method 0.007
MissingStaticMethodInNonInstantiatableClass::6 nested class 0.008
MissingStaticMethodInNonInstantiatableClass::7 ok, public static field 0.005
MissingStaticMethodInNonInstantiatableClass::8 not ok, non-public static field 0.01
MissingStaticMethodInNonInstantiatableClass::9 ok, protected static field 0.009
MissingStaticMethodInNonInstantiatableClass::10 ok, package private static field 0.007
MissingStaticMethodInNonInstantiatableClass::11 ok, checking for bug 1432595 0.013
MissingStaticMethodInNonInstantiatableClass::12 #1125 Missing Static Method In Non Instantiatable Class / Factory 0.015
NonCaseLabelInSwitchStatement::0 label inside switch 0
NonCaseLabelInSwitchStatement::1 ok 0.011
NonStaticInitializer::0 bad 0.006
NonStaticInitializer::1 static initializers are OK 0.008
NonThreadSafeSingleton::0 failure case 0.008
NonThreadSafeSingleton::1 OK, method is synchronized 0.017
NonThreadSafeSingleton::2 OK, in synchronized block 0
NonThreadSafeSingleton::3 OK, in returning non-static data 0.007
NonThreadSafeSingleton::4 failure case, two if statements 0.007
NonThreadSafeSingleton::5 failure case, compound if statement 0.007
NonThreadSafeSingleton::6 failure case 2 0.007
NonThreadSafeSingleton::7 From defect 1573591 0.007
NonThreadSafeSingleton::8 #997 Rule NonThreadSafeSingleton gives analysis problem 0.009
OptimizableToArrayCall::0 failure case 0.005
OptimizableToArrayCall::1 Array dimensioner uses method call, ok 0.007
OptimizableToArrayCall::2 Array dimensioner uses variable, ok 0.008
OptimizableToArrayCall::3 #937 OptimizableToArrayCall does not catch multilevel method chains 0.005
PositionLiteralsFirstInCaseInsensitiveComparisons::0 ok, literal comes first 0.009
PositionLiteralsFirstInCaseInsensitiveComparisons::1 bad, literal comes last 0.01
PositionLiteralsFirstInCaseInsensitiveComparisons::2 ok 0.006
PositionLiteralsFirstInCaseInsensitiveComparisons::3 Test case from bug [1472195] - PositionLiteralsFirstInComparisons give many false positives 0.006
PositionLiteralsFirstInCaseInsensitiveComparisons::4 Test case from bug [1472195] - PositionLiteralsFirstInComparisons give many false positives 0.007
PositionLiteralsFirstInComparisons::0 ok, literal comes first 0.006
PositionLiteralsFirstInComparisons::1 bad, literal comes last 0.006
PositionLiteralsFirstInComparisons::2 ok 0.007
PositionLiteralsFirstInComparisons::3 Test case from bug [1472195] - PositionLiteralsFirstInComparisons give many false positives 0.006
PositionLiteralsFirstInComparisons::4 Test case from bug [1472195] - PositionLiteralsFirstInComparisons give many false positives 0.012
PositionLiteralsFirstInComparisons::5 #1256 PositionLiteralsFirstInComparisons false positive with Characters 0.003
PreserveStackTrace::0 1, Exception thrown without preserving stack 0.007
PreserveStackTrace::1 2, Exception thrown, stack preserved 0.006
PreserveStackTrace::2 3, Exception thrown, stack preserved 0.006
PreserveStackTrace::3 4, No exception thrown, OK 0.008
PreserveStackTrace::4 5, No exception thrown, OK 0.006
PreserveStackTrace::5 6, No exception thrown, OK 0.015
PreserveStackTrace::6 7, No exception thrown, OK 0.001
PreserveStackTrace::7 8, No exception thrown, OK 0.006
PreserveStackTrace::8 9, Excetion is cast, OK 0.007
PreserveStackTrace::9 10, Throwing new Exception, OK 0.006
PreserveStackTrace::10 11, Throwing new Exception, OK 0.007
PreserveStackTrace::11 12, Catch and throw RuntimeException 0.006
PreserveStackTrace::12 13, Catch and throw RuntimeException, fail 0.007
PreserveStackTrace::13 14, Nested with same name catch and throw, fail on inner 0.009
PreserveStackTrace::14 15, IllegalStateException can take a cause exception in the constructor, too. 0.008
PreserveStackTrace::15 16, False -, No violations reported by PreserveStackTrace Rule 0.007
PreserveStackTrace::16 17, PreserveStackTrace Rule should exclude this as initCause is used. 0.007
PreserveStackTrace::17 18, side effects on rules 0.006
PreserveStackTrace::18 19, False positive 0.007
PreserveStackTrace::19 20, False positive 0.009
PreserveStackTrace::20 21, Java 7's multi-catch, NOK 0.006
PreserveStackTrace::21 22, Java 7's multi-catch, OK 0.007
PreserveStackTrace::22 #943 PreserveStackTrace false positive if a StringBuffer exists 0.007
PreserveStackTrace::23 #1087 PreserveStackTrace (still) ignores initCause() 0.007
PreserveStackTrace::24 #1087 PreserveStackTrace (still) ignores initCause() - negative test case 0.008
PreserveStackTrace::25 #794 False positive on PreserveStackTrace with anonymous inner 0.007
ReturnEmptyArrayRatherThanNull::0 Basic test case 0.007
ReturnEmptyArrayRatherThanNull::1 good behavior should not trigger violation 0.007
SimpleDateFormatNeedsLocale::0 ok, uses a two arg constructor 0.006
SimpleDateFormatNeedsLocale::1 bad, using the single-arg contructor 0.006
SimpleDateFormatNeedsLocale::2 all quiet 0.005
SimplifyBooleanExpressions::0 in field assignment 0.006
SimplifyBooleanExpressions::1 in method body 0.006
SimplifyBooleanExpressions::2 ok 0.006
SimplifyBooleanExpressions::3 two cases in an && expression 0.007
SimplifyBooleanExpressions::4 simple use of BooleanLiteral, should not be flagged 0.006
SimplifyBooleanReturns::0 1, bad 0.01
SimplifyBooleanReturns::1 2, bad 0.006
SimplifyBooleanReturns::2 3, ok 0.006
SimplifyBooleanReturns::3 4, ok 0.007
SimplifyBooleanReturns::4 #1320 Enhance SimplifyBooleanReturns checks 0.007
SimplifyBooleanReturns::5 #1320 Enhance SimplifyBooleanReturns checks - case 2 without block 0.007
SimplifyConditional::0 failure case 0.009
SimplifyConditional::1 ok 0.006
SimplifyConditional::2 transpose x and null, still bad 0.007
SimplifyConditional::3 conditional or and !(instanceof) 0.01
SimplifyConditional::4 indexing into array is ok 0.01
SimplifyConditional::5 test for null on unrelated object is ok 0.013
SimplifyConditional::6 Bug [1843273] False - 0.011
SimplifyConditional::7 Bug 2317099 : False + in SimplifyConditional 0.007
SimplifyConditional::8 #1165 SimplifyConditional false positive 0.006
SingularField::0 failure case 0.006
SingularField::1 Ok, used for control flow 0.006
SingularField::2 ok 0.025
SingularField::3 second method uses 'this' 0
SingularField::4 skip publics 0.01
SingularField::5 skip statics 0.01
SingularField::6 unused fields shouldn't show up 0.01
SingularField::7 inner class 0.011
SingularField::8 initialized in constructor 0.01
SingularField::9 ok case with Object 0.01
SingularField::10 ok, shouldn't catch unused variable 0.01
SingularField::11 ok case with self-instantiation 0.01
SingularField::12 Reuse variable name as params in method calls 0.017
SingularField::13 Ok, instantiates own self internally 0.003
SingularField::14 ok, variable accessed twice in same method 0.01
SingularField::15 failure, static 0.008
SingularField::16 failure, second method re-uses class level name 0.01
SingularField::17 initialized in static initialization block 0.02
SingularField::18 1409944, fields used to synchronize should not trigger 0
SingularField::19 1409944, fields not used to synchronize should trigger 0.01
SingularField::20 1409944, field is used to change the flow of different calls 0.009
SingularField::21 Ok, used in outer class 0.01
SingularField::22 Not ok, since inner classes are checked 0.013
SingularField::23 Not ok, violation with first usage = non-assignment 0.007
SingularField::24 Ok, field used to aggregate values 0.009
SingularField::25 Ok, setting values 0.009
SingularField::26 multiple fields on same line 0.01
SingularField::27 field in inner class 0.026
SingularField::28 bug 3574133 - false + with enums 0
SingularField::29 #1307 False positive: SingularField and lambda-expression 0.006
SwitchDensity::0 Five stmts in one switch case, should be flagged 0.01
SwitchDensity::1 One stmt in one switch case, ok 0.01
SwitchDensity::2 Five stmts, 5 cases, OK 0.024
SwitchStmtsShouldHaveDefault::0 simple failure case 0
SwitchStmtsShouldHaveDefault::1 simple ok case 0.005
TooFewBranchesForASwitchStatement::0 Only one case, this is useless 0.01
TooFewBranchesForASwitchStatement::1 Even two branches is not enough for a switch statement 0.012
TooFewBranchesForASwitchStatement::2 Three branches in a switch statement is ok. 0.024
UncommentedEmptyConstructor::0 simple failure 0
UncommentedEmptyConstructor::1 only 'this(...)' is OK 0.005
UncommentedEmptyConstructor::2 only 'this(...)' is not OK, if ignoring explicit constructor calls 0.01
UncommentedEmptyConstructor::3 only 'super(...)' is OK 0.009
UncommentedEmptyConstructor::4 single-line comment is OK 0.025
UncommentedEmptyConstructor::5 multiple-line comment is OK 0
UncommentedEmptyConstructor::6 Javadoc comment is OK 0.003
UncommentedEmptyConstructor::7 ok 0.01
UncommentedEmptyConstructor::8 with 'this(...)' ok 0.009
UncommentedEmptyConstructor::9 with 'super(...)' ok 0.016
UncommentedEmptyConstructor::10 private is ok 0.009
UncommentedEmptyConstructor::11 Empty constructor with documenting javadoc still triggers 0.01
UncommentedEmptyMethodBody::0 simple failure 0.009
UncommentedEmptyMethodBody::1 single-line comment is OK 0.009
UncommentedEmptyMethodBody::2 multiple-line comment is OK 0.009
UncommentedEmptyMethodBody::3 Javadoc comment is OK 0.009
UncommentedEmptyMethodBody::4 ok 0.01
UnnecessaryLocalBeforeReturn::0 skip void/native/abstract methods 0.009
UnnecessaryLocalBeforeReturn::1 skip literal returns 0.009
UnnecessaryLocalBeforeReturn::2 simple failure case 0.006
UnnecessaryLocalBeforeReturn::3 skip complicated returns 0.007
UnnecessaryLocalBeforeReturn::4 skip method calls 0.007
UnsynchronizedStaticDateFormatter::0 Format called from non-synchronized block 0.006
UnsynchronizedStaticDateFormatter::1 2, No call to format 0.007
UnsynchronizedStaticDateFormatter::2 3, Inside synchronized, OK 0.006
UnsynchronizedStaticDateFormatter::3 4, Inside synchronized, OK 0.007
UnsynchronizedStaticDateFormatter::4 5, Use DateFormat, ok 0.005
UnsynchronizedStaticDateFormatter::5 6, Use DateFormat, fail 0.006
UnsynchronizedStaticDateFormatter::6 #940 False positive on UnsynchronizedStaticDateFormatter 0.017
UseCollectionIsEmpty::0 fail, == 0 0
UseCollectionIsEmpty::1 ok, isEmpty 0.004
UseCollectionIsEmpty::2 fail, != 0 0.006
UseCollectionIsEmpty::3 ok, !isEmpty 0.006
UseCollectionIsEmpty::4 fail, != 0 0.007
UseCollectionIsEmpty::5 ok, !isEmpty 0.006
UseCollectionIsEmpty::6 fail, 0 == 0.005
UseCollectionIsEmpty::7 fail, > 0 0.013
UseCollectionIsEmpty::8 ok, in expression 0.002
UseCollectionIsEmpty::9 ok, in expression 0.008
UseCollectionIsEmpty::10 #1214 UseCollectionIsEmpty misses some usage 0.006
UseCollectionIsEmpty::11 #1230 UseCollectionIsEmpty gets false positives 0.007
UseCollectionIsEmpty::12 #1304 UseCollectionIsEmpty false positive comparing to 1 0.006
UseCollectionIsEmpty::13 #1345 UseCollectionIsEmpty throws NullPointerException 0.006
UseLocaleWithCaseConversions::0 toLowerCase() with no args 0.006
UseLocaleWithCaseConversions::1 toUpperCase() with no args 0.006
UseLocaleWithCaseConversions::2 both ok 0.006
UseLocaleWithCaseConversions::3 toHexString OK 0.006
UseLocaleWithCaseConversions::4 Compound method call 0.006
UseNotifyAllInsteadOfNotify::0 TEST1 0.006
UseNotifyAllInsteadOfNotify::1 TEST2 0.007
UseNotifyAllInsteadOfNotify::2 TEST3 0.005
UseNotifyAllInsteadOfNotify::3 TEST4 0.01
UseNotifyAllInsteadOfNotify::4 TEST5 0.006
UseNotifyAllInsteadOfNotify::5 notify() with params is OK 0.006
UseNotifyAllInsteadOfNotify::6 #1438 UseNotifyAllInsteadOfNotify gives false positive 0.007
UseUtilityClass::0 should be utility class since all static, public constructor 0.006
UseUtilityClass::1 ok, uses non-static 0.007
UseUtilityClass::2 should be utility class, couple of statics, no constructor 0.005
UseUtilityClass::3 public constructor, no static - ok 0.006
UseUtilityClass::4 classic utility class - ok 0.008
UseUtilityClass::5 abstract, so ok 0.005
UseUtilityClass::6 has some private and no public static fields, so ok 0.007
UseUtilityClass::7 has public static field, so need to check 0.006
UseUtilityClass::8 junit 'suite' method is OK 0.007
UseUtilityClass::9 Reproducing bug [ 2315599 ] False +: UseSingleton with class containing constructor: Although there is a static method, the class also has a non-private constructor. This is a common design for custom exceptions which contain a private static method to format error message strings. 0.008
UseUtilityClass::10 inner should be utility class since all static, public constructor 0.006
UseUtilityClass::11 [ 2404700 ] UseSingleton should not act on enums 0.022
UseUtilityClass::12 NPE in incorrect implementation... 0
UseUtilityClass::13 OK, method annotations 0.006
UseUtilityClass::14 #1255 UseUtilityClass false positive with Exceptions 0.007
UseUtilityClass::15 #1467 UseUtilityClass can't correctly check functions with multiple annotations 0.008
UseVarargs::0 constructor, use varargs 0.006
UseVarargs::1 method, use varargs 0.007
UseVarargs::2 constructor, do not varargs 0.01
UseVarargs::3 method, do not varargs 0.009
UseVarargs::4 method, do not varargs as the signature is dictated by an interface // TODO Once this is implemented, perhaps it should be optional? The compiler will technically let you use varargs. 0
skipped
UseVarargs::4 method, do not varargs as the signature is dictated by an interface // TODO Once this is implemented, perhaps it should be optional? The compiler will technically let you use varargs. 0
UseVarargs::5 method, do not varargs, allow byte[] as not varargs 0.011
UseVarargs::6 method, do not varargs, allow Byte[] as not varargs 0.008
UseVarargs::7 method, do not varargs, allow @Override 0.011
UseVarargs::8 method, do not varargs, allow public static void main(String[]) as not varargs 0.012
UseVarargs::9 method, use varargs, deviation from exact main signature flagged 0

SimpleNodeTest

testLineNumbersAreSetOnAllSiblings 0.004
testHasExplicitExtends 0.001
testFindDescendantsOfType 0
testLineNumbersForNameSplitOverTwoLines 0.001
testColumnsOnQualifiedName 0
testXPathNodeSelect 0.001
testGetFirstChildNestedDeeper 0
testParentMethods 0.002
testContainsChildOfType 0.001
testFindDescendantsOfTypeRecurse 0
testUserData 0
testNoExplicitExtends 0
testContainsNoInnerWithAnonInner 0.001
testGetFirstChildNested 0
testMethodSameLine 0
testMethodDiffLines 0.001
testGetFirstChild 0
testHasExplicitImplements 0
testNoLookahead 0
testFindDescendantsOfTypeMultiple 0
testNoExplicitImplements 0

SunSecureRulesTest

ArrayIsStoredDirectly::0 Clear violation 0.001
ArrayIsStoredDirectly::1 Clear violation with this. 0.001
ArrayIsStoredDirectly::2 assignment to an internal array 0.001
ArrayIsStoredDirectly::3 assignment of param to local 0.002
ArrayIsStoredDirectly::4 skip interfaces 0.001
ArrayIsStoredDirectly::5 skip abstract, native 0.001
ArrayIsStoredDirectly::6 equality expression, not assignment 0.001
ArrayIsStoredDirectly::7 assignment of array element 0.001
ArrayIsStoredDirectly::8 Constructor clear violation 0.001
ArrayIsStoredDirectly::9 Constructor no violation 0.002
ArrayIsStoredDirectly::10 No reassignment 0.001
ArrayIsStoredDirectly::11 #1063 False+: ArrayIsStoredDirectly 0.001
ArrayIsStoredDirectly::12 #1476 False positive of ArrayIsStoredDirectly 0.003
MethodReturnsInternalArray::0 Clear violation 0.001
MethodReturnsInternalArray::1 Clear violation with this. 0.001
MethodReturnsInternalArray::2 ok 0
MethodReturnsInternalArray::3 tricky field hiding 0
MethodReturnsInternalArray::4 really sick code 0
MethodReturnsInternalArray::5 returning a local array is ok 0.001
MethodReturnsInternalArray::6 returning a local array is ok part deux 0.001
MethodReturnsInternalArray::7 returning a cloned field 0.007
MethodReturnsInternalArray::8 returning a new array 0
MethodReturnsInternalArray::9 Doesn't return array 0
MethodReturnsInternalArray::10 Interface with array declaration 0
MethodReturnsInternalArray::11 #962 MethodReturnsInternalArray: False positive using a ternary operator 0
MethodReturnsInternalArray::12 #1299 MethodReturnsInternalArray false positive 0.002
MethodReturnsInternalArray::13 #1324 MethodReturnsInternalArray false positive with clone() 0.001
MethodReturnsInternalArray::14 #1322 MethodReturnsInternalArray on private methods 0.001
MethodReturnsInternalArray::15 #1475 False positive of MethodReturnsInternalArray 0.001
MethodReturnsInternalArray::16 #1475 False positive of MethodReturnsInternalArray - ArrayAllocation 0.001

ReportTest

testBasic 0
testExclusionsInReportWithAnnotationsFullName 0
testExclusionsInReportWithNOPMD 0
testExclusionsInReportWithRuleViolationSuppressRegex 0.003
testExclusionsInReportWithRuleViolationSuppressXPath 0.045
testExclusionsInReportWithAnnotations 0

ASTSwitchLabelTest

testDefaultOff 0.001
testDefaultSet 0

LanguageVersionDiscovererTest

testLanguageVersionDiscoverer 0
testJavaFileUsingDefaults 0
testJavaFileUsing14 0

EncodingTest

testDecodingOfUTF8 0

UnusedCodeRulesTest

UnusedFormalParameter::0 failure case 0
UnusedFormalParameter::1 method called on param 0.001
UnusedFormalParameter::2 assignment to param 0.001
UnusedFormalParameter::3 interface 0.001
UnusedFormalParameter::4 don't flag public methods by default 0.002
UnusedFormalParameter::5 flag public methods if checkall property is set 0.001
UnusedFormalParameter::6 skip native/abstract methods 0.001
UnusedFormalParameter::7 anonymous inner class npe 0
UnusedFormalParameter::8 unused constructor param 0.002
UnusedFormalParameter::9 assigned but not used 0.001
UnusedFormalParameter::10 array element is set 0.001
UnusedFormalParameter::11 unused array in constructor 0.001
UnusedFormalParameter::12 unused array in method 0
UnusedFormalParameter::13 False - ! if "checkAll" property is not set 0.005
UnusedFormalParameter::14 violation suppression regex works 0
UnusedFormalParameter::15 violation suppression xpath works, by name 0
UnusedFormalParameter::16 violation suppression xpath works, by type 0
UnusedFormalParameter::17 #878 don't flag abstract methods even if checkall property is set when checking an abstract class 0.001
UnusedFormalParameter::18 #1159 false positive UnusedFormalParameter readObject(ObjectInputStream) if not used 0.001
UnusedFormalParameter::19 #1159 correct UnusedFormalParameter for readObject(foo) if not used 0.01
UnusedFormalParameter::20 #1456 UnusedFormalParameter should ignore overriding methods 0
UnusedLocalVariable::0 unused local with assignment 0
UnusedLocalVariable::1 unused local w/o assignment 0
UnusedLocalVariable::2 unused local in constructor 0
UnusedLocalVariable::3 local used on rhs 0
UnusedLocalVariable::4 unused local in static initializer 0.001
UnusedLocalVariable::5 unused field 0.003
UnusedLocalVariable::6 loop indexes are not unused locals 0.001
UnusedLocalVariable::7 local used in anonymous inner class 0.001
UnusedLocalVariable::8 two unused locals of same name, one in nested class 0.001
UnusedLocalVariable::9 two locals declared on same line 0.001
UnusedLocalVariable::10 an assignment does not a usage make 0.001
UnusedLocalVariable::11 a compound assignment operator doth a usage make 0
UnusedLocalVariable::12 assignment to a member field means used 0.002
UnusedLocalVariable::13 make sure scopes are working 0
UnusedLocalVariable::14 another scope test 0.002
UnusedLocalVariable::15 assignment to an array member will be treated as a usage 0.001
UnusedLocalVariable::16 local variable used in postfix expression as child of StatementExpression 0.001
UnusedLocalVariable::17 local variable used in postfix expression on right hand side 0.001
UnusedLocalVariable::18 local variable, object ref, public field of which is incremented via in postfix expression 0.001
UnusedLocalVariable::19 local used in right shift 0.003
UnusedLocalVariable::20 unused local with assignment - Suppressed 0
UnusedLocalVariable::21 Reproducing bug #1955852: false positives for UnusedPrivateMethod & UnusedLocalField 0.002
UnusedLocalVariable::22 #1247 Not able to recognize JDK 8 Static Method References 0.001
UnusedModifier::0 Unneeded 'public' in interface method 0.001
UnusedModifier::1 class, no problem 0.001
UnusedModifier::2 Unneeded 'abstract' in interface method 0.002
UnusedModifier::3 all is well in interface method 0.001
UnusedModifier::4 Unneeded 'public' in interface field 0.001
UnusedModifier::5 Unneeded 'static' in interface field 0.001
UnusedModifier::6 Unneeded 'final' in interface field 0.001
UnusedModifier::7 Unneeded 'public static final' in interface field 0.001
UnusedModifier::8 OK in interface field 0.002
UnusedModifier::9 Unneeded 'public' in class nested in interface 0.001
UnusedModifier::10 Unneeded 'static' in class nested in interface 0
UnusedModifier::11 OK in class nested in interface 0.002
UnusedModifier::12 Unneeded 'public' in interface nested in interface 0.001
UnusedModifier::13 Unneeded 'static' in interface nested in interface 0.001
UnusedModifier::14 OK in interface nested in interface 0.002
UnusedModifier::15 Unneeded 'static' in interface nested in class 0.001
UnusedModifier::16 OK in interface nested in class 0.001
UnusedModifier::17 Unneeded 'public static final' in interface field inside another interface 0.002
UnusedModifier::18 OK in interface field inside another interface 0.001
UnusedModifier::19 Don't check methods in nested classes 0.001
UnusedModifier::20 Don't check fields in nested classes 0.001
UnusedModifier::21 Don't check fields that are anonymous inner classes 0.003
UnusedModifier::22 False negative: #1185 UnusedModifier throws NPE when parsing enum with a nested static interface 0.001
UnusedModifier::23 #1275 False positive: UnusedModifier rule for static inner class in enum 0.001
UnusedPrivateField::0 simple unused private field 0.001
UnusedPrivateField::1 private field referenced in another field's initializer 0.001
UnusedPrivateField::2 private field with field of same name in anonymous inner class 0.001
UnusedPrivateField::3 field is used semantically before it's declared syntactically 0.001
UnusedPrivateField::4 private field referenced via 'this' modifier 0.001
UnusedPrivateField::5 private referenced by anonymous inner class 0.001
UnusedPrivateField::6 interface sanity test 0.001
UnusedPrivateField::7 unused private field in static inner class 0.001
UnusedPrivateField::8 private field referenced in nonstatic inner class 0.001
UnusedPrivateField::9 unused private static field 0.001
UnusedPrivateField::10 private static final referenced with qualifier 0
UnusedPrivateField::11 unused private field after class decl 0.001
UnusedPrivateField::12 two unused private fields in separate inner classes 0.002
UnusedPrivateField::13 method param shadows unused private field 0.003
UnusedPrivateField::14 private field referenced via 'this' not shadowed by param of same name 0
UnusedPrivateField::15 don't catch public fields 0
UnusedPrivateField::16 instantiate self and reference private field on other object 0.002
UnusedPrivateField::17 don't count Serialization fields as being unused 0.001
UnusedPrivateField::18 an assignment does not a usage make 0.001
UnusedPrivateField::19 assignment to field member is a usage 0
UnusedPrivateField::20 assignment to field member using this modifier is a usage 0.001
UnusedPrivateField::21 this.foo++ shouldn't throw an NPE, but isn't a usage 0.001
UnusedPrivateField::22 super.foo++ shouldn't throw an NPE 0.001
UnusedPrivateField::23 SuppressWarnings("unused") unused private field 0.001
UnusedPrivateField::24 631681, private field is accessed by outer class 0.001
UnusedPrivateField::25 631681, private field in singleton is accessed by outer class 0.001
UnusedPrivateField::26 #1188 False positive in UnusedPrivateField 0.001
UnusedPrivateField::27 private field in inner class accessed as method call 0.002
UnusedPrivateField::28 private field in inner class accessed by another inner class 0.002
UnusedPrivateField::29 #1302 False Positive: UnusedPrivateField when accessed by inner class 0.001
UnusedPrivateField::30 #1428 False positive in UnusedPrivateField when local variable hides member variable 0.001
UnusedPrivateMethod::0 private method called by public method 0.001
UnusedPrivateMethod::1 simple unused private method 0.001
UnusedPrivateMethod::2 anonymous inner class calls private method 0.001
UnusedPrivateMethod::3 two private methods with same name but different parameters 0.001
UnusedPrivateMethod::4 calling private method after instantiating new copy of myself 0.001
UnusedPrivateMethod::5 calling private method using 'this' modifier 0.001
UnusedPrivateMethod::6 simple unused private static method 0.001
UnusedPrivateMethod::7 readResolve/writeReplace/etc are OK 0.001
UnusedPrivateMethod::8 Private methods called only by themselves, BUG 1038229 0
UnusedPrivateMethod::9 private with same name as public, different method signature 0.002
UnusedPrivateMethod::10 False +, BUG 1114754 0
UnusedPrivateMethod::11 called from constructor 0.003
UnusedPrivateMethod::12 private method with same name but diff arg count than public method 0.001
UnusedPrivateMethod::13 static private called from initializer 0.001
UnusedPrivateMethod::14 static private invoked in static context - i.e., Foo.hi() 0.001
UnusedPrivateMethod::15 private method with same name as param 0.001
UnusedPrivateMethod::16 two methods, one private, one public, same name, same arg count, diff types 0.001
UnusedPrivateMethod::17 two private methods, both used, same name, same arg count, diff types 0.002
UnusedPrivateMethod::18 private method same name as local 0.001
UnusedPrivateMethod::19 SuppressWarnings("unused") - simple unused private method 0.001
UnusedPrivateMethod::20 Calling method on instance of self 0.001
UnusedPrivateMethod::21 #46 False +: Unused private field: call to instance of self, received from another class 0
skipped
UnusedPrivateMethod::21 #46 False +: Unused private field: call to instance of self, received from another class 0
UnusedPrivateMethod::22 Calling one arg varargs method 0.001
UnusedPrivateMethod::23 Calling two arg varargs method 0.001
UnusedPrivateMethod::24 Reproducing bug #1955852: false positives for UnusedPrivateMethod & UnusedLocalField 0.002
UnusedPrivateMethod::25 verify #1156 False failure with "Avoid unused private methods" 0.003
UnusedPrivateMethod::26 #1223 UnusedPrivateMethod: Java 8 method reference causing false positives 0.001
UnusedPrivateMethod::27 #1226 False Positive: UnusedPrivateMethod overloading with varargs 0.001
UnusedPrivateMethod::28 #1228 UnusedPrivateMethod returns false positives (1) 0.003
UnusedPrivateMethod::29 #1228 UnusedPrivateMethod returns false positives (2) 0.003
UnusedPrivateMethod::30 #1228 UnusedPrivateMethod returns false positives (3) 0.003
UnusedPrivateMethod::31 #1228 UnusedPrivateMethod returns false positives (4) 0.008
UnusedPrivateMethod::32 #1228 UnusedPrivateMethod returns false positives (5a) 0.002
UnusedPrivateMethod::33 #1228 UnusedPrivateMethod returns false positives (5b) 0.003
UnusedPrivateMethod::34 #1233 UnusedPrivateMethod: False positive : method called on returned object. 0.001
UnusedPrivateMethod::35 #1228 UnusedPrivateMethod returns false positives (6) 0.019
UnusedPrivateMethod::36 #1228 UnusedPrivateMethod returns false positives (7) 0.019
UnusedPrivateMethod::37 #1234 Unused private methods still giving false positives in 5.1.3 snapshot 0.002
UnusedPrivateMethod::38 #1156 False failure with "Avoid unused private methods" (part 2) 0.001
UnusedPrivateMethod::39 #1251 UnusedPrivateMethod false positives for boxing & unboxing arguments 0.003
UnusedPrivateMethod::40 #1249 Regression: UnusedPrivateMethod from 5.0.5 to 5.1.2 0.004
UnusedPrivateMethod::41 #1261 False positive "Avoid unused private methods" with Generics 0.002
UnusedPrivateMethod::42 #1261 False positive "Avoid unused private methods" with Generics 2 0.002
UnusedPrivateMethod::43 #1261 False positive "Avoid unused private methods" with Generics 3 0.003
UnusedPrivateMethod::44 #1261 False positive "Avoid unused private methods" with Generics 4 0.003
UnusedPrivateMethod::45 #1276 False positive in UnusedPrivateMethod when method arg is Object and not called with plain Object 0.002
UnusedPrivateMethod::46 #1281 UnusedPrivateMethod incorrectly flagged for methods nested private classes 0.004
UnusedPrivateMethod::47 #1287 UnusedPrivateMethod returns false positives for Superclass 0.002
UnusedPrivateMethod::48 #1286 UnusedPrivateMethod returns false positives for varags 0.002
UnusedPrivateMethod::49 #1294 False positive UnusedPrivateMethod with public inner enum from another class 0.002
UnusedPrivateMethod::50 #1296 PMD UnusedPrivateMethod invalid detection of 'private void method(int,boolean,Integer...)' 0.003
UnusedPrivateMethod::51 #1332 False Positive: UnusedPrivateMethod 0.002
UnusedPrivateMethod::52 #1395 UnusedPrivateMethod false positive for array element method call 0.002
UnusedPrivateMethod::53 #1403 False positive UnusedPrivateMethod with JAVA8 0.005
UnusedPrivateMethod::54 #1405 UnusedPrivateMethod false positive? 0.003

ASTLocalVariableDeclarationTest

testMultDimArraySplitBraces 0.004
testSingleDimArray 0
testMultDimArray 0.001

MethodNameDeclarationTest

testEquality 0

ExcludeLinesTest

testAcceptance 0.124
testAlternateMarker 0.003

ASTAnnotationTest

testAnnotationFailsWithJDK14 0.001
testAnnotationSucceedsWithJDK15 0.045
testAnnotationSucceedsWithDefaultMode 0

ASTPrimarySuffixTest

testArrayDereference 0
testArguments 0.001

XPathCLITest

runXPath 0.022

MethodScopeTest

testGenerics 0
testMethodName 0
testMethodParameterOccurrenceRecorded 0

RegexpAcceptanceTest

testSimple 0.003

CloneMethodMustImplementCloneableTest

CloneMethodMustImplementCloneable::0 ok, implements Cloneable 0.001
CloneMethodMustImplementCloneable::1 bad, doesn't implement Cloneable 0.001
CloneMethodMustImplementCloneable::2 ok, not Object.clone since method has a param 0
CloneMethodMustImplementCloneable::3 ok, doesn't implement Cloneable but only throw CloneNotSupportedException 0
CloneMethodMustImplementCloneable::4 ok, inner class implements Cloneable 0.002
CloneMethodMustImplementCloneable::5 ok, implements interface in same package which extends Cloneable 0
CloneMethodMustImplementCloneable::6 ok, implements interface imported implicitly which extends Cloneable 0.001
CloneMethodMustImplementCloneable::7 ok, implements interface which extends Cloneable 0
CloneMethodMustImplementCloneable::8 ok, extends superclass AND implements cloneable 0.003
CloneMethodMustImplementCloneable::9 Bug 1698550, nr 1 0
CloneMethodMustImplementCloneable::10 Bug 1698550, nr 2 0
CloneMethodMustImplementCloneable::11 Bug 1765613, NullPointerException on enum 0.001

ASTBooleanLiteralTest

testFalse 0
testTrue 0.001

CouplingRulesTest

CouplingBetweenObjects::0 lots of coupling 0.002
CouplingBetweenObjects::1 no coupling 0.001
CouplingBetweenObjects::2 skip interfaces 0
ExcessiveImports::0 bad 0.001
ExcessiveImports::1 ok 0.001
LawOfDemeter::0 Simple method 0.001
LawOfDemeter::1 Mixed local and foreign method calls 0.004
LawOfDemeter::2 Simple Method calls without chaining 0.003
LawOfDemeter::3 Simple Method calls with chaining 0.001
LawOfDemeter::4 Simple Method calls with local created object 0.001
LawOfDemeter::5 Simple Method calls with local created object and variables 0.002
LawOfDemeter::6 Simple Method call on local created object within nesting local scopes 0.001
LawOfDemeter::7 Example documentation 0.013
LawOfDemeter::8 Static methods 0
LawOfDemeter::9 Exclude iterator and list elements 0.006
LawOfDemeter::10 #999 false positives 0
LawOfDemeter::11 #999 false negatives 0
LawOfDemeter::12 #1245 False Positive for Law of Demeter 0
LooseCoupling::0 returning a HashSet, bad 0
LooseCoupling::1 returning a Map, OK 0
LooseCoupling::2 no problemo 0
LooseCoupling::3 returning a set 0.001
LooseCoupling::4 field declared of type HashSet 0.001
LooseCoupling::5 field, return type both HashSet 0.002
LooseCoupling::6 two fields 0.002
LooseCoupling::7 method param is HashMap 0.002
LooseCoupling::8 Vector could be List 0.002
LooseCoupling::9 ArrayList could be List 0.002
LooseCoupling::10 #938 False positive on LooseCoupling for overriding methods 0.001
LoosePackageCoupling::0 default package: nothing configured, ok 0.004
LoosePackageCoupling::1 default package: unused package, ok 0.004
LoosePackageCoupling::2 default package: single package w/ exception, ok 0.003
LoosePackageCoupling::3 default package: single package w/o exception, bad 0.003
LoosePackageCoupling::4 default package: nested package w/o exception, bad 0.002
LoosePackageCoupling::5 default package: nested package w/ exception, bad 0.002
LoosePackageCoupling::6 some package: nothing configured, ok 0.001
LoosePackageCoupling::7 some package: unused package, ok 0.002
LoosePackageCoupling::8 some package: single package w/ exception, ok 0.003
LoosePackageCoupling::9 some package: single package w/o exception, bad 0.002
LoosePackageCoupling::10 some package: nested package w/o exception, but in same package, ok 0.005
LoosePackageCoupling::11 some package: nested package and sub-package, with different exceptions, bad 0.003
LoosePackageCoupling::12 bug fix: annotation before package 0.001

GlobalScopeTest

testEnums 0
testClassDeclAppears 0

ApplierTest

testSimple 0

MethodDeclTest

testAbstract 0
testFinal 0.001
testPrivate 0
testSynchronized 0
testProtected 0
testNative 0
testPublic 0
testStrict 0

VariableUsageFinderFunctionTest

testLookingForUsed 0

LoggingJakartaCommonsRulesTest

GuardDebugLogging::0 ok, no error expected 0
GuardDebugLogging::1 Complex logging without guard 0.002
GuardDebugLogging::2 Complex logging wit misplaced guard 0.001
GuardDebugLogging::3 ok #1189 GuardLogStatementRule and GuardDebugLoggingRule broken for log4j2 0.003
GuardDebugLogging::4 violation - wrong guard #1189 GuardLogStatementRule and GuardDebugLoggingRule broken for log4j2 0.003
GuardDebugLogging::5 violation - no if #1189 GuardLogStatementRule and GuardDebugLoggingRule broken for log4j2 0.002
GuardDebugLogging::6 #1224 GuardDebugLogging broken in 5.1.1 - missing additive statement check in log statement 0.003
GuardDebugLogging::7 #1341 pmd:GuardDebugLogging violates LOGGER.debug with format "{}" 0.001
GuardLogStatement::0 OK, guard is here 0.003
GuardLogStatement::1 KO, missing guard 1 0.002
GuardLogStatement::2 KO, missing guard 2 0.002
GuardLogStatement::3 ok #1189 GuardLogStatementRule and GuardDebugLoggingRule broken for log4j2 0.003
GuardLogStatement::4 violation - wrong guard #1189 GuardLogStatementRule and GuardDebugLoggingRule broken for log4j2 0.003
ProperLogger::0 Ok 0.002
ProperLogger::1 Wrong class name 0.001
ProperLogger::2 Ok, special case 0.001
ProperLogger::3 bug 1626232, a seperate variable initialization should not confuse the rule 0.002
ProperLogger::4 bug 1626232, extra loggers with different names are not allowed by default (use NOPMD if you want them) 0.001
UseCorrectExceptionLogging::0 ok 0.017
UseCorrectExceptionLogging::1 failure case - two calls 0
UseCorrectExceptionLogging::2 must be in a catch block 0
UseCorrectExceptionLogging::3 bug 1626232, the rule should not be confused by inner classes 0
UseCorrectExceptionLogging::4 bug 1626232, should work with a static block 0

ASTLiteralTest

testIsStringLiteral 0.001
testIsFloatFloatLiteral 0
testIsNotStringLiteral 0
testIsCharLiteral 0.001
testIsIntIntLiteral 0
testStringUnicodeEscapesInvalid 0.002
testIsIntLongLiteral 0
testStringUnicodeEscapesNotEscaped 0
testCharacterUnicodeEscapesValid 0
testIsFloatDoubleLiteral 0
testStringUnicodeEscapesValid 0

MigratingRulesTest

AvoidAssertAsIdentifier::0 assert as identifier 0.003
AvoidEnumAsIdentifier::0 variable and param named enum 0.001
ByteInstantiation::0 new Byte(), bad 0.001
ByteInstantiation::1 Byte.valueOf(), ok 0.001
IntegerInstantiation::0 new Integer(), bad 0.001
IntegerInstantiation::1 Integer.valueOf(), ok 0.004
JUnit4SuitesShouldUseSuiteAnnotation::0 Contains suite 0.001
JUnit4SuitesShouldUseSuiteAnnotation::1 Contains JUnit4TestAdapter suite 0.002
JUnit4SuitesShouldUseSuiteAnnotation::2 Uses propper suite 0.001
JUnit4TestShouldUseAfterAnnotation::0 Contains tearDown 0.002
JUnit4TestShouldUseAfterAnnotation::1 Contains @tearDown 0.002
JUnit4TestShouldUseAfterAnnotation::2 Renamed tearDown 0.002
JUnit4TestShouldUseAfterAnnotation::3 #1446 False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used 0.001
JUnit4TestShouldUseBeforeAnnotation::0 Contains setUp 0.002
JUnit4TestShouldUseBeforeAnnotation::1 Contains @setUp 0.001
JUnit4TestShouldUseBeforeAnnotation::2 Renamed setup 0.002
JUnit4TestShouldUseBeforeAnnotation::3 #1400 False positive with JUnit4TestShouldUseBeforeAnnotation 0.001
JUnit4TestShouldUseBeforeAnnotation::4 #1446 False positive with JUnit4TestShouldUseBeforeAnnotation when TestNG is used 0.002
JUnit4TestShouldUseTestAnnotation::0 Contains test, no @Test 0.003
JUnit4TestShouldUseTestAnnotation::1 OK 0.001
JUnit4TestShouldUseTestAnnotation::2 OK, renamed test 0.002
JUnit4TestShouldUseTestAnnotation::3 One test propper, the other incorrect 0.001
JUnit4TestShouldUseTestAnnotation::4 Two tests 0.001
JUnit4TestShouldUseTestAnnotation::5 #1197 JUnit4TestShouldUseTestAnnotation for private method 0.001
JUnitUseExpected::0 JUnit 4 - Contains assert 0.003
JUnitUseExpected::1 Junit 3 format 0.003
JUnitUseExpected::2 Junit 3 format 0.003
JUnitUseExpected::3 Throws 0.003
JUnitUseExpected::4 This method can be broken into two, each checking 0.003
JUnitUseExpected::5 Not a JUnit class - Contains assert 0.002
LongInstantiation::0 new Long(), bad 0.005
LongInstantiation::1 Long.valueOf(), ok 0.002
ReplaceEnumerationWithIterator::0 bad, implementing Enumeration 0.001
ReplaceHashtableWithMap::0 bad, local variable of type Hashtable 0.002
ReplaceHashtableWithMap::1 bad, param of type Hashtable 0.017
ReplaceVectorWithList::0 bad, local variable of type Vector 0
ReplaceVectorWithList::1 bad, param of type Vector 0
ShortInstantiation::0 new Short(), bad 0
ShortInstantiation::1 Short.valueOf(), ok 0

BasicRulesTest

AvoidBranchingStatementAsLastInLoop::0 ok: no violations 0.028
AvoidBranchingStatementAsLastInLoop::1 violations: break:for/do/while, continue:for/do/while and return:for/do/while 0.015
AvoidBranchingStatementAsLastInLoop::2 violations: break:for/do/while 0.019
AvoidBranchingStatementAsLastInLoop::3 violations: continue:for/do/while 0.022
AvoidBranchingStatementAsLastInLoop::4 violations: return:for/do/while 0.015
AvoidBranchingStatementAsLastInLoop::5 violations: break:for 0.018
AvoidBranchingStatementAsLastInLoop::6 violations: break:do 0.02
AvoidBranchingStatementAsLastInLoop::7 violations: break:while 0.021
AvoidBranchingStatementAsLastInLoop::8 violations: continue:for 0.023
AvoidBranchingStatementAsLastInLoop::9 violations: continue:do 0.022
AvoidBranchingStatementAsLastInLoop::10 violations: continue:while 0.028
AvoidBranchingStatementAsLastInLoop::11 violations: return:for 0.011
AvoidBranchingStatementAsLastInLoop::12 violations: return:do 0.021
AvoidBranchingStatementAsLastInLoop::13 violations: return:while 0.02
AvoidBranchingStatementAsLastInLoop::14 #1170 false positive with switch in loop 0.02
AvoidDecimalLiteralsInBigDecimalConstructor::0 bad, new BigDecimal(.1) 0.027
AvoidDecimalLiteralsInBigDecimalConstructor::1 ok, new BigDecimal(".1") 0.007
AvoidDecimalLiteralsInBigDecimalConstructor::2 ok, new BigDecimal(10) 0.017
AvoidDecimalLiteralsInBigDecimalConstructor::3 bad, same as #1 but outside an initializer context 0.008
AvoidDecimalLiteralsInBigDecimalConstructor::4 #1187 double variable with AvoidDecimalLiteralsInBigDecimalConstructor 0.018
AvoidMultipleUnaryOperators::0 Simple duplicate typos 0.005
AvoidMultipleUnaryOperators::1 Compound 0.017
AvoidMultipleUnaryOperators::2 Compound with parentheses 0.01
AvoidMultipleUnaryOperators::3 Compound with parentheses an mixed operators 0.017
AvoidMultipleUnaryOperators::4 Multiple levels of nested parentheses 0.003
AvoidThreadGroup::0 bad, using new ThreadGroup() 0.011
AvoidThreadGroup::1 bad, using fully qualified java.lang.ThreadGroup() 0.015
AvoidThreadGroup::2 bad, using Thread.getThreadGroup() 0.014
AvoidThreadGroup::3 bad, using System.getSecurityManager().getThreadGroup() 0.009
AvoidThreadGroup::4 ThreadGroup() but not java.lang.ThreadGroup 0.011
AvoidThreadGroup::5 MyThreadGroup() not java.lang.ThreadGroup 0.011
AvoidThreadGroup::6 false positive, bug #1018 0.024
AvoidUsingHardCodedIP::0 Comprehensive, check for IPv4 mapped IPv6 xxx 0.004
AvoidUsingHardCodedIP::1 Common basic case 0.011
AvoidUsingHardCodedIP::2 Not detected via string concatenation. 0.011
AvoidUsingHardCodedIP::3 Null literal does not puke. 0.024
AvoidUsingHardCodedIP::4 Non String literal does not puke. 0.002
AvoidUsingHardCodedIP::5 Not an ip address string 0.013
AvoidUsingHardCodedIP::6 Comprehensive, check IPv4, IPv6, and IPv4 mapped IPv6 0.016
AvoidUsingHardCodedIP::7 Comprehensive, check for nothing 0.018
AvoidUsingHardCodedIP::8 Comprehensive, check for IPv4 0.017
AvoidUsingHardCodedIP::9 Comprehensive, check for IPv6 0.014
AvoidUsingHardCodedIP::10 Comprehensive, check for IPv4 mapped IPv6 0.018
AvoidUsingHardCodedIP::11 Comprehensive, check for IPv6 and IPv4 mapped IPv6 0.018
AvoidUsingOctalValues::0 bad, 012 0.014
AvoidUsingOctalValues::1 OK, hex value 0.03
AvoidUsingOctalValues::2 OK, long value 0.013
AvoidUsingOctalValues::3 OK, double value 0.014
AvoidUsingOctalValues::4 OK, double value 0.023
AvoidUsingOctalValues::5 bad, 012L 0.013
AvoidUsingOctalValues::6 OK, 06 if strict is not set 0.013
AvoidUsingOctalValues::7 BAD, 06 if strict is set 0.01
BigIntegerInstantiation::0 Fail, BigInteger(1) 0.01
BigIntegerInstantiation::1 Pass, BigInteger(10) 0.01
BigIntegerInstantiation::2 Fail, BigInteger(0) 0.012
BigIntegerInstantiation::3 Pass, BigDecimal(i - 1) 0.013
BigIntegerInstantiation::4 Pass, BigInteger("10") and BigDecimal in 1.4 mode 0.009
BigIntegerInstantiation::5 Fail, BigInteger(10) 1.5 mode 0.008
BigIntegerInstantiation::6 Fail, BigDecimal(1) 0.011
BigIntegerInstantiation::7 Fail, BigDecimal(10) 0.008
BigIntegerInstantiation::8 Fail, BigDecimal(0) 0.011
BooleanInstantiation::0 simple failure case 0.011
BooleanInstantiation::1 new java.lang.Boolean 0.011
BooleanInstantiation::2 ok 0.01
BooleanInstantiation::3 don't use Boolean.valueOf() with literal 0.011
BooleanInstantiation::4 valueOf() with variable is fine 0.007
BooleanInstantiation::5 don't use Boolean.valueOf() with string literal 0.01
BooleanInstantiation::6 don't use Boolean.valueOf() in method call 0.008
BooleanInstantiation::7 don't use new Boolean() in method call 0.013
BooleanInstantiation::8 ok 0.012
BooleanInstantiation::9 ok 0.012
BooleanInstantiation::10 don't use new Boolean() in static block 0.009
BooleanInstantiation::11 Bug 1744065, should be ok 0.01
BooleanInstantiation::12 Test for failure after rule with custom Boolean, should report failure if rule reset done correctly 0.011
BrokenNullCheck::0 should be && 0.011
BrokenNullCheck::1 Ok, is && 0.012
BrokenNullCheck::2 should be &&, but now with a longer expression 0.009
BrokenNullCheck::3 should be || 0.007
BrokenNullCheck::4 Ok, is || 0.007
BrokenNullCheck::5 Arrays are Ok 0.011
BrokenNullCheck::6 Different method is Ok 0.012
BrokenNullCheck::7 Using a shorter expression with the same variable in the second check should not crash the test 0.01
BrokenNullCheck::8 1633683, should be ||, but now with another compare 0.011
BrokenNullCheck::9 1633683, Arrays are Ok II 0.013
BrokenNullCheck::10 Different literals in variables should not match 0.011
BrokenNullCheck::11 Assigments in checks are OK 0.012
BrokenNullCheck::12 Similar method calls with different arguments are OK 0.007
CheckResultSet::0 The result set is appropriately tested before using it, no violation. 0.008
CheckResultSet::1 This most common violation case, not testing is done before a call to 'last()'. 0.01
CheckResultSet::2 This most common violation case, not testing is done before a call to 'first()'. 0.013
CheckResultSet::3 Using a 'while' instead of 'if' shouldn't result in a violation. 0.01
CheckResultSet::4 #942 CheckResultSet False Positive 0.014
CheckResultSet::5 #1135 CheckResultSet ignores results set declared outside of try/catch (good case) 0.014
CheckResultSet::6 #1135 CheckResultSet ignores results set declared outside of try/catch 0.013
CheckResultSet::7 #1135 CheckResultSet ignores results set declared outside of try/catch - prevent false positive 0.011
CheckResultSet::8 #1199 PMD CheckResultSet gives false positive in a do/while loop 0.013
CheckResultSet::9 #1273 CheckResultSet false positive in try-with-resources nested in if 0.009
CheckResultSet::10 #1263 PMD reports CheckResultSet violation in completely unrelated source files. 0.008
CheckSkipResult::0 failure case 0.008
CheckSkipResult::1 failure case but obfuscated 0.01
CheckSkipResult::2 return value is assigned to a variable 0.011
CheckSkipResult::3 return value is used in a function 0.011
CheckSkipResult::4 return value is returned 0.011
ClassCastExceptionWithToArray::0 bad, toArray() with cast 0.011
ClassCastExceptionWithToArray::1 ok, no cast 0.01
ClassCastExceptionWithToArray::2 Ensuring we don't have a few specific false positives, see bug 1697397 0.007
ClassCastExceptionWithToArray::3 #975 false positive in ClassCastExceptionWithToArray 0.009
ClassCastExceptionWithToArray::4 #998 False positive ClassCastExceptionWithToArray with generics 0.007
CollapsibleIfStatements::0 failure case 0.011
CollapsibleIfStatements::1 ok, intervening statements 0.009
CollapsibleIfStatements::2 ok, different intervening statements 0.009
DontCallThreadRun::0 basic use case - calls to run() 0.007
DontCallThreadRun::1 basic use case - call to Thread().run() 0.008
DontUseFloatTypeForLoopIndices::0 basic test case 0.012
DontUseFloatTypeForLoopIndices::1 Should be all OK 0.011
DoubleCheckedLocking::0 simple ok 0.011
DoubleCheckedLocking::1 simple failure 0.008
DoubleCheckedLocking::2 skip interfaces 0.008
DoubleCheckedLocking::3 Generics 0.009
DoubleCheckedLocking::4 inversed null check see bug 2835074 False -: DoubleCheckedLocking with reversed null check (1) 0.01
DoubleCheckedLocking::5 inversed null check see bug 2835074 False -: DoubleCheckedLocking with reversed null check (2) 0.01
DoubleCheckedLocking::6 Use of volatile keyword see #884 False +: DoubleCheckedLocking warning with volatile field 0.011
DoubleCheckedLocking::7 #1471 False positives for DoubleCheckedLocking 0.011
ExtendsObject::0 failure case 0.007
ExtendsObject::1 extends nothing 0.01
ExtendsObject::2 extends not Object 0.014
ForLoopShouldBeWhileLoop::0 simple failure case 0.003
ForLoopShouldBeWhileLoop::1 ok 0.006
ForLoopShouldBeWhileLoop::2 for loop like this: for (;;) {} 0.007
ForLoopShouldBeWhileLoop::3 JDK 1.5 for loop 0.011
JumbledIncrementer::0 1 0.008
JumbledIncrementer::1 2 0.009
JumbledIncrementer::2 3 0.01
JumbledIncrementer::3 using outer loop incrementor as array index is OK 0.01
MisplacedNullCheck::0 null check after method invocation with conditional AND and != 0.011
MisplacedNullCheck::1 null check after nested method invocation 0.01
MisplacedNullCheck::2 null check before nested method invocation 0.012
MisplacedNullCheck::3 1610730: null check after method invocation with conditional OR and == 0.01
MisplacedNullCheck::4 3372128: False positive: ArrayIsStoredDirectly 0.011
MisplacedNullCheck::5 #977 MisplacedNullCheck makes false positives 0.007
OverrideBothEqualsAndHashcode::0 hash code only 0.007
OverrideBothEqualsAndHashcode::1 equals only 0.017
OverrideBothEqualsAndHashcode::2 overrides both 0.008
OverrideBothEqualsAndHashcode::3 overrides neither 0.006
OverrideBothEqualsAndHashcode::4 equals sig uses String, not Object 0.01
OverrideBothEqualsAndHashcode::5 interface 0.01
OverrideBothEqualsAndHashcode::6 java.lang.Object 0.011
OverrideBothEqualsAndHashcode::7 skip Comparable implementations 0.01
OverrideBothEqualsAndHashcode::8 implements equals but with 2 args 0.01
OverrideBothEqualsAndHashcode::9 overloaded hashCode 0.011
OverrideBothEqualsAndHashcode::10 overloaded both 0.01
OverrideBothEqualsAndHashcode::11 overloaded hashCode, should fail on equals 0.014
OverrideBothEqualsAndHashcode::12 implements hashCode but with args 0.009
OverrideBothEqualsAndHashcode::13 implements interface other than Comparable, not resolvable 0.014
OverrideBothEqualsAndHashcode::14 implements interface other than Comparable, resolvable (#1303 OverrideBothEqualsAndHashcodeRule does not work on class implements resolvable interfaces) 0.015
ReturnFromFinallyBlock::0 throw exception but return from finally 0.011
ReturnFromFinallyBlock::1 lots of returns 0.01
ReturnFromFinallyBlock::2 ok 0.007

ASTAssignmentOperatorTest

testSimpleAssignmentRecognized 0.002
testCompoundAssignmentPlusRecognized 0
testCompoundAssignmentMultRecognized 0

AndroidRulesTest

CallSuperFirst::0 Success 0.004
CallSuperFirst::1 Success 0.003
CallSuperFirst::2 Failure 0.003
CallSuperFirst::3 #1154 Call super onPause when there is no super 0.002
CallSuperLast::0 Success 0.002
CallSuperLast::1 Failure 0.002
CallSuperLast::2 #1154 Call super onPause when there is no super 0.001
DoNotHardCodeSDCard::0 basic /sdcard test 0.009

NamingRulesTest

AbstractNaming::0 ok, abstract class AbstractFoo 0
AbstractNaming::1 bad, abstract class named Foo 0
AbstractNaming::2 ok, concrete class named AbstractFoo 0
AbstractNaming::3 ok, concrete class named Foo 0.002
AvoidDollarSigns::0 class Fo$o 0.002
AvoidDollarSigns::1 variable fo$oo 0.002
AvoidDollarSigns::2 method foo$oo 0.001
AvoidDollarSigns::3 interface fo$oo 0.002
AvoidDollarSigns::4 ok 0.002
AvoidFieldNameMatchingMethodName::0 TEST1 0.002
AvoidFieldNameMatchingMethodName::1 TEST2 0.002
AvoidFieldNameMatchingMethodName::2 TEST3 0.002
AvoidFieldNameMatchingMethodName::3 TEST4 0.003
AvoidFieldNameMatchingMethodName::4 Just skip interfaces 0.001
AvoidFieldNameMatchingTypeName::0 TEST1 0.002
AvoidFieldNameMatchingTypeName::1 TEST2 0.002
AvoidFieldNameMatchingTypeName::2 TEST3 0.002
AvoidFieldNameMatchingTypeName::3 TEST4 0.002
AvoidFieldNameMatchingTypeName::4 interface 0.003
BooleanGetMethodName::0 Bad name 0.001
BooleanGetMethodName::1 Good name 0.002
BooleanGetMethodName::2 Should not match on multiple parameters by default 0.001
BooleanGetMethodName::3 Should match on multiple parameters when checkParameterizedMethods = true 0.002
ClassNamingConventions::0 class names should not start with lowercase character 0.002
ClassNamingConventions::1 all is well 0.001
GenericsNaming::0 1 upper case/single letter 0.003
GenericsNaming::1 2 upper case/single letter 0.002
GenericsNaming::2 1 lower Case/single letter 0.001
GenericsNaming::3 1 lower case/multiple letter 0.002
LongVariable::0 param 0.002
LongVariable::1 ok 0.002
LongVariable::2 local 0.002
LongVariable::3 for 0.002
LongVariable::4 17 character max 0.001
LongVariable::5 threshold test 0.001
MethodNamingConventions::0 method names should start with lowercase character 0.001
MethodNamingConventions::1 method names should not contain underscores 0.001
MethodNamingConventions::2 all is well 0.001
MethodNamingConventions::3 #1288 MethodNamingConventions for native should be deactivated 0.002
MethodNamingConventions::4 #1288 MethodNamingConventions for native should be deactivated - prevent false negative 0.001
MethodNamingConventions::5 #1343 MethodNamingConventions for overrided methods 0.002
MethodWithSameNameAsEnclosingClass::0 bad 0.002
MethodWithSameNameAsEnclosingClass::1 ok 0.001
MethodWithSameNameAsEnclosingClass::2 doesn't crash on interfaces 0.001
MisleadingVariableName::0 misnamed param 0.002
MisleadingVariableName::1 misnamed local 0.001
MisleadingVariableName::2 all's well 0.001
NoPackage::0 bad 0.001
NoPackage::1 good 0.002
NoPackage::2 nested package 0.001
PackageCase::0 bad 0.001
PackageCase::1 good 0.003
ShortClassName::0 ShortClassName basic test case 0.001
ShortClassName::1 ShortClassName basic test case 2 : More code and other declarations 0.001
ShortClassName::2 ShortClassName works with private classes. 0.001
ShortClassName::3 #1143 ShortClassName fires with a 5-letter class name 0.001
ShortClassName::4 #1232 Make ShortClassName configurable (default = 5) 0.001
ShortClassName::5 #1232 Make ShortClassName configurable (minimum length = 2) 0.002
ShortClassName::6 #1232 Make ShortClassName configurable (minimum length = 4) 0.001
ShortMethodName::0 ok 0.001
ShortMethodName::1 bad 0.001
ShortMethodName::2 2 violations 0.001
ShortMethodName::3 2 methods, 1 violation 0.001
ShortVariable::0 param 0.001
ShortVariable::1 none 0.002
ShortVariable::2 local 0.002
ShortVariable::3 for 0.003
ShortVariable::4 field 0
ShortVariable::5 catch(Exception e) is OK 0.002
ShortVariable::6 ShortVariable false positive with for-each loops 0.002
ShortVariable::7 ShortVariable within for-each loops 0.002
SuspiciousConstantFieldName::0 ok 0.002
SuspiciousConstantFieldName::1 PI not final 0.001
SuspiciousConstantFieldName::2 PI and E not final 0.002
SuspiciousConstantFieldName::3 ok 0.002
SuspiciousConstantFieldName::4 ignore interfaces 0.002
SuspiciousEqualsMethodName::0 bad, equals(Foo foo) 0.002
SuspiciousEqualsMethodName::1 ok, equals(Object foo) 0.002
SuspiciousEqualsMethodName::2 bad, equal(Object foo) 0.002
SuspiciousEqualsMethodName::3 #1431 SuspiciousEqualsMethodName false positive 0.003
SuspiciousHashcodeMethodName::0 ok 0.003
SuspiciousHashcodeMethodName::1 hashcode 0
SuspiciousHashcodeMethodName::2 HashCode 0.009
SuspiciousHashcodeMethodName::3 Hashcode 0
VariableNamingConventions::0 member level, final statics should be all caps 0
VariableNamingConventions::1 member level, non-finals shouldn't have underscores 0
VariableNamingConventions::2 local level, non-finals shouldn't have underscores 0
VariableNamingConventions::3 method level, non-finals shouldn't have underscores 0.001
VariableNamingConventions::4 constructor level, non-finals shouldn't have underscores 0.001
VariableNamingConventions::5 member level, variables names should start with lowercase character 0.002
VariableNamingConventions::6 local level, variables names should start with lowercase character 0.002
VariableNamingConventions::7 method level, variables names should start with lowercase character 0.001
VariableNamingConventions::8 constructor level, variables names should start with lowercase character 0.002
VariableNamingConventions::9 all is well 0.002
VariableNamingConventions::10 local finals are ok 0.002
VariableNamingConventions::11 serialVersionUID is OK 0.002
VariableNamingConventions::12 interface fields are tested 0.001
VariableNamingConventions::13 final non-statics need not be all caps 0.002
VariableNamingConventions::14 variables in inner classes should not trigger problems in parent declaration 0.001
VariableNamingConventions::15 Rule property control 0.002
VariableNamingConventions::16 Check prefixes 0.001
VariableNamingConventions::17 Check suffixes 0.001
VariableNamingConventions::18 Check members disabled 0.002
VariableNamingConventions::19 Check locals disabled 0.001
VariableNamingConventions::20 Check parameters disabled 0.002
VariableNamingConventions::21 False - with non primitive fields (Bug 2225474) 0.002
VariableNamingConventions::22 #1058 False positive for VariableNamingConventions 0.002
VariableNamingConventions::23 #1293 Disable VariableNamingConventions for native methods 0.002
VariableNamingConventions::24 #1293 Disable VariableNamingConventions for native methods - prevent false negative 0.001
VariableNamingConventions::25 #1346 VariableNamingConventions do not work for method parameters 0.002
VariableNamingConventions::26 #1349 VariableNamingConventions : underscore in final but at first position ? 0.001
VariableNamingConventions::27 #1399 False positive for VariableNamingConventions with annotation @interface 0.001

PMDTaskTest

testExplicitRuleInRuleSet 0.34
testAbstractNames 0.296
testAbstractNamesInNestedRuleset 0.149
testRelativeRulesetsInRulesetfiles 0.103
testNoFormattersValidation 0.081
testCommaInRulesetfiles 0.118
testClasspath 0.025
testRelativeRulesets 0.073
testNestedRuleset 0.081
testFormatterWithProperties 0.087

ScopeAndDeclarationFinderTest

testJava8LambdaScoping 0

JunitRulesTest

JUnitAssertionsShouldIncludeMessage::0 assertArrayEquals ok 0.009
JUnitAssertionsShouldIncludeMessage::1 assertArrayEquals bad 0
JUnitAssertionsShouldIncludeMessage::2 assertEquals ok 0
JUnitAssertionsShouldIncludeMessage::3 assertEquals with string variable as message ok 0
JUnitAssertionsShouldIncludeMessage::4 assertEquals with delta ok 0.004
JUnitAssertionsShouldIncludeMessage::5 assertEquals bad 0
JUnitAssertionsShouldIncludeMessage::6 assertEquals with delta bad 0.002
JUnitAssertionsShouldIncludeMessage::7 assertEquals with delta but missing assertion message not ok 0.001
JUnitAssertionsShouldIncludeMessage::8 assertFalse ok 0.001
JUnitAssertionsShouldIncludeMessage::9 assertFalse bad 0.001
JUnitAssertionsShouldIncludeMessage::10 assertNotNull OK 0.002
JUnitAssertionsShouldIncludeMessage::11 assertNotNull bad 0.002
JUnitAssertionsShouldIncludeMessage::12 assertNotSame ok 0.001
JUnitAssertionsShouldIncludeMessage::13 assertNotSame bad 0.002
JUnitAssertionsShouldIncludeMessage::14 assertNull OK 0.002
JUnitAssertionsShouldIncludeMessage::15 assertNull bad 0.001
JUnitAssertionsShouldIncludeMessage::16 assertSame OK 0.02
JUnitAssertionsShouldIncludeMessage::17 assertSame bad 0
JUnitAssertionsShouldIncludeMessage::18 assertThat ok 0
JUnitAssertionsShouldIncludeMessage::19 assertThat bad 0
JUnitAssertionsShouldIncludeMessage::20 assertTrue ok 0
JUnitAssertionsShouldIncludeMessage::21 assertTrue bad 0
JUnitAssertionsShouldIncludeMessage::22 fail ok 0
JUnitAssertionsShouldIncludeMessage::23 fail bad 0
JUnitAssertionsShouldIncludeMessage::24 find that pesky bug 0
JUnitAssertionsShouldIncludeMessage::25 Not a JUnit test - assertEquals bad 0
JUnitAssertionsShouldIncludeMessage::26 JUnit 4 - assertEquals 0
JUnitAssertionsShouldIncludeMessage::27 #1374 JUnitAssertionsShouldIncludeMessage does not work 0.003
JUnitAssertionsShouldIncludeMessage::28 #1373 JUnitAssertionsShouldIncludeMessage is no longer compatible with TestNG 0.004
JUnitSpelling::0 setUp mispellings 0.001
JUnitSpelling::1 tearDown mispellings 0.001
JUnitSpelling::2 ok 0.001
JUnitSpelling::3 unrelated methods 0.002
JUnitSpelling::4 overloaded setUp 0.001
JUnitSpelling::5 No problem - not a JUnit test 0.002
JUnitStaticSuite::0 nonstatic is bad 0.001
JUnitStaticSuite::1 public static with no params is OK 0.007
JUnitStaticSuite::2 private suite() is bad 0
JUnitStaticSuite::3 if there are params, just skip it 0.002
JUnitStaticSuite::4 Not a JUnit test (nonstatic is bad) 0.001
JUnitTestContainsTooManyAsserts::0 JUnit 3 Test contains no assert 0.002
JUnitTestContainsTooManyAsserts::1 JUnit 4 Test contains no assert 0.001
JUnitTestContainsTooManyAsserts::2 JUnit 3 Test contains one assert 0.001
JUnitTestContainsTooManyAsserts::3 JUnit 4 Test contains one assert 0.018
JUnitTestContainsTooManyAsserts::4 JUnit 3 Test contains more than one assert 0
JUnitTestContainsTooManyAsserts::5 JUnit 4 Test contains more than one assert 0
JUnitTestContainsTooManyAsserts::6 JUnit 3 Test contains more than one assert, but allowed 0
JUnitTestContainsTooManyAsserts::7 JUnit 4 Test contains more than one assert, but allowed 0
JUnitTestsShouldIncludeAssert::0 Contains assert 0
JUnitTestsShouldIncludeAssert::1 Missing assert 0
JUnitTestsShouldIncludeAssert::2 All ok 0
JUnitTestsShouldIncludeAssert::3 Two wrong 0
JUnitTestsShouldIncludeAssert::4 Contains fail 0
JUnitTestsShouldIncludeAssert::5 One wrong 0.001
JUnitTestsShouldIncludeAssert::6 Skip interfaces 0.002
JUnitTestsShouldIncludeAssert::7 Skip abstract methods 0.001
JUnitTestsShouldIncludeAssert::8 Another fail() case 0.003
JUnitTestsShouldIncludeAssert::9 BUG 1105633 - False +: JUnit testcases could have fail() instead of assert 0.002
JUnitTestsShouldIncludeAssert::10 BUG 1146116 PMDException with inner interfaces 0.003
JUnitTestsShouldIncludeAssert::11 skip static test methods 0.006
JUnitTestsShouldIncludeAssert::12 exceptions shouldn't block it 0
JUnitTestsShouldIncludeAssert::13 Not a JUnit test (exceptions shouldn't block it) 0
JUnitTestsShouldIncludeAssert::14 JUnit 4 test (exceptions shouldn't block it) 0.001
JUnitTestsShouldIncludeAssert::15 Junit 4 static import 0.002
JUnitTestsShouldIncludeAssert::16 Junit 4 test using Assert.assert... 0.002
JUnitTestsShouldIncludeAssert::17 #968 Issues with JUnit4 @Test annotation with expected exception 0.002
SimplifyBooleanAssertion::0 assertFalse(!) 0.001
SimplifyBooleanAssertion::1 assertTrue(!) 0.001
SimplifyBooleanAssertion::2 ok 0.002
SimplifyBooleanAssertion::3 not a JUnit test - assertFalse(!) 0.001
SimplifyBooleanAssertion::4 JUnit 4 - assertFalse(!) 0.001
TestClassWithoutTestCases::0 failure case 0.017
TestClassWithoutTestCases::1 test method should be public 0
TestClassWithoutTestCases::2 inner class should get checked 0
TestClassWithoutTestCases::3 test method in inner class not valid 0
TestClassWithoutTestCases::4 abstract classes are ok 0
TestClassWithoutTestCases::5 ditto interfaces 0.001
TestClassWithoutTestCases::6 ditto enum 0
TestClassWithoutTestCases::7 ditto annotation 0
TestClassWithoutTestCases::8 failure case does not extend TestCase 0
TestClassWithoutTestCases::9 #1453 False positive when the test class extends an other. 0
UnnecessaryBooleanAssertion::0 failure case 0
UnnecessaryBooleanAssertion::1 variations 0.001
UnnecessaryBooleanAssertion::2 nested boolean literal 0.002
UnnecessaryBooleanAssertion::3 asserting true a ! 0.002
UnnecessaryBooleanAssertion::4 asserting false a ! 0.001
UnnecessaryBooleanAssertion::5 buz 0.002
UnnecessaryBooleanAssertion::6 not a JUnit test - failure case 0.001
UnnecessaryBooleanAssertion::7 JUnit 4 - failure case 0.002
UseAssertEqualsInsteadOfAssertTrue::0 TEST1 0.002
UseAssertEqualsInsteadOfAssertTrue::1 TEST2 0.001
UseAssertEqualsInsteadOfAssertTrue::2 TEST3 0.002
UseAssertEqualsInsteadOfAssertTrue::3 Not a JUnit test - TEST2 0.001
UseAssertEqualsInsteadOfAssertTrue::4 JUnit4 - TEST2 0.002
UseAssertNullInsteadOfAssertTrue::0 assertTrue with null 0.002
UseAssertNullInsteadOfAssertTrue::1 assertFalse with != null 0.001
UseAssertNullInsteadOfAssertTrue::2 assertTrue with x == y 0.002
UseAssertNullInsteadOfAssertTrue::3 Not a JUnit test - assertTrue with null 0.001
UseAssertNullInsteadOfAssertTrue::4 JUnit 4 - assertTrue with null 0.002
UseAssertSameInsteadOfAssertTrue::0 assert true a == b 0.001
UseAssertSameInsteadOfAssertTrue::1 assert true a != b 0.002
UseAssertSameInsteadOfAssertTrue::2 assert false a == b 0.001
UseAssertSameInsteadOfAssertTrue::3 assert false a != b 0.002
UseAssertSameInsteadOfAssertTrue::4 skip assertTrue(x == null), UseAssertNullInsteadOfAssertTrue will pick those up 0.017
UseAssertSameInsteadOfAssertTrue::5 bug 1626715, the null check in the rule shouldn't match the null outside the assert method 0
UseAssertSameInsteadOfAssertTrue::6 assert true a == b BUT not a Junit test 0
UseAssertSameInsteadOfAssertTrue::7 JUnit 4 - assert true a == b 0
UseAssertTrueInsteadOfAssertEquals::0 JUnit Test contains assertEquals on other than boolean literal 0
UseAssertTrueInsteadOfAssertEquals::1 JUnit Test contains assertEquals on boolean literal 0
UseAssertTrueInsteadOfAssertEquals::2 #1323 False positive case of UseAssertTrueInsteadOfAssertEquals 0

AccessNodeTest

testAbstract 0
testPackagePrivate 0
testFinal 0
testVolatile 0
testPrivate 0
testSynchronized 0.006
testProtected 0
testModifiersOnClassDecl 0.001
testNative 0
testPublic 0
testTransient 0
testStatic 0
testStrict 0.001

VariableNameDeclarationTest

testPrimitiveType 0
testPrimitiveTypeImage 0
testExceptionBlkParam 0
testRefTypeImage 0
testParamTypeImage 0
testArrayIsReferenceType 0
testIsArray 0
testConstructor 0

CLITest

changeJavaVersion 0.114
exitStatusNoViolations 0.061
minimalArgs 0.065
testWrongRulename 0.011
testWrongRulesetWithRulename 0.003
usingDebug 0.073
testWrongRuleset 0.003
exitStatusWithViolations 0.009
minimumPriority 0.024

ASTFormalParameterTest

testVarargs 0

ASTBlockStatementTest

testIsAllocation 0.002
testIsAllocation2 0

StructureTest

testAddResultsinDFANodeContainingAddedNode 0

EmptyRulesTest

EmptyCatchBlock::0 simple failure 0.001
EmptyCatchBlock::1 ok 0.001
EmptyCatchBlock::2 no catch with nested catch in finally 0.001
EmptyCatchBlock::3 multiple catch blocks 0.001
EmptyCatchBlock::4 empty try with finally 0.001
EmptyCatchBlock::5 InterruptedException is OK 0.001
EmptyCatchBlock::6 CloneNotSupportedException is OK 0.001
EmptyCatchBlock::7 single-line comment is not OK 0.001
EmptyCatchBlock::8 single-line comment is OK 0.001
EmptyCatchBlock::9 multiple-line comment is not OK 0.001
EmptyCatchBlock::10 multiple-line comment is OK 0.001
EmptyCatchBlock::11 Javadoc comment is not OK 0.001
EmptyFinallyBlock::0 empty try/catch/finally 0.001
EmptyFinallyBlock::1 try/finally, no catch 0.001
EmptyFinallyBlock::2 finally block with contents 0.001
EmptyFinallyBlock::3 multiple catch blocks with finally 0.001
EmptyIfStmt::0 one empty 0.001
EmptyIfStmt::1 one not empty 0.001
EmptyIfStmt::2 empty statement 0
EmptyIfStmt::3 empty if statement with comment 0.001
EmptyInitializer::0 failure case (non static) 0.001
EmptyInitializer::1 failure case (static) 0.002
EmptyInitializer::2 not an initializer 0.001
EmptyInitializer::3 initializer not empty 0.001
EmptyStatementBlock::0 failure case 0.001
EmptyStatementBlock::1 statement block not empty 0.001
EmptyStatementBlock::2 not a statement block 0.001
EmptyStatementNotInLoop::0 ok, semicolon after for 0.001
EmptyStatementNotInLoop::1 ok, semicolon after while 0.005
EmptyStatementNotInLoop::2 bad, random semicolon 0
EmptyStatementNotInLoop::3 bad, double semicolon 0
EmptyStatementNotInLoop::4 ok, nested class 0.001
EmptyStaticInitializer::0 bad 0.001
EmptyStaticInitializer::1 ok 0
EmptySwitchStatements::0 bad 0.001
EmptySwitchStatements::1 ok 0.001
EmptySynchronizedBlock::0 bad 0.001
EmptySynchronizedBlock::1 ok 0.001
EmptyTryBlock::0 bad 0.001
EmptyTryBlock::1 bad 0.001
EmptyTryBlock::2 ok 0
EmptyWhileStmt::0 bad 0
EmptyWhileStmt::1 while(true); 0.001

FieldDeclTest

testFinal 0.001
testVolatile 0
testPrivate 0
testProtected 0
testPublic 0.001
testTransient 0
testStatic 0.004

PMDASMClassLoaderTest

testLoadClassWithImportOnDemand 0
testClassWithImportInnerOnDemand 0
testCachingOfNotFoundClasses 0

ImageFinderFunctionTest

testSeveralImages 0
testSingleImage 0

LanguageVersionTest

testFindVersionsForLanguageNameAndVersion[0] 0.014
testGetLanguageVersionForTerseName[0] 0
testFindVersionsForLanguageNameAndVersion[1] 0
testGetLanguageVersionForTerseName[1] 0
testFindVersionsForLanguageNameAndVersion[2] 0.001
testGetLanguageVersionForTerseName[2] 0
testFindVersionsForLanguageNameAndVersion[3] 0
testGetLanguageVersionForTerseName[3] 0
testFindVersionsForLanguageNameAndVersion[4] 0
testGetLanguageVersionForTerseName[4] 0
testFindVersionsForLanguageNameAndVersion[5] 0
testGetLanguageVersionForTerseName[5] 0
testFindVersionsForLanguageNameAndVersion[6] 0
testGetLanguageVersionForTerseName[6] 0

J2EERulesTest

DoNotCallSystemExit::0 basic violations 0.002
DoNotCallSystemExit::1 ok 0
DoNotCallSystemExit::2 basic violations with Runtime 0.001
DoNotUseThreads::0 Having thread in a type name is doubtfull but allowed 0.002
DoNotUseThreads::1 extending threads is not allowed 0.001
DoNotUseThreads::2 implementing runnabel is not allowed 0.021
DoNotUseThreads::3 Use of runnable is also not allowed 0
LocalHomeNamingConvention::0 Bad suffix 0
LocalHomeNamingConvention::1 Good suffix 0
LocalInterfaceSessionNamingConvention::0 Bad suffix 0
LocalInterfaceSessionNamingConvention::1 Good suffix 0
MDBAndSessionBeanNamingConvention::0 Bad SessionBean name 0
MDBAndSessionBeanNamingConvention::1 Bad MessageDrivenBean name 0
MDBAndSessionBeanNamingConvention::2 Good SessionBean name 0
MDBAndSessionBeanNamingConvention::3 Good MessageDrivenBean name 0
RemoteInterfaceNamingConvention::0 Bad Session suffix 0
RemoteInterfaceNamingConvention::1 Bad EJB suffix 0
RemoteInterfaceNamingConvention::2 Bad Bean suffix 0
RemoteInterfaceNamingConvention::3 Good suffix 0
RemoteSessionInterfaceNamingConvention::0 Bad EJBHome name 0.001
RemoteSessionInterfaceNamingConvention::1 Good EJBHome name 0.001
StaticEJBFieldShouldBeFinal::0 Good practice 0.001
StaticEJBFieldShouldBeFinal::1 Bad example 0.007
UseProperClassLoader::0 failure case 0
UseProperClassLoader::1 correct way 0

SimpleTypedNameDeclarationTest

testEquals 0

XPathRuleTest

testFollowingSibling 0.001
testPluginname 0.002
testImageOfPrimarySuffix 0.006
testVariables 0.001

BracesRulesTest

ForLoopsMustUseBraces::0 simple failure case 0.001
ForLoopsMustUseBraces::1 ok 0.002
ForLoopsMustUseBraces::2 0.002
ForLoopsMustUseBraces::3 0.001
ForLoopsMustUseBraces::4 0.002
IfElseStmtsMustUseBraces::0 else without braces 0.001
IfElseStmtsMustUseBraces::1 ok 0.002
IfElseStmtsMustUseBraces::2 two sets of missing braces 0.003
IfElseStmtsMustUseBraces::3 elseif with missing braces 0.001
IfElseStmtsMustUseBraces::4 elseif with braces after else 0.002
IfElseStmtsMustUseBraces::5 elseif with missing braces, first braces on separate line 0.01
IfElseStmtsMustUseBraces::6 bug 976643 - nested ifs without braces 0
IfStmtsMustUseBraces::0 simple failure case 0.002
IfStmtsMustUseBraces::1 ok 0.002
IfStmtsMustUseBraces::2 nested ifs 0.002
WhileLoopsMustUseBraces::0 no braces 0.001
WhileLoopsMustUseBraces::1 with braces 0.002

RuleSetFactoryTest

testExclusionOfUselessParantheses 0.084
testDtd 0.17
testXmlSchema 0.172
testReadWriteRoundTrip 0.822
testAllPMDBuiltInRulesMeetConventions 0.071

PMDCoverageTest

testPmdOptions 3.141
testResourceFileCommands 13.12

FinalizersRulesTest

AvoidCallingFinalize::0 simple failure case 0.001
AvoidCallingFinalize::1 calling finalize on an object 0.001
AvoidCallingFinalize::2 calling super.finalize 0.001
AvoidCallingFinalize::3 no call to finalize 0.001
AvoidCallingFinalize::4 it's ok in a finalizer 0.001
AvoidCallingFinalize::5 finalizer in anon inner class is OK too 0.002
AvoidCallingFinalize::6 #1440 NPE in AvoidCallingFinalize 0.001
EmptyFinalizer::0 simple failure 0
EmptyFinalizer::1 ok 0.001
FinalizeDoesNotCallSuperFinalize::0 bad 0.004
FinalizeDoesNotCallSuperFinalize::1 ok 0
FinalizeDoesNotCallSuperFinalize::2 ok, super.finalize called in try..finally 0
FinalizeDoesNotCallSuperFinalize::3 ok, super.finalize called in try..catch..finally 0.001
FinalizeOnlyCallsSuperFinalize::0 bad 0.007
FinalizeOnlyCallsSuperFinalize::1 ok 0
FinalizeOverloaded::0 bad 0
FinalizeOverloaded::1 ok 0
FinalizeShouldBeProtected::0 public finalize 0
FinalizeShouldBeProtected::1 finalize with some params 0
FinalizeShouldBeProtected::2 legitimate overriding 0

ASTThrowStatementTest

testGetFirstASTNameImageNull 0.001
testGetFirstASTNameImageNew 0

DAAPathFinderTest

testTwoUpdateDefs 0.001

ParserCornersTest

testInnerOuterClass 0.001
testGenericsProblem 0
testLambdaBug1333 0.003
testLambdaBug1470 0.019
testGetFirstASTNameImageNull 0.002
testParsersCases15 0.007
testParsersCases17 0.005
testParsersCases18 0.011
emptyFileJustComment 0
testBug1429ParseError 0.003
testMultipleExceptionCatching 0
testCastLookaheadProblem 0

StatementAndBraceFinderTest

testWhileStmtHasCorrectTypes 0
testForStmtHasCorrectTypes 0
testOnlyWorksForMethodsAndConstructors 0
testStatementExpressionParentChildLinks 0
testVariableDeclaratorParentChildLinks 0.016
testIfStmtHasCorrectTypes 0

UnusedImportsTest

UnusedImports::0 simple unused single type import 0.002
UnusedImports::1 one used single type import 0.001
UnusedImports::2 2 unused single-type imports 0.001
UnusedImports::3 1 used single type import 0.001
UnusedImports::4 1 import stmt, used only in throws clause 0
UnusedImports::5 for loop 0.002
UnusedImports::6 Generics 0
UnusedImports::7 Annotations 0.001
UnusedImports::8 Annotations 2 0.002
UnusedImports::9 import from default package 0.001
UnusedImports::10 import from default package 0.003
UnusedImports::11 On demand import 0
UnusedImports::12 imports used in javadoc comment, see also bug #254 0.001
UnusedImports::13 #1280 False Positive in UnusedImports when import used in javadoc 0.001
UnusedImports::14 #914 False +ve from UnusedImports with wildcard static imports 0.008
UnusedImports::15 #1465 False Positve UnusedImports with javadoc @link 0

MatchAlgorithmTest

testIgnore 0.001
testSimple 0.013

ImportsRulesTest

DontImportJavaLang::0 import java.lang.String 0
DontImportJavaLang::1 import java.lang.* 0
DontImportJavaLang::2 import java.lang.ref/reflect/annotation/instrument/management 0.004
DontImportJavaLang::3 Static Java imports are OK 0.001
DontImportJavaLang::4 Importing java.lang.Thread.UncaughtExceptionHandler 0.001
DontImportJavaLang::5 import java.lang.ProcessBuilder.Redirect: #1031 false DontImportJavaLang 0.002
DuplicateImports::0 duplicate single type imports 0.001
DuplicateImports::1 duplicate wildcard imports 0.002
DuplicateImports::2 single type import after wildcard import 0.009
DuplicateImports::3 subpackage import, ok 0
DuplicateImports::4 674394, disambiguation import should be allowed 0
DuplicateImports::5 674394, disambiguation import because of conflict with java.lang 0.001
DuplicateImports::6 #1306 False positive on duplicate when using static imports 0.002
DuplicateImports::7 negative case - static on-demand imports 0.002
ImportFromSamePackage::0 simple failure 0.001
ImportFromSamePackage::1 class in default package importing from sub package 0.002
ImportFromSamePackage::2 class in default package importing from other package 0.001
ImportFromSamePackage::3 class not in default package importing from default package 0.002
ImportFromSamePackage::4 class in default package importing from default package 0.001
ImportFromSamePackage::5 importing from subpackage 0.002
ImportFromSamePackage::6 importing all from same package 0.001
TooManyStaticImports::0 simple violation 0.001
TooManyStaticImports::1 ok 0.001
TooManyStaticImports::2 ok, we allow five now 0.001
UnnecessaryFullyQualifiedName::0 1, nothing wrong 0.002
UnnecessaryFullyQualifiedName::1 2, valid implements 0.001
UnnecessaryFullyQualifiedName::2 3, invalid implements 0.001
UnnecessaryFullyQualifiedName::3 4, valid extends 0.003
UnnecessaryFullyQualifiedName::4 5, invalid extends 0.003
UnnecessaryFullyQualifiedName::5 6, valid field 0
UnnecessaryFullyQualifiedName::6 7, invalid field 0.004
UnnecessaryFullyQualifiedName::7 8, valid return type 0.001
UnnecessaryFullyQualifiedName::8 9, invalid return type 0.001
UnnecessaryFullyQualifiedName::9 10, valid formal parameter 0.001
UnnecessaryFullyQualifiedName::10 11, invalid formal parameter 0.002
UnnecessaryFullyQualifiedName::11 12, valid static method call 0.001
UnnecessaryFullyQualifiedName::12 13, invalid static method call 0.002
UnnecessaryFullyQualifiedName::13 14, valid static import method call 0.002
UnnecessaryFullyQualifiedName::14 15, invalid static import method call 0.001
UnnecessaryFullyQualifiedName::15 16, valid static import method call with class import 0.002
UnnecessaryFullyQualifiedName::16 17, invalid static import method call with class import 0.001
UnnecessaryFullyQualifiedName::17 18, on-demand, valid field 0.008
UnnecessaryFullyQualifiedName::18 19, on-demand, invalid field 0.002
UnnecessaryFullyQualifiedName::19 20, on-demand, valid static import method call 0.002
UnnecessaryFullyQualifiedName::20 21, on-demand, invalid static import method call 0.001
UnnecessaryFullyQualifiedName::21 22, valid on-demand static import method call with class import 0.002
UnnecessaryFullyQualifiedName::22 23, invalid on-demand static import method call with class import 0.001
UnnecessaryFullyQualifiedName::23 #1078 Package statement introduces false positive UnnecessaryFullyQualifiedName violation 0.001
UnnecessaryFullyQualifiedName::24 #1404 Java8 'Unnecessary use of fully qualified name' in Streams Collector 0.005
UnnecessaryFullyQualifiedName::25 #1436 UnnecessaryFullyQualifiedName false positive on clashing static imports with enums 0.003
UnusedImports::0 simple unused single type import 0.001
UnusedImports::1 one used single type import 0.001
UnusedImports::2 2 unused single-type imports 0.002
UnusedImports::3 1 used single type import 0
UnusedImports::4 1 import stmt, used only in throws clause 0.003
UnusedImports::5 for loop 0.001
UnusedImports::6 Generics 0.002
UnusedImports::7 Annotations 0.002
UnusedImports::8 Annotations 2 0.001
UnusedImports::9 import from default package 0.001
UnusedImports::10 import from default package 0.001
UnusedImports::11 Used static import 0.002
UnusedImports::12 Unused static import 0.001
UnusedImports::13 On demand import 0.002
UnusedImports::14 imports used in javadoc comment 0.001
UnusedImports::15 Bug 2606609 : False "UnusedImports" positive in package-info.java 0.002
UnusedImports::16 bug #254 False+ : UnusedImport with Javadoc @link 0.001
UnusedImports::17 #1181 unused import false positive if used as parameter in javadoc only. 0.001
UnusedImports::18 #1280 False Positive in UnusedImports when import used in javadoc 0.001
UnusedImports::19 #914 False +ve from UnusedImports with wildcard static imports 0.004
UnusedImports::20 #1465 False Positve UnusedImports with javadoc @link 0.002

SuppressWarningsTest

testConstructorLevelSuppression 0.001
testNoSuppressionSomethingElseS 0.002
testMethodLevelSuppression 0
testParameterLevelSuppression 0
testSuppressAll 0
testInheritedSuppression 0.001
testSpecificSuppressionMulitpleValues1 0.001
testSpecificSuppressionMulitpleValues2 0.003
testSpecificSuppressionValue1 0.002
testSpecificSuppressionValue2 0.001
testSpecificSuppressionValue3 0.001
testFieldLevelSuppression 0.001
testSpecificSuppression 0.001
testNoSuppressionBlank 0
testLocalVariableLevelSuppression 0.001
testSpecificSuppressionAtTopLevel 0.016
testClassLevelSuppression 0.002

TypeSetTest

testFindClassSamePackage 0
testImplicitImportResolverPassFail 0
testVoidTypeResolver 0
testCurrentPackageResolverPass 0
testFindClassImportOnDemand 0
testFullyQualifiedNameResolverWithNull 0
testExplicitImportResolverWithNullAndEmptyImports 0
testCurrentPackageResolverWithNull 0
testASTCompilationUnitPackage 0
testExplicitImportResolver 0
testExplicitImportResolverWithNull 0
testImportOnDemandResolverPass 0
importOnDemandResolverFail1 0
importOnDemandResolverFail2 0
testVoidTypeResolverWithNull 0
testAddImport 0
testFindClassExplicitImport 0
testImplicitImportResolverWithNull 0
testImplicitImportResolverPass 0
testImportOnDemandResolverWithNull 0
testPrimitiveTypeResolver 0
testFindClassPrimitive 0
testFindClassImplicitImport 0
testPrimitiveTypeResolverWithNull 0
testFindClassVoid 0
testFindFullyQualified 0

StrictExceptionRulesTest

AvoidCatchingGenericException::0 failure case 0.001
AvoidCatchingGenericException::1 catching another type, ok 0.002
AvoidCatchingGenericException::2 throwing it, ok 0.001
AvoidCatchingNPE::0 failure case 0.001
AvoidCatchingNPE::1 catching another type, ok 0.001
AvoidCatchingNPE::2 throwing it, ok 0.001
AvoidCatchingThrowable::0 simple failure case 0.002
AvoidCatchingThrowable::1 ok 0.004
AvoidLosingExceptionInformation::0 basic failure case 0.002
AvoidLosingExceptionInformation::1 fetch the value returned by getMessage(), ok 0.002
AvoidLosingExceptionInformation::2 fetch the value returned by getCause(), ok 0.002
AvoidLosingExceptionInformation::3 a mix of guilty calls to getMessage(), getLocalizedMessage(), getCause() or getStackTrace(), failure 0.001
AvoidLosingExceptionInformation::4 a larger mix of guilty calls to getMessage(), getLocalizedMessage(), getCause(), getStackTrace() or toString(), failure 0.003
AvoidRethrowingException::0 failure case 0.002
AvoidRethrowingException::1 doing something else before throwing it, ok 0.002
AvoidRethrowingException::2 throwing the return value of a method call on the exception, ok 0.001
AvoidRethrowingException::3 throwing a different exception, ok 0.002
AvoidThrowingNewInstanceOfSameException::0 basic failure case 0.001
AvoidThrowingNewInstanceOfSameException::1 do something else before throwing a new instance of the same exception, ok 0.021
AvoidThrowingNewInstanceOfSameException::2 repackage cause as an instance of the same exception, failure 0.002
AvoidThrowingNewInstanceOfSameException::3 throw new instance of the same exception with a different message, ok 0.002
AvoidThrowingNewInstanceOfSameException::4 throw new instance of the same exception with the same message, failure 0.002
AvoidThrowingNewInstanceOfSameException::5 throws a new instance of the same exception without any arguments, ok 0.002
AvoidThrowingNewInstanceOfSameException::6 throws a new instance of the same exception from a nested try/catch block, ok 0.002
AvoidThrowingNewInstanceOfSameException::7 wraps the exception in a new instance of the same exception from a nested try/catch block, ok 0.001
AvoidThrowingNullPointerException::0 throwing various types 0.002
AvoidThrowingRawExceptionTypes::0 throwing various types 0.001
AvoidThrowingRawExceptionTypes::1 Bug 1796928 : The code uses a classe that use the same names that the one this rule is looking for... 0.002
AvoidThrowingRawExceptionTypes::2 #1337: False positive "Avoid throwing raw exception types" when exception is not thrown 0.001
DoNotExtendJavaLangError::0 Extends with fully qualified name 0.001
DoNotExtendJavaLangError::1 Extends with implicit import 0.002
DoNotExtendJavaLangError::2 Extends something else 0
DoNotThrowExceptionInFinally::0 classic failure case 0.002
ExceptionAsFlowControl::0 failure case 0.002
ExceptionAsFlowControl::1 normal throw catch 0.001
ExceptionAsFlowControl::2 BUG 996007 0.002
ExceptionAsFlowControl::3 NPE 0.003
SignatureDeclareThrowsException::0 method throws Exception 0.001
SignatureDeclareThrowsException::1 ok 0.002
SignatureDeclareThrowsException::2 constructor throws Exception 0.017
SignatureDeclareThrowsException::3 skip junit setUp method 0.002
SignatureDeclareThrowsException::4 skip junit tearDown method 0.002
SignatureDeclareThrowsException::5 Generics 0.001
SignatureDeclareThrowsException::6 skip any method starting with 'test' 0.002
SignatureDeclareThrowsException::7 #913 SignatureDeclareThrowsException is raised twice 0.002

ASTFieldDeclarationTest

testWithEnum 0
testGetVariableName 0.001
testMultiDimensionalArray 0
testIsArray 0.001
testIsSyntacticallyPublic 0

ASTImportDeclarationTest

testStaticImportFailsWithJDK14 0
testGetImportedNameNode 0
testImportOnDemand 0.001
testStaticImport 0

SignatureDeclareThrowsExceptionTest

SignatureDeclareThrowsException::0 method throws Exception 0.001
SignatureDeclareThrowsException::1 ok 0.002
SignatureDeclareThrowsException::2 constructor throws Exception 0.001
SignatureDeclareThrowsException::3 JUnit 4 testcase 0.001
SignatureDeclareThrowsException::4 skip method in class that extends TestCase 0.001
SignatureDeclareThrowsException::5 Don't skip other methods 0.002
SignatureDeclareThrowsException::6 Unless 0.001
SignatureDeclareThrowsException::7 skip junit setUp method where the superclass is TestCase 0.001
SignatureDeclareThrowsException::8 skip junit setUp method where the superclass is TestCase, imported explicitly 0.002
SignatureDeclareThrowsException::9 skip junit setUp method where the superclass is TestCase, but is imported implicitly 0.001
SignatureDeclareThrowsException::10 skip junit setUp method where the superclass is TestCase and is in the same package 0.002
SignatureDeclareThrowsException::11 Generics 0.002

ASTVariableDeclaratorIdTest

testAnnotations 0.002
testLambdaWithoutType 0.001
testIsExceptionBlockParameter 0
testTypeNameNode 0.001
testLambdaWithType 0

AvoidDuplicateLiteralsRuleTest

testStringParserEmptyString 0
testStringParserEscapedEscapedChar 0
testStringParserSimple 0
testStringParserEscapedChar 0

OptimizationsRulesTest

AddEmptyString::0 Bad add 0
AddEmptyString::1 Good add 0
AddEmptyString::2 Good convert 0.001
AvoidArrayLoops::0 copy index into array 0.002
AvoidArrayLoops::1 copy one array to another 0.002
AvoidArrayLoops::2 copy via while loop 0.002
AvoidArrayLoops::3 copy involving multiple arrays is ok 0.002
AvoidArrayLoops::4 copy involving method invocation on array element is ok 0.004
AvoidArrayLoops::5 using an offset, still bad 0.001
AvoidArrayLoops::6 nested arrays on LHS, ok 0.001
AvoidArrayLoops::7 adding to array is ok 0.001
AvoidInstantiatingObjectsInLoops::0 TEST1 0.002
AvoidInstantiatingObjectsInLoops::1 TEST2 0.001
AvoidInstantiatingObjectsInLoops::2 TEST3 0.001
AvoidInstantiatingObjectsInLoops::3 TEST4 0.001
AvoidInstantiatingObjectsInLoops::4 throw new is OK 0.001
AvoidInstantiatingObjectsInLoops::5 return new in loop is OK 0.001
AvoidInstantiatingObjectsInLoops::6 #1215 AvoidInstantiatingObjectsInLoops matches the right side of a list iteration loop 0.002
LocalVariableCouldBeFinal::0 TEST1 0.001
LocalVariableCouldBeFinal::1 TEST2 0.001
LocalVariableCouldBeFinal::2 TEST3 0.001
LocalVariableCouldBeFinal::3 TEST4 0.001
LocalVariableCouldBeFinal::4 TEST5 0.001
LocalVariableCouldBeFinal::5 TEST6 0.002
LocalVariableCouldBeFinal::6 TEST7 0.001
LocalVariableCouldBeFinal::7 TEST8 0.002
LocalVariableCouldBeFinal::8 TEST9 0.003
LocalVariableCouldBeFinal::9 Bug 2614040 : false + if a += assignment operator is used inside a method call. 0.002
LocalVariableCouldBeFinal::10 Bug #1047 False Positive in 'for' loops for LocalVariableCouldBeFinal in 5.0.1 0.001
LocalVariableCouldBeFinal::11 Verify another case for Bug #1047 False Positive in 'for' loops for LocalVariableCouldBeFinal in 5.0.1 0.002
MethodArgumentCouldBeFinal::0 TEST1 0.001
MethodArgumentCouldBeFinal::1 TEST2 0.001
MethodArgumentCouldBeFinal::2 TEST3 0.001
MethodArgumentCouldBeFinal::3 TEST4 0.001
MethodArgumentCouldBeFinal::4 TEST5 0.002
MethodArgumentCouldBeFinal::5 TEST6 0.001
MethodArgumentCouldBeFinal::6 Shouldn't trigger on try blocks 0.001
MethodArgumentCouldBeFinal::7 Skip native methods 0.002
MethodArgumentCouldBeFinal::8 Skip abstract methods 0.001
MethodArgumentCouldBeFinal::9 self assignment of a method param means it can't be final 0.002
MethodArgumentCouldBeFinal::10 same as above but prefix vs postfix 0.001
MethodArgumentCouldBeFinal::11 same as above but with extra parenthesis 0.002
MethodArgumentCouldBeFinal::12 bug 1808158 - Constructor args could also be final 0.001
PrematureDeclaration::0 premature declaration before unrelated test 0.003
PrematureDeclaration::1 optimal var declaration position 0.001
PrematureDeclaration::2 Bug #1064 Exception running PrematureDeclaration 0.002
PrematureDeclaration::3 #1305 variable declaration inside switch causes ClassCastException 0.001
PrematureDeclaration::4 #1396 PrematureDeclaration lambda false positive 0.002
RedundantFieldInitializer::0 multiple declarations 0.002
RedundantFieldInitializer::1 references 0.002
RedundantFieldInitializer::2 arrays of primitives 0.002
RedundantFieldInitializer::3 arrays of objects 0.001
RedundantFieldInitializer::4 mixed arrays 0.002
RedundantFieldInitializer::5 nested class 0.003
RedundantFieldInitializer::6 boolean 0.002
RedundantFieldInitializer::7 byte 0.007
RedundantFieldInitializer::8 char 0.005
RedundantFieldInitializer::9 short 0.005
RedundantFieldInitializer::10 int 0.004
RedundantFieldInitializer::11 long 0.004
RedundantFieldInitializer::12 float 0.007
RedundantFieldInitializer::13 double 0.016
RedundantFieldInitializer::14 #1298 Member variable int type with value 0xff000000 causes processing error 0.002
RedundantFieldInitializer::15 Java7 binary literals and underscores 0.007
RedundantFieldInitializer::16 #1418 RedundantFieldInitializer false positive with large long value 0.003
RedundantFieldInitializer::17 #1443 RedundantFieldInitializer: False positive for small floats 0.001
SimplifyStartsWith::0 failure case 0.002
SimplifyStartsWith::1 startsWith multiple chars 0.002
SimplifyStartsWith::2 startsWith defined on some other class, doesn't take a String 0.001
SimplifyStartsWith::3 #1392 SimplifyStartsWith false-negative 0.008
UnnecessaryWrapperObjectCreation::0 failure case 0.002
UnnecessaryWrapperObjectCreation::1 calling valueOf is OK 0.005
UnnecessaryWrapperObjectCreation::2 failure case for 1.5+ 0.017
UnnecessaryWrapperObjectCreation::3 Patch 2075906: Add toString() to the rule UnnecessaryWrapperObjectCreation 0.003
UnnecessaryWrapperObjectCreation::4 #1057 False positive for UnnecessaryWrapperObjectCreation 0.002
UseArrayListInsteadOfVector::0 TEST0 0.001
UseArrayListInsteadOfVector::1 TEST1 0.002
UseArrayListInsteadOfVector::2 TEST2 0.001
UseArrayListInsteadOfVector::3 TEST3 0.003
UseArrayListInsteadOfVector::4 #1146 real problem 0.002
UseArrayListInsteadOfVector::5 #1146 UseArrayListInsteadOfVector false positive when using own Vector class 0.002
UseArraysAsList::0 failure case 0.005
UseArraysAsList::1 adding first element repeatedly 0.003
UseArraysAsList::2 inside conditional 0.002
UseArraysAsList::3 adding new object 0.001
UseArraysAsList::4 calling method 0.002
UseArraysAsList::5 Integer array passed as argument 0.017
UseArraysAsList::6 #1099 UseArraysAsList false positives 0.002
UseStringBufferForStringAppends::0 failure case 0.002
UseStringBufferForStringAppends::1 concat inside method call 0.008
UseStringBufferForStringAppends::2 startsWith 0.002
UseStringBufferForStringAppends::3 compound append, should only report 1 failure 0.001
UseStringBufferForStringAppends::4 failure case 0.002
UseStringBufferForStringAppends::5 static failure case 0.001
UseStringBufferForStringAppends::6 reference self 0.002
UseStringBufferForStringAppends::7 false positive bug #2002722 0.001
UseStringBufferForStringAppends::8 false positive bug #2002722, different bug in comment section 0.002
UseStringBufferForStringAppends::9 #1340 UseStringBufferForStringAppends False Positive with ternary operator (used in condition) 0.002
UseStringBufferForStringAppends::10 #1340 UseStringBufferForStringAppends False Positive with ternary operator (used both in condition and options) 0.002

AcceptanceTest

testInnerOuterClass 0
testDemo 0
testEnum 0
testEq 0.001
testFieldFinder 0
testClashingSymbols 0
testInitializer 0
testCatchBlocks 0

GeneralFiddlingTest

test1 0
innerClassShouldWork 0

CloneRulesTest

CloneMethodMustImplementCloneable::0 ok, implements Cloneable 0.001
CloneMethodMustImplementCloneable::1 bad, doesn't implement Cloneable 0.001
CloneMethodMustImplementCloneable::2 ok, not Object.clone since method has a param 0.001
CloneMethodMustImplementCloneable::3 ok, doesn't implement Cloneable but only throw CloneNotSupportedException 0.003
CloneMethodMustImplementCloneable::4 ok, inner class implements Cloneable 0.001
CloneMethodMustImplementCloneable::5 Bug 1698550, nr 1 0.002
CloneMethodMustImplementCloneable::6 Bug 1698550, nr 2 0.001
CloneThrowsCloneNotSupportedException::0 ok, throws CloneNotSupportedException 0.001
CloneThrowsCloneNotSupportedException::1 bad 0.002
CloneThrowsCloneNotSupportedException::2 final class, rule does not apply 0.002
CloneThrowsCloneNotSupportedException::3 testing with multiple methods 0.001
ProperCloneImplementation::0 ok, calls super.clone 0.001
ProperCloneImplementation::1 bad, Foo.clone() calls new Foo(); 0.001
ProperCloneImplementation::2 clone([whatever]) is fine 0.002
ProperCloneImplementation::3 bad, Foo.clone() calls new Foo(); 0.001

VariableAccessTest

testGetVariableName 0

AbstractCommentRuleTest

testCommentAssignments 0
testFilteredCommentIn 0

LocalScopeTest

testLocalVariableTypesAreRecorded 0
testQualifiedNameOccurrence 0
testMethodArgumentTypesAreRecorded 0
testNameWithThisOrSuperIsNotFlaggedAsUnused 0
testNameWithSuperIsNotFlaggedAsUnused 0
testPostfixUsageIsRecorded 0
testgetEnclosingMethodScope 0
testLocalVariableDeclarationFound 0

DataFlowNodeTest

testRemovePathWithNonChild 0
testAddPathToChild 0
testRemovePathToChild 0
testSetType 0
testReverseParentPathsTo 0

CPDCommandLineInterfaceTest

testEncodingOption 0.047
testExcludes 0.002
testIgnoreIdentifiers 0.002
testFormatXmlWithoutEncoding 0.003
testBrokenAndValidFile 0.026
testCSVFormat 0.01

ClassTypeResolverTest

testBinaryStringPromotion 0
testBinaryNumericOperators 0
testBinaryLogicalOperators 0
testUnaryNumericOperators 0
testUnaryLogicalOperators 0.004
testAssignmentOperators 0
testClassNameExists 0
testAnonymousInnerClass 0
testExtraTopLevelClass 0.001
testInnerClass 0
testBinaryNumericPromotion 0.003
testEnumAnonymousInnerClass 0.001
testUnaryNumericPromotion 0.005
acceptanceTest 0
testLiterals 0.001

DocumentNavigatorTest

testPrecedingSiblingAxisIterator2 0.01
testFollowingSiblingAxisIterator2 0.005
testXPath 0.004
testDescendantAxisIterator2 0.01
testFollowingSiblingAxisIterator 0.005
testPrecedingSiblingAxisIterator 0.004
testParentAxisIterator2 0.002
testParentAxisIterator 0.001
testXPath2 0.006
testDescendantAxisIterator 0.002
testChildAxisIterator 0.004

LooseCouplingTest

LooseCoupling::0 returning a HashSet, bad 0.001
LooseCoupling::1 returning a Map, OK 0.001
LooseCoupling::2 no problemo 0.001
LooseCoupling::3 returning a set 0.002
LooseCoupling::4 field declared of type HashSet 0.001
LooseCoupling::5 field, return type both HashSet 0
LooseCoupling::6 two fields 0.001
LooseCoupling::7 method param is HashMap 0.003
LooseCoupling::8 Vector could be List 0.001
LooseCoupling::9 ArrayList could be List 0.02
LooseCoupling::10 java.util.HashMap should be Map 0.004
LooseCoupling::11 #938 False positive on LooseCoupling for overriding methods 0.001

ClassDeclTest

testAbstract 0.001
testPublicFinal 0
testFinal 0
testPublic 0.001
testStrict 0

ClassScopeTest

testCantContainsSuperToString 0
testOneParam 0
testbuz 0
testMethodUsageSeenWithThis 0.001
testNullType 0.004
testOneParamVararg 0
testEnumTypeParameter 0
testNestedClassFieldAndParameter 0
testVarArgsEmpty 0
testEnumsClassScope 0
testContains 0
testMethodUsageSeen2 0
testContainsStaticVariablePrefixedWithClassName 0.001
testNestedClassDeclFound 0
testTwoParams 0
testClassName 0
testMethodUsageSeen 0
testTwoMethodsSameNameDiffArgs 0
testMethodDeclarationRecorded 0.001
testNoParams 0
testAnonymousInnerClassName 0
testTwoParamsVararg 0

Failure Details

[Summary] [Package List] [Test Cases]


ConsecutiveLiteralAppends::44 43, Using variable char array
skipped: skipped
UselessOverridingMethod::19 False +: Overriding method merely calls super (see bug 1415525)
skipped: skipped
UseVarargs::4 method, do not varargs as the signature is dictated by an interface // TODO Once this is implemented, perhaps it should be optional? The compiler will technically let you use varargs.
skipped: skipped
UnusedPrivateMethod::21 #46 False +: Unused private field: call to instance of self, received from another class
skipped: skipped
net.sourceforge.pmd.lang.java.rule.typeresolution.xml.MyTestCase
skipped: skipped