Fork me on GitHub

Surefire Report

Summary

[Summary] [Package List] [Test Cases]


Tests Errors Failures Skipped Success Rate Time
2505 0 0 5 99.8% 74.104

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.typeresolution 18 0 0 0 100% 0.147
net.sourceforge.pmd.lang.java.rule.strings 233 0 0 1 99.571% 1.046
net.sourceforge.pmd.lang.java.rule.naming 117 0 0 0 100% 0.501
net.sourceforge.pmd.lang.java.rule.optimizations 98 0 0 0 100% 0.489
net.sourceforge.pmd.lang.java.rule.clone 27 0 0 0 100% 0.129
net.sourceforge.pmd.lang.java.rule.loggingjakartacommons 23 0 0 0 100% 0.132
net.sourceforge.pmd.jaxen 12 0 0 0 100% 0.089
net.sourceforge.pmd.lang.java.symboltable 96 0 0 0 100% 0.03
net.sourceforge.pmd.lang.java.rule.comments 22 0 0 0 100% 0.074
net.sourceforge.pmd.lang.java.ast 145 0 0 0 100% 0.324
net.sourceforge.pmd.lang.java.rule.unnecessary 86 0 0 1 98.837% 0.426
net.sourceforge.pmd.lang.java.rule 6 0 0 0 100% 0.043
net.sourceforge.pmd.cli 11 0 0 0 100% 1.177
net.sourceforge.pmd.lang.java.rule.migrating 39 0 0 0 100% 0.182
net.sourceforge.pmd.lang.java.rule.braces 17 0 0 0 100% 0.079
net.sourceforge.pmd.lang.java.rule.android 8 0 0 0 100% 0.054
net.sourceforge.pmd.lang.java.rule.unusedcode 162 0 0 1 99.383% 1.102
net.sourceforge.pmd.lang.java.rule.strictexception 45 0 0 0 100% 0.143
net.sourceforge.pmd.lang.java.rule.empty 43 0 0 0 100% 0.14
net.sourceforge.pmd.ant 10 0 0 0 100% 4.205
net.sourceforge.pmd.lang.java.rule.codesize 70 0 0 0 100% 0.401
net.sourceforge.pmd.lang.java.rule.junit 111 0 0 0 100% 0.478
net.sourceforge.pmd.lang.java.rule.imports 70 0 0 0 100% 0.264
net.sourceforge.pmd.lang.java.rule.typeresolution.xml 1 0 0 1 0% 0
net.sourceforge.pmd.lang.java.rule.controversial 111 0 0 0 100% 7.195
net.sourceforge.pmd 31 0 0 0 100% 4.406
net.sourceforge.pmd.lang.java.rule.finalizers 20 0 0 0 100% 0.07
net.sourceforge.pmd.lang.java.rule.javabeans 23 0 0 0 100% 0.068
net.sourceforge.pmd.coverage 2 0 0 0 100% 40.768
net.sourceforge.pmd.lang.java.rule.loggingjava 23 0 0 0 100% 0.09
net.sourceforge.pmd.lang.java.rule.sunsecure 27 0 0 0 100% 0.112
net.sourceforge.pmd.lang.java.rule.coupling 42 0 0 0 100% 0.275
net.sourceforge.pmd.lang.java.rule.typeresolution 51 0 0 0 100% 0.271
net.sourceforge.pmd.lang.java.rule.basic 163 0 0 0 100% 1.691
net.sourceforge.pmd.lang.java 17 0 0 0 100% 0.068
net.sourceforge.pmd.lang.java.rule.j2ee 25 0 0 0 100% 0.081
net.sourceforge.pmd.lang.java.rule.design 433 0 0 1 99.769% 7.005
net.sourceforge.pmd.lang.java.dfa 47 0 0 0 100% 0.135
net.sourceforge.pmd.cpd 20 0 0 0 100% 0.214

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

net.sourceforge.pmd.typeresolution

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
NamingRulesTest 117 0 0 0 100% 0.501

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

Class Tests Errors Failures Skipped Success Rate Time
OptimizationsRulesTest 98 0 0 0 100% 0.489

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

Class Tests Errors Failures Skipped Success Rate Time
CloneRulesTest 27 0 0 0 100% 0.129

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

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

net.sourceforge.pmd.jaxen

Class Tests Errors Failures Skipped Success Rate Time
DocumentNavigatorTest 11 0 0 0 100% 0.081
RegexpAcceptanceTest 1 0 0 0 100% 0.008

net.sourceforge.pmd.lang.java.symboltable

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

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

Class Tests Errors Failures Skipped Success Rate Time
AbstractCommentRuleTest 2 0 0 0 100% 0
CommentRulesTest 20 0 0 0 100% 0.074

net.sourceforge.pmd.lang.java.ast

Class Tests Errors Failures Skipped Success Rate Time
ASTAnnotationTest 3 0 0 0 100% 0.056
ASTAssignmentOperatorTest 3 0 0 0 100% 0.001
ASTBlockStatementTest 2 0 0 0 100% 0.001
ASTBooleanLiteralTest 2 0 0 0 100% 0.004
ASTFieldDeclarationTest 5 0 0 0 100% 0.002
ASTFormalParameterTest 1 0 0 0 100% 0.005
ASTImportDeclarationTest 4 0 0 0 100% 0.004
ASTInitializerTest 1 0 0 0 100% 0.001
ASTLiteralTest 11 0 0 0 100% 0.017
ASTLocalVariableDeclarationTest 3 0 0 0 100% 0.006
ASTMethodDeclarationTest 1 0 0 0 100% 0
ASTPackageDeclarationTest 1 0 0 0 100% 0.001
ASTPrimarySuffixTest 2 0 0 0 100% 0.013
ASTSwitchLabelTest 2 0 0 0 100% 0
ASTThrowStatementTest 2 0 0 0 100% 0
ASTVariableDeclaratorIdTest 5 0 0 0 100% 0
AccessNodeTest 13 0 0 0 100% 0.007
ClassDeclTest 5 0 0 0 100% 0
EncodingTest 1 0 0 0 100% 0.001
FieldDeclTest 7 0 0 0 100% 0.005
JDKVersionTest 33 0 0 0 100% 0.054
MethodDeclTest 8 0 0 0 100% 0.004
ParserCornersTest 9 0 0 0 100% 0.127
SimpleNodeTest 21 0 0 0 100% 0.015

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

Class Tests Errors Failures Skipped Success Rate Time
UnnecessaryRulesTest 86 0 0 1 98.837% 0.426

net.sourceforge.pmd.lang.java.rule

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

net.sourceforge.pmd.cli

Class Tests Errors Failures Skipped Success Rate Time
CLITest 10 0 0 0 100% 1.15
XPathCLITest 1 0 0 0 100% 0.027

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

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

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

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
UnusedCodeRulesTest 162 0 0 1 99.383% 1.102

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

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

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

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

net.sourceforge.pmd.ant

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

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

Class Tests Errors Failures Skipped Success Rate Time
CodesizeRulesTest 70 0 0 0 100% 0.401

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

Class Tests Errors Failures Skipped Success Rate Time
JunitRulesTest 111 0 0 0 100% 0.478

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

Class Tests Errors Failures Skipped Success Rate Time
ImportsRulesTest 70 0 0 0 100% 0.264

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.lang.java.rule.controversial

Class Tests Errors Failures Skipped Success Rate Time
ControversialRulesTest 111 0 0 0 100% 7.195

net.sourceforge.pmd

Class Tests Errors Failures Skipped Success Rate Time
ExcludeLinesTest 2 0 0 0 100% 0.505
LanguageVersionDiscovererTest 3 0 0 0 100% 0.003
LanguageVersionTest 14 0 0 0 100% 0
ReportTest 6 0 0 0 100% 0.147
RuleSetFactoryTest 6 0 0 0 100% 3.751

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

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

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

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

net.sourceforge.pmd.coverage

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
SunSecureRulesTest 27 0 0 0 100% 0.112

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
CloneMethodMustImplementCloneableTest 12 0 0 0 100% 0.06
LooseCouplingTest 12 0 0 0 100% 0.082
SignatureDeclareThrowsExceptionTest 12 0 0 0 100% 0.059
UnusedImportsTest 15 0 0 0 100% 0.07

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

Class Tests Errors Failures Skipped Success Rate Time
BasicRulesTest 163 0 0 0 100% 1.691

net.sourceforge.pmd.lang.java

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

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

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

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

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

net.sourceforge.pmd.lang.java.dfa

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

net.sourceforge.pmd.cpd

Class Tests Errors Failures Skipped Success Rate Time
CPDCommandLineInterfaceTest 7 0 0 0 100% 0.201
JavaTokensTokenizerTest 11 0 0 0 100% 0.012
MatchAlgorithmTest 2 0 0 0 100% 0.001

Test Cases

[Summary] [Package List] [Test Cases]

ExcludeLinesTest

testAcceptance 0.498
testAlternateMarker 0.007

LanguageVersionDiscovererTest

testLanguageVersionDiscoverer 0.003
testJavaFileUsingDefaults 0
testJavaFileUsing14 0

LanguageVersionTest

testFindVersionsForLanguageNameAndVersion[0] 0
testGetLanguageVersionForTerseName[0] 0
testFindVersionsForLanguageNameAndVersion[1] 0
testGetLanguageVersionForTerseName[1] 0
testFindVersionsForLanguageNameAndVersion[2] 0
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

ReportTest

testBasic 0
testExclusionsInReportWithAnnotationsFullName 0.013
testExclusionsInReportWithNOPMD 0.002
testExclusionsInReportWithRuleViolationSuppressRegex 0.003
testExclusionsInReportWithRuleViolationSuppressXPath 0.124
testExclusionsInReportWithAnnotations 0.005

RuleSetFactoryTest

testExclusionOfUselessParantheses 0.006
testDogfoodRuleset 0.164
testDtd 0.507
testXmlSchema 0.4
testReadWriteRoundTrip 2.514
testAllPMDBuiltInRulesMeetConventions 0.16

PMDTaskTest

testExplicitRuleInRuleSet 0.879
testAbstractNames 0.809
testAbstractNamesInNestedRuleset 0.566
testRelativeRulesetsInRulesetfiles 0.412
testNoFormattersValidation 0.306
testCommaInRulesetfiles 0.337
testClasspath 0.079
testRelativeRulesets 0.251
testNestedRuleset 0.255
testFormatterWithProperties 0.311

CLITest

changeJavaVersion 0.376
exitStatusWithViolationsAndWithoutFailOnViolations 0.035
exitStatusNoViolations 0.168
minimalArgs 0.23
testWrongRulename 0.072
testWrongRulesetWithRulename 0.017
usingDebug 0.153
testWrongRuleset 0.011
exitStatusWithViolations 0.032
minimumPriority 0.056

XPathCLITest

runXPath 0.027

PMDCoverageTest

testPmdOptions 8.129
testResourceFileCommands 32.639

CPDCommandLineInterfaceTest

testEncodingOption 0.129
testExcludes 0.009
testIgnoreIdentifiers 0.007
testIgnoreIdentifiersFailOnViolationFalse 0.013
testFormatXmlWithoutEncoding 0.022
testBrokenAndValidFile 0.012
testCSVFormat 0.009

JavaTokensTokenizerTest

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

MatchAlgorithmTest

testIgnore 0
testSimple 0.001

DocumentNavigatorTest

testPrecedingSiblingAxisIterator2 0.004
testFollowingSiblingAxisIterator2 0.006
testXPath 0.012
testDescendantAxisIterator2 0.008
testFollowingSiblingAxisIterator 0.007
testPrecedingSiblingAxisIterator 0.008
testParentAxisIterator2 0.009
testParentAxisIterator 0.007
testXPath2 0.006
testDescendantAxisIterator 0.007
testChildAxisIterator 0.007

RegexpAcceptanceTest

testSimple 0.008

SuppressWarningsTest

testConstructorLevelSuppression 0.003
testNoSuppressionSomethingElseS 0.008
testMethodLevelSuppression 0.002
testParameterLevelSuppression 0.005
testSuppressAll 0.006
testInheritedSuppression 0.013
testSpecificSuppressionMulitpleValues1 0.002
testSpecificSuppressionMulitpleValues2 0.003
testSpecificSuppressionValue1 0.002
testSpecificSuppressionValue2 0.005
testSpecificSuppressionValue3 0.002
testFieldLevelSuppression 0.002
testSpecificSuppression 0.002
testNoSuppressionBlank 0.003
testLocalVariableLevelSuppression 0.003
testSpecificSuppressionAtTopLevel 0.003
testClassLevelSuppression 0.004

ASTAnnotationTest

testAnnotationFailsWithJDK14 0
testAnnotationSucceedsWithJDK15 0.056
testAnnotationSucceedsWithDefaultMode 0

ASTAssignmentOperatorTest

testSimpleAssignmentRecognized 0
testCompoundAssignmentPlusRecognized 0
testCompoundAssignmentMultRecognized 0.001

ASTBlockStatementTest

testIsAllocation 0.001
testIsAllocation2 0

ASTBooleanLiteralTest

testFalse 0.002
testTrue 0.002

ASTFieldDeclarationTest

testWithEnum 0.001
testGetVariableName 0
testMultiDimensionalArray 0.001
testIsArray 0
testIsSyntacticallyPublic 0

ASTFormalParameterTest

testVarargs 0.005

ASTImportDeclarationTest

testStaticImportFailsWithJDK14 0
testGetImportedNameNode 0.001
testImportOnDemand 0.001
testStaticImport 0.002

ASTInitializerTest

testDontCrashOnBlockStatement 0.001

ASTLiteralTest

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

ASTLocalVariableDeclarationTest

testMultDimArraySplitBraces 0.002
testSingleDimArray 0.002
testMultDimArray 0.002

ASTMethodDeclarationTest

testGetVariableName 0

ASTPackageDeclarationTest

testPackageName 0.001

ASTPrimarySuffixTest

testArrayDereference 0.002
testArguments 0.011

ASTSwitchLabelTest

testDefaultOff 0
testDefaultSet 0

ASTThrowStatementTest

testGetFirstASTNameImageNull 0
testGetFirstASTNameImageNew 0

ASTVariableDeclaratorIdTest

testAnnotations 0
testLambdaWithoutType 0
testIsExceptionBlockParameter 0
testTypeNameNode 0
testLambdaWithType 0

AccessNodeTest

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

ClassDeclTest

testAbstract 0
testPublicFinal 0
testFinal 0
testPublic 0
testStrict 0

EncodingTest

testDecodingOfUTF8 0.001

FieldDeclTest

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

JDKVersionTest

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

MethodDeclTest

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

ParserCornersTest

testInnerOuterClass 0.003
testGenericsProblem 0.002
testLambdaBug1333 0.006
testGetFirstASTNameImageNull 0.002
testParsersCases 0.105
emptyFileJustComment 0.001
testBug1429ParseError 0.005
testMultipleExceptionCatching 0.002
testCastLookaheadProblem 0.001

SimpleNodeTest

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

AcceptanceTest

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

DAAPathFinderTest

testTwoUpdateDefs 0.001

DataFlowNodeTest

testRemovePathWithNonChild 0
testAddPathToChild 0
testRemovePathToChild 0
testSetType 0.001
testReverseParentPathsTo 0

GeneralFiddlingTest

test1 0.009
innerClassShouldWork 0.001

StatementAndBraceFinderTest

testWhileStmtHasCorrectTypes 0.002
testForStmtHasCorrectTypes 0.012
testOnlyWorksForMethodsAndConstructors 0.001
testStatementExpressionParentChildLinks 0.002
testVariableDeclaratorParentChildLinks 0.001
testIfStmtHasCorrectTypes 0.002

StructureTest

testAddResultsinDFANodeContainingAddedNode 0

VariableAccessTest

testGetVariableName 0

JavaRuleViolationTest

testMethodName 0.003
testASTFormalParameterVariableName 0.007

XPathRuleTest

testFollowingSibling 0.005
testPluginname 0.014
testImageOfPrimarySuffix 0.012
testVariables 0.002

AndroidRulesTest

CallSuperFirst::0 Success 0.008
CallSuperFirst::1 Success 0.01
CallSuperFirst::2 Failure 0.01
CallSuperFirst::3 #1154 Call super onPause when there is no super 0.006
CallSuperLast::0 Success 0.005
CallSuperLast::1 Failure 0.005
CallSuperLast::2 #1154 Call super onPause when there is no super 0.007
DoNotHardCodeSDCard::0 basic /sdcard test 0.003

BasicRulesTest

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

BracesRulesTest

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

CloneRulesTest

CloneMethodMustBePublic::0 protected method clone 0.004
CloneMethodMustBePublic::1 protected method clone 2 0.004
CloneMethodMustBePublic::2 public method clone 0.004
CloneMethodMustBePublic::3 public method clone 2 0.004
CloneMethodMustBePublic::4 final class with protected clone method 0.003
CloneMethodMustBePublic::5 final class with public method 0.004
CloneMethodMustImplementCloneable::0 ok, implements Cloneable 0.004
CloneMethodMustImplementCloneable::1 bad, doesn't implement Cloneable 0.008
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.004
CloneMethodMustImplementCloneable::4 ok, inner class implements Cloneable 0.004
CloneMethodMustImplementCloneable::5 Bug 1698550, nr 1 0.004
CloneMethodMustImplementCloneable::6 Bug 1698550, nr 2 0.005
CloneMethodReturnTypeMustMatchClassName::0 protected method clone with Object as return type 0.004
CloneMethodReturnTypeMustMatchClassName::1 public method clone with Object as return type 0.004
CloneMethodReturnTypeMustMatchClassName::2 final class with public method clone 0.015
CloneMethodReturnTypeMustMatchClassName::3 final class with public method clone with Object as return type 0.008
CloneMethodReturnTypeMustMatchClassName::4 protected method clone with return type as the class name 0.009
CloneMethodReturnTypeMustMatchClassName::5 public method clone with return type as the class name 0.004
CloneThrowsCloneNotSupportedException::0 ok, throws CloneNotSupportedException 0.004
CloneThrowsCloneNotSupportedException::1 bad 0.004
CloneThrowsCloneNotSupportedException::2 final class, rule does not apply 0.004
CloneThrowsCloneNotSupportedException::3 testing with multiple methods 0.004
ProperCloneImplementation::0 ok, calls super.clone 0.004
ProperCloneImplementation::1 bad, Foo.clone() calls new Foo(); 0.004
ProperCloneImplementation::2 clone([whatever]) is fine 0.004
ProperCloneImplementation::3 bad, Foo.clone() calls new Foo(); 0.004

CodesizeRulesTest

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

AbstractCommentRuleTest

testCommentAssignments 0
testFilteredCommentIn 0

CommentRulesTest

CommentContent::0 Includes bad words 0.003
CommentDefaultAccessModifier::0 Some methods and Fields with default access modifier in a class 0.005
CommentDefaultAccessModifier::1 All methods and Field with default access modifier in a class 0.004
CommentDefaultAccessModifier::2 All methods and Field without default access modifier in a class 0.004
CommentDefaultAccessModifier::3 Methods with default access modifier in an Interface 0.004
CommentDefaultAccessModifier::4 Nested classes with default access modifier 0.005
CommentDefaultAccessModifier::5 Test own regex to default access modifier rule 0.004
CommentDefaultAccessModifier::6 Declarations inside an enum 0.003
CommentDefaultAccessModifier::7 #1430 CommentDefaultAccessModifier triggers on field annotated with @VisibleForTesting 0.003
CommentRequired::0 Missing comments - all required (default). 0.004
CommentRequired::1 All elements have javadoc comments. 0.003
CommentRequired::2 Missing comments - only class level required. 0.003
CommentRequired::3 Too many comments - all comments are unwanted. 0.003
CommentRequired::4 #1115 commentRequiredRule in pmd 5.1 is not working properly 0.003
CommentRequired::5 #1115 commentRequiredRule in pmd 5.1 is not working properly - without new lines 0.004
CommentRequired::6 #1289 CommentRequired not ignored if javadoc {@inheritDoc} anon inner classes 0.003
CommentRequired::7 #1434 CommentRequired raises violation on serialVersionUID field 0.004
CommentRequired::8 comment required on serialVersionUID of wrong type 0.004
CommentRequired::9 serialVersionUID comment required 0.005
CommentSize::0 Too many lines 0.003

ControversialRulesTest

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

CouplingRulesTest

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

DesignRulesTest

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

EmptyRulesTest

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

FinalizersRulesTest

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

ImportsRulesTest

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

J2EERulesTest

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

JavabeansRulesTest

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

JunitRulesTest

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

LoggingJakartaCommonsRulesTest

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

LoggingJavaRulesTest

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

MigratingRulesTest

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

NamingRulesTest

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

OptimizationsRulesTest

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

StrictExceptionRulesTest

AvoidCatchingGenericException::0 failure case 0.004
AvoidCatchingGenericException::1 catching another type, ok 0.003
AvoidCatchingGenericException::2 throwing it, ok 0.003
AvoidCatchingNPE::0 failure case 0.003
AvoidCatchingNPE::1 catching another type, ok 0.004
AvoidCatchingNPE::2 throwing it, ok 0.003
AvoidCatchingThrowable::0 simple failure case 0.004
AvoidCatchingThrowable::1 ok 0.009
AvoidLosingExceptionInformation::0 basic failure case 0
AvoidLosingExceptionInformation::1 fetch the value returned by getMessage(), ok 0.003
AvoidLosingExceptionInformation::2 fetch the value returned by getCause(), ok 0.004
AvoidLosingExceptionInformation::3 a mix of guilty calls to getMessage(), getLocalizedMessage(), getCause() or getStackTrace(), failure 0.003
AvoidLosingExceptionInformation::4 a larger mix of guilty calls to getMessage(), getLocalizedMessage(), getCause(), getStackTrace() or toString(), failure 0.005
AvoidRethrowingException::0 failure case 0.003
AvoidRethrowingException::1 doing something else before throwing it, ok 0.003
AvoidRethrowingException::2 throwing the return value of a method call on the exception, ok 0.003
AvoidRethrowingException::3 throwing a different exception, ok 0.003
AvoidThrowingNewInstanceOfSameException::0 basic failure case 0.004
AvoidThrowingNewInstanceOfSameException::1 do something else before throwing a new instance of the same exception, ok 0.004
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.003
AvoidThrowingNewInstanceOfSameException::4 throw new instance of the same exception with the same message, failure 0.003
AvoidThrowingNewInstanceOfSameException::5 throws a new instance of the same exception without any arguments, ok 0.004
AvoidThrowingNewInstanceOfSameException::6 throws a new instance of the same exception from a nested try/catch block, ok 0.004
AvoidThrowingNewInstanceOfSameException::7 wraps the exception in a new instance of the same exception from a nested try/catch block, ok 0.004
AvoidThrowingNullPointerException::0 throwing various types 0.003
AvoidThrowingRawExceptionTypes::0 throwing various types 0.004
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.002
DoNotExtendJavaLangError::0 Extends with fully qualified name 0.002
DoNotExtendJavaLangError::1 Extends with implicit import 0.002
DoNotExtendJavaLangError::2 Extends something else 0.001
DoNotThrowExceptionInFinally::0 classic failure case 0.003
ExceptionAsFlowControl::0 failure case 0.004
ExceptionAsFlowControl::1 normal throw catch 0.003
ExceptionAsFlowControl::2 BUG 996007 0.003
ExceptionAsFlowControl::3 NPE 0.003
SignatureDeclareThrowsException::0 method throws Exception 0.002
SignatureDeclareThrowsException::1 ok 0.002
SignatureDeclareThrowsException::2 constructor throws Exception 0.001
SignatureDeclareThrowsException::3 skip junit setUp method 0.004
SignatureDeclareThrowsException::4 skip junit tearDown method 0.003
SignatureDeclareThrowsException::5 Generics 0.003
SignatureDeclareThrowsException::6 skip any method starting with 'test' 0.003
SignatureDeclareThrowsException::7 #913 SignatureDeclareThrowsException is raised twice 0.005

AvoidDuplicateLiteralsRuleTest

testStringParserEmptyString 0
testStringParserEscapedEscapedChar 0
testStringParserSimple 0
testStringParserEscapedChar 0

StringsRulesTest

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

SunSecureRulesTest

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

CloneMethodMustImplementCloneableTest

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

LooseCouplingTest

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

SignatureDeclareThrowsExceptionTest

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

UnusedImportsTest

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

UnnecessaryRulesTest

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

UnusedCodeRulesTest

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

AcceptanceTest

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

ApplierTest

testSimple 0

ClassScopeTest

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

GlobalScopeTest

testEnums 0
testClassDeclAppears 0

ImageFinderFunctionTest

testSeveralImages 0
testSingleImage 0

LocalScopeTest

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

MethodNameDeclarationTest

testEquality 0

MethodScopeTest

testGenerics 0
testMethodName 0
testMethodParameterOccurrenceRecorded 0

NameOccurrencesTest

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

ScopeAndDeclarationFinderTest

testJava8LambdaScoping 0.001

ScopeCreationVisitorTest

testScopesAreCreated 0.003

SimpleTypedNameDeclarationTest

testEquals 0

SourceFileScopeTest

testPackageIsEmptyString 0
testNestedClasses 0
testClassDeclAppears 0
testPackageNameFound 0.001

TypeSetTest

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

VariableNameDeclarationTest

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

VariableUsageFinderFunctionTest

testLookingForUsed 0.001

ClassTypeResolverTest

testBinaryStringPromotion 0.026
testBinaryNumericOperators 0.007
testBinaryLogicalOperators 0.004
testUnaryNumericOperators 0.008
testUnaryLogicalOperators 0.007
testAssignmentOperators 0.005
testClassNameExists 0
testAnonymousInnerClass 0.003
testExtraTopLevelClass 0.002
testInnerClass 0.001
testBinaryNumericPromotion 0.028
testEnumAnonymousInnerClass 0.004
testUnaryNumericPromotion 0.039
acceptanceTest 0.003
testLiterals 0.006

PMDASMClassLoaderTest

testLoadClassWithImportOnDemand 0.001
testClassWithImportInnerOnDemand 0.002
testCachingOfNotFoundClasses 0.001

Failure Details

[Summary] [Package List] [Test Cases]


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
ConsecutiveLiteralAppends::44 43, Using variable char array
skipped: skipped
net.sourceforge.pmd.lang.java.rule.typeresolution.xml.MyTestCase
skipped: skipped
UselessOverridingMethod::19 False +: Overriding method merely calls super (see bug 1415525)
skipped: skipped
UnusedPrivateMethod::21 #46 False +: Unused private field: call to instance of self, received from another class
skipped: skipped