Fork me on GitHub

Surefire Report

Summary

[Summary] [Package List] [Test Cases]


Tests Errors Failures Skipped Success Rate Time
2395 0 0 5 99.791% 37.529

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.003
net.sourceforge.pmd.lang.java.rule.strings 211 0 0 1 99.526% 0.54
net.sourceforge.pmd.lang.java.rule.naming 110 0 0 0 100% 0.227
net.sourceforge.pmd.lang.java.rule.optimizations 94 0 0 0 100% 0.22
net.sourceforge.pmd.lang.java.rule.clone 15 0 0 0 100% 0.042
net.sourceforge.pmd.lang.java.rule.loggingjakartacommons 23 0 0 0 100% 0.063
net.sourceforge.pmd.jaxen 12 0 0 0 100% 0.035
net.sourceforge.pmd.lang.java.symboltable 96 0 0 0 100% 0.004
net.sourceforge.pmd.lang.java.rule.comments 11 0 0 0 100% 0.017
net.sourceforge.pmd.lang.java.ast 140 0 0 0 100% 0.123
net.sourceforge.pmd.lang.java.rule.unnecessary 77 0 0 1 98.701% 0.151
net.sourceforge.pmd.lang.java.rule 6 0 0 0 100% 0.008
net.sourceforge.pmd.cli 10 0 0 0 100% 1.013
net.sourceforge.pmd.lang.java.rule.migrating 36 0 0 0 100% 0.062
net.sourceforge.pmd.lang.java.rule.braces 17 0 0 0 100% 0.021
net.sourceforge.pmd.lang.java.rule.android 8 0 0 0 100% 0.035
net.sourceforge.pmd.lang.java.rule.unusedcode 150 0 0 1 99.333% 0.31
net.sourceforge.pmd.lang.java.rule.strictexception 45 0 0 0 100% 0.08
net.sourceforge.pmd.lang.java.rule.empty 43 0 0 0 100% 0.077
net.sourceforge.pmd.ant 10 0 0 0 100% 3.079
net.sourceforge.pmd.lang.java.rule.codesize 70 0 0 0 100% 0.198
net.sourceforge.pmd.lang.java.rule.junit 107 0 0 0 100% 0.19
net.sourceforge.pmd.lang.java.rule.imports 68 0 0 0 100% 0.136
net.sourceforge.pmd.lang.java.rule.typeresolution.xml 1 0 0 1 0% 0
net.sourceforge.pmd.lang.java.rule.controversial 112 0 0 0 100% 0.33
net.sourceforge.pmd 30 0 0 0 100% 2.567
net.sourceforge.pmd.lang.java.rule.finalizers 19 0 0 0 100% 0.025
net.sourceforge.pmd.lang.java.rule.javabeans 23 0 0 0 100% 0.028
net.sourceforge.pmd.coverage 2 0 0 0 100% 20.815
net.sourceforge.pmd.lang.java.rule.loggingjava 22 0 0 0 100% 0.031
net.sourceforge.pmd.lang.java.rule.sunsecure 27 0 0 0 100% 0.042
net.sourceforge.pmd.lang.java.rule.coupling 42 0 0 0 100% 0.129
net.sourceforge.pmd.lang.java.rule.typeresolution 51 0 0 0 100% 0.086
net.sourceforge.pmd.lang.java.rule.basic 157 0 0 0 100% 2.21
net.sourceforge.pmd.lang.java 17 0 0 0 100% 0.021
net.sourceforge.pmd.lang.java.rule.j2ee 25 0 0 0 100% 0.033
net.sourceforge.pmd.lang.java.rule.design 424 0 0 1 99.764% 4.463
net.sourceforge.pmd.lang.java.dfa 47 0 0 0 100% 0.067
net.sourceforge.pmd.cpd 19 0 0 0 100% 0.048

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.003
PMDASMClassLoaderTest 3 0 0 0 100% 0

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

Class Tests Errors Failures Skipped Success Rate Time
AvoidDuplicateLiteralsRuleTest 5 0 0 0 100% 0.025
StringsRulesTest 206 0 0 1 99.515% 0.515

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

Class Tests Errors Failures Skipped Success Rate Time
NamingRulesTest 110 0 0 0 100% 0.227

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

Class Tests Errors Failures Skipped Success Rate Time
OptimizationsRulesTest 94 0 0 0 100% 0.22

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

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

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

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

net.sourceforge.pmd.jaxen

Class Tests Errors Failures Skipped Success Rate Time
DocumentNavigatorTest 11 0 0 0 100% 0.033
RegexpAcceptanceTest 1 0 0 0 100% 0.002

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.004
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
ScopeAndDeclarationFinderTest 1 0 0 0 100% 0
ScopeCreationVisitorTest 1 0 0 0 100% 0
SimpleTypedNameDeclarationTest 1 0 0 0 100% 0
SourceFileScopeTest 4 0 0 0 100% 0
TypeSetTest 26 0 0 0 100% 0
VariableNameDeclarationTest 8 0 0 0 100% 0
VariableUsageFinderFunctionTest 1 0 0 0 100% 0

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

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

net.sourceforge.pmd.lang.java.ast

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

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

Class Tests Errors Failures Skipped Success Rate Time
UnnecessaryRulesTest 77 0 0 1 98.701% 0.151

net.sourceforge.pmd.lang.java.rule

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

net.sourceforge.pmd.cli

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

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

Class Tests Errors Failures Skipped Success Rate Time
MigratingRulesTest 36 0 0 0 100% 0.062

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

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
UnusedCodeRulesTest 150 0 0 1 99.333% 0.31

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

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

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

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

net.sourceforge.pmd.ant

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
JunitRulesTest 107 0 0 0 100% 0.19

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

Class Tests Errors Failures Skipped Success Rate Time
ImportsRulesTest 68 0 0 0 100% 0.136

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 112 0 0 0 100% 0.33

net.sourceforge.pmd

Class Tests Errors Failures Skipped Success Rate Time
ExcludeLinesTest 2 0 0 0 100% 0.187
LanguageVersionDiscovererTest 3 0 0 0 100% 0
LanguageVersionTest 14 0 0 0 100% 0.004
ReportTest 6 0 0 0 100% 0.079
RuleSetFactoryTest 5 0 0 0 100% 2.297

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

Class Tests Errors Failures Skipped Success Rate Time
FinalizersRulesTest 19 0 0 0 100% 0.025

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

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

net.sourceforge.pmd.coverage

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

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

Class Tests Errors Failures Skipped Success Rate Time
LoggingJavaRulesTest 22 0 0 0 100% 0.031

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

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
CloneMethodMustImplementCloneableTest 12 0 0 0 100% 0.016
LooseCouplingTest 12 0 0 0 100% 0.022
SignatureDeclareThrowsExceptionTest 12 0 0 0 100% 0.019
UnusedImportsTest 15 0 0 0 100% 0.029

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

Class Tests Errors Failures Skipped Success Rate Time
BasicRulesTest 157 0 0 0 100% 2.21

net.sourceforge.pmd.lang.java

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

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

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

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

Class Tests Errors Failures Skipped Success Rate Time
DesignRulesTest 424 0 0 1 99.764% 4.463

net.sourceforge.pmd.lang.java.dfa

Class Tests Errors Failures Skipped Success Rate Time
AcceptanceTest 31 0 0 0 100% 0.06
DAAPathFinderTest 1 0 0 0 100% 0.001
DataFlowNodeTest 5 0 0 0 100% 0
GeneralFiddlingTest 2 0 0 0 100% 0
StatementAndBraceFinderTest 6 0 0 0 100% 0.006
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 6 0 0 0 100% 0.045
JavaTokensTokenizerTest 11 0 0 0 100% 0.002
MatchAlgorithmTest 2 0 0 0 100% 0.001

Test Cases

[Summary] [Package List] [Test Cases]

ExcludeLinesTest

testAcceptance 0.175
testAlternateMarker 0.012

LanguageVersionDiscovererTest

testLanguageVersionDiscoverer 0
testJavaFileUsingDefaults 0
testJavaFileUsing14 0

LanguageVersionTest

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

ReportTest

testBasic 0.003
testExclusionsInReportWithAnnotationsFullName 0.013
testExclusionsInReportWithNOPMD 0.002
testExclusionsInReportWithRuleViolationSuppressRegex 0.002
testExclusionsInReportWithRuleViolationSuppressXPath 0.056
testExclusionsInReportWithAnnotations 0.003

RuleSetFactoryTest

testExclusionOfUselessParantheses 0.172
testDtd 0.281
testXmlSchema 0.268
testReadWriteRoundTrip 1.448
testAllPMDBuiltInRulesMeetConventions 0.128

PMDTaskTest

testExplicitRuleInRuleSet 0.503
testAbstractNames 0.821
testAbstractNamesInNestedRuleset 0.524
testRelativeRulesetsInRulesetfiles 0.26
testNoFormattersValidation 0.152
testCommaInRulesetfiles 0.169
testClasspath 0.066
testRelativeRulesets 0.185
testNestedRuleset 0.167
testFormatterWithProperties 0.232

CLITest

changeJavaVersion 0.246
exitStatusNoViolations 0.209
minimalArgs 0.21
testWrongRulename 0.027
testWrongRulesetWithRulename 0.014
usingDebug 0.172
testWrongRuleset 0.01
exitStatusWithViolations 0.029
minimumPriority 0.083

XPathCLITest

runXPath 0.013

PMDCoverageTest

testPmdOptions 5.779
testResourceFileCommands 15.036

CPDCommandLineInterfaceTest

testEncodingOption 0.024
testExcludes 0.003
testIgnoreIdentifiers 0.006
testFormatXmlWithoutEncoding 0.005
testBrokenAndValidFile 0.004
testCSVFormat 0.003

JavaTokensTokenizerTest

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

MatchAlgorithmTest

testIgnore 0.001
testSimple 0

DocumentNavigatorTest

testPrecedingSiblingAxisIterator2 0.003
testFollowingSiblingAxisIterator2 0.002
testXPath 0.003
testDescendantAxisIterator2 0.004
testFollowingSiblingAxisIterator 0.003
testPrecedingSiblingAxisIterator 0.005
testParentAxisIterator2 0.002
testParentAxisIterator 0.003
testXPath2 0.003
testDescendantAxisIterator 0.002
testChildAxisIterator 0.003

RegexpAcceptanceTest

testSimple 0.002

SuppressWarningsTest

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

ASTAnnotationTest

testAnnotationFailsWithJDK14 0
testAnnotationSucceedsWithJDK15 0.025
testAnnotationSucceedsWithDefaultMode 0.001

ASTAssignmentOperatorTest

testSimpleAssignmentRecognized 0.002
testCompoundAssignmentPlusRecognized 0.002
testCompoundAssignmentMultRecognized 0.002

ASTBlockStatementTest

testIsAllocation 0
testIsAllocation2 0

ASTBooleanLiteralTest

testFalse 0.001
testTrue 0

ASTFieldDeclarationTest

testWithEnum 0
testGetVariableName 0
testMultiDimensionalArray 0
testIsArray 0
testIsSyntacticallyPublic 0

ASTFormalParameterTest

testVarargs 0

ASTImportDeclarationTest

testStaticImportFailsWithJDK14 0.001
testGetImportedNameNode 0
testImportOnDemand 0
testStaticImport 0.001

ASTInitializerTest

testDontCrashOnBlockStatement 0

ASTLiteralTest

testIsStringLiteral 0.001
testIsFloatFloatLiteral 0
testIsNotStringLiteral 0
testIsCharLiteral 0
testIsIntIntLiteral 0.001
testIsIntLongLiteral 0
testIsFloatDoubleLiteral 0.001

ASTLocalVariableDeclarationTest

testMultDimArraySplitBraces 0
testSingleDimArray 0
testMultDimArray 0

ASTMethodDeclarationTest

testGetVariableName 0

ASTPackageDeclarationTest

testPackageName 0

ASTPrimarySuffixTest

testArrayDereference 0
testArguments 0

ASTSwitchLabelTest

testDefaultOff 0.001
testDefaultSet 0

ASTThrowStatementTest

testGetFirstASTNameImageNull 0
testGetFirstASTNameImageNew 0.001

ASTVariableDeclaratorIdTest

testAnnotations 0
testLambdaWithoutType 0.001
testIsExceptionBlockParameter 0
testTypeNameNode 0.001
testLambdaWithType 0

AccessNodeTest

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

ClassDeclTest

testAbstract 0.001
testPublicFinal 0
testFinal 0.001
testPublic 0
testStrict 0.002

EncodingTest

testDecodingOfUTF8 0

FieldDeclTest

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

JDKVersionTest

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

MethodDeclTest

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

ParserCornersTest

testInnerOuterClass 0.001
testGenericsProblem 0.001
testLambdaBug1333 0.003
testGetFirstASTNameImageNull 0
testParsersCases 0.038
emptyFileJustComment 0
testMultipleExceptionCatching 0.001
testCastLookaheadProblem 0.001

SimpleNodeTest

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

AcceptanceTest

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

DAAPathFinderTest

testTwoUpdateDefs 0.001

DataFlowNodeTest

testRemovePathWithNonChild 0
testAddPathToChild 0
testRemovePathToChild 0
testSetType 0
testReverseParentPathsTo 0

GeneralFiddlingTest

test1 0
innerClassShouldWork 0

StatementAndBraceFinderTest

testWhileStmtHasCorrectTypes 0
testForStmtHasCorrectTypes 0
testOnlyWorksForMethodsAndConstructors 0
testStatementExpressionParentChildLinks 0.001
testVariableDeclaratorParentChildLinks 0.001
testIfStmtHasCorrectTypes 0.004

StructureTest

testAddResultsinDFANodeContainingAddedNode 0

VariableAccessTest

testGetVariableName 0

JavaRuleViolationTest

testMethodName 0
testASTFormalParameterVariableName 0

XPathRuleTest

testFollowingSibling 0
testPluginname 0.002
testImageOfPrimarySuffix 0.005
testVariables 0.001

AndroidRulesTest

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

BasicRulesTest

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

BracesRulesTest

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

CloneRulesTest

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

CodesizeRulesTest

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

AbstractCommentRuleTest

testCommentAssignments 0
testFilteredCommentIn 0

CommentRulesTest

CommentContent::0 Includes bad words 0
CommentRequired::0 Missing comments - all required (default). 0.001
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.002
CommentRequired::4 #1115 commentRequiredRule in pmd 5.1 is not working properly 0.002
CommentRequired::5 #1115 commentRequiredRule in pmd 5.1 is not working properly - without new lines 0.002
CommentRequired::6 #1289 CommentRequired not ignored if javadoc {@inheritDoc} anon inner classes 0.002
CommentSize::0 Too many lines 0.002

ControversialRulesTest

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

CouplingRulesTest

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

DesignRulesTest

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

EmptyRulesTest

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

FinalizersRulesTest

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

ImportsRulesTest

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

J2EERulesTest

DoNotCallSystemExit::0 basic violations 0.002
DoNotCallSystemExit::1 ok 0.001
DoNotCallSystemExit::2 basic violations with Runtime 0.002
DoNotUseThreads::0 Having thread in a type name is doubtfull but allowed 0.001
DoNotUseThreads::1 extending threads is not allowed 0.001
DoNotUseThreads::2 implementing runnabel is not allowed 0.001
DoNotUseThreads::3 Use of runnable is also not allowed 0.001
LocalHomeNamingConvention::0 Bad suffix 0.002
LocalHomeNamingConvention::1 Good suffix 0.001
LocalInterfaceSessionNamingConvention::0 Bad suffix 0.001
LocalInterfaceSessionNamingConvention::1 Good suffix 0.001
MDBAndSessionBeanNamingConvention::0 Bad SessionBean name 0.001
MDBAndSessionBeanNamingConvention::1 Bad MessageDrivenBean name 0.001
MDBAndSessionBeanNamingConvention::2 Good SessionBean name 0.001
MDBAndSessionBeanNamingConvention::3 Good MessageDrivenBean name 0.007
RemoteInterfaceNamingConvention::0 Bad Session suffix 0
RemoteInterfaceNamingConvention::1 Bad EJB suffix 0
RemoteInterfaceNamingConvention::2 Bad Bean suffix 0
RemoteInterfaceNamingConvention::3 Good suffix 0
RemoteSessionInterfaceNamingConvention::0 Bad EJBHome name 0
RemoteSessionInterfaceNamingConvention::1 Good EJBHome name 0.004
StaticEJBFieldShouldBeFinal::0 Good practice 0.001
StaticEJBFieldShouldBeFinal::1 Bad example 0.001
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.001
BeanMembersShouldSerialize::3 getter, no setter 0.001
BeanMembersShouldSerialize::4 setter, no getter 0.001
BeanMembersShouldSerialize::5 both accessors, yay! 0.001
BeanMembersShouldSerialize::6 setFoo and isFoo is OK for booleans 0.001
BeanMembersShouldSerialize::7 setFoo and isFoo is not OK for Strings 0.002
BeanMembersShouldSerialize::8 prefix is off by default 0.001
BeanMembersShouldSerialize::9 valid prefix 0.001
BeanMembersShouldSerialize::10 invalid prefix 0.002
BeanMembersShouldSerialize::11 interface 0.001
BeanMembersShouldSerialize::12 @SuppressWarnings("serial") 0.001
BeanMembersShouldSerialize::13 ClassCastException on generic method 0.002
BeanMembersShouldSerialize::14 #881 private final without setter is flagged 0.001
MissingSerialVersionUID::0 Happy case 0.001
MissingSerialVersionUID::1 Simple failure case 0.001
MissingSerialVersionUID::2 failure using java.io.Serializable 0.001
MissingSerialVersionUID::3 implements Serializable and provides a serialVersionUID 0.001
MissingSerialVersionUID::4 TEST5 0.003
MissingSerialVersionUID::5 interface 0
MissingSerialVersionUID::6 abstract case 0.001
MissingSerialVersionUID::7 @SuppressWarnings("serial") 0.001

JunitRulesTest

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

LoggingJakartaCommonsRulesTest

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

LoggingJavaRulesTest

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

MigratingRulesTest

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

NamingRulesTest

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

OptimizationsRulesTest

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

StrictExceptionRulesTest

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

AvoidDuplicateLiteralsRuleTest

testAll 0.025
testStringParserEmptyString 0
testStringParserEscapedEscapedChar 0
testStringParserSimple 0
testStringParserEscapedChar 0

StringsRulesTest

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

SunSecureRulesTest

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

CloneMethodMustImplementCloneableTest

CloneMethodMustImplementCloneable::0 ok, implements Cloneable 0
CloneMethodMustImplementCloneable::1 bad, doesn't implement Cloneable 0.002
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.001
CloneMethodMustImplementCloneable::4 ok, inner class implements Cloneable 0.002
CloneMethodMustImplementCloneable::5 ok, implements interface in same package which extends Cloneable 0.001
CloneMethodMustImplementCloneable::6 ok, implements interface imported implicitly which extends Cloneable 0.002
CloneMethodMustImplementCloneable::7 ok, implements interface which extends Cloneable 0.001
CloneMethodMustImplementCloneable::8 ok, extends superclass AND implements cloneable 0.002
CloneMethodMustImplementCloneable::9 Bug 1698550, nr 1 0.002
CloneMethodMustImplementCloneable::10 Bug 1698550, nr 2 0.001
CloneMethodMustImplementCloneable::11 Bug 1765613, NullPointerException on enum 0.001

LooseCouplingTest

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

SignatureDeclareThrowsExceptionTest

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

UnusedImportsTest

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

UnnecessaryRulesTest

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

UnusedCodeRulesTest

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

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
testEnumsClassScope 0
testContains 0
testMethodUsageSeen2 0.001
testContainsStaticVariablePrefixedWithClassName 0
testNestedClassDeclFound 0
testTwoParams 0
testClassName 0
testMethodUsageSeen 0
testTwoMethodsSameNameDiffArgs 0.003
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
testThis 0
testSimpleVariableOccurrence 0
testNameLinkage 0
testIsSelfAssignment 0
testEnumStaticUsage 0

ScopeAndDeclarationFinderTest

testJava8LambdaScoping 0

ScopeCreationVisitorTest

testScopesAreCreated 0

SimpleTypedNameDeclarationTest

testEquals 0

SourceFileScopeTest

testPackageIsEmptyString 0
testNestedClasses 0
testClassDeclAppears 0
testPackageNameFound 0

TypeSetTest

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

VariableNameDeclarationTest

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

VariableUsageFinderFunctionTest

testLookingForUsed 0

ClassTypeResolverTest

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

PMDASMClassLoaderTest

testLoadClassWithImportOnDemand 0
testClassWithImportInnerOnDemand 0
testCachingOfNotFoundClasses 0

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