PMD Results

The following document contains the results of PMD 7.17.0.

Violations By Priority

Priority 2

org/codehaus/plexus/util/SelectorUtils.java

Rule Violation Line
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 365
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 469
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 623

Priority 3

org/codehaus/plexus/util/Base64.java

Rule Violation Line
CollapsibleIfStatements This if statement could be combined with its parent 296301
CollapsibleIfStatements This if statement could be combined with its parent 334341

org/codehaus/plexus/util/CollectionUtils.java

Rule Violation Line
EmptyCatchBlock Avoid empty catch blocks 207208

org/codehaus/plexus/util/Expand.java

Rule Violation Line
EmptyControlStatement Empty for statement 144147

org/codehaus/plexus/util/FileUtils.java

Rule Violation Line
CollapsibleIfStatements This if statement could be combined with its parent 12961300

org/codehaus/plexus/util/NioFiles.java

Rule Violation Line
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 49
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 52
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 55
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 59
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 62
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 65

org/codehaus/plexus/util/PathTool.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'final' on method 'determineRelativePath': private methods cannot be overridden 329
UnnecessaryModifier Unnecessary modifier 'final' on method 'determineSeparator': private methods cannot be overridden 365
UnnecessaryModifier Unnecessary modifier 'final' on method 'buildRelativePath': private methods cannot be overridden 388

org/codehaus/plexus/util/SelectorUtils.java

Rule Violation Line
CollapsibleIfStatements This if statement could be combined with its parent 653656

org/codehaus/plexus/util/StringUtils.java

Rule Violation Line
UnusedLocalVariable Avoid unused local variables such as 'sz'. 283
CollapsibleIfStatements This if statement could be combined with its parent 10031005

org/codehaus/plexus/util/SweeperPool.java

Rule Violation Line
EmptyCatchBlock Avoid empty catch blocks 253254
UnnecessaryModifier Unnecessary modifier 'final' on method 'debug': private methods cannot be overridden 285

org/codehaus/plexus/util/TypeFormat.java

Rule Violation Line
SimplifiedTernary This conditional expression can be simplified with || or && 124
SimplifiedTernary This conditional expression can be simplified with || or && 172
SimplifiedTernary This conditional expression can be simplified with || or && 220
SimplifiedTernary This conditional expression can be simplified with || or && 273
SimplifiedTernary This conditional expression can be simplified with || or && 310
EmptyControlStatement Empty for statement 408
EmptyControlStatement Empty for statement 488
UnnecessaryModifier Unnecessary modifier 'final' on method 'multE': private methods cannot be overridden 757

org/codehaus/plexus/util/cli/ShutdownHookUtils.java

Rule Violation Line
EmptyCatchBlock Avoid empty catch blocks 3233
EmptyCatchBlock Avoid empty catch blocks 3334
EmptyCatchBlock Avoid empty catch blocks 4041
EmptyCatchBlock Avoid empty catch blocks 4142

org/codehaus/plexus/util/cli/StreamConsumer.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'consumeLine': the method is declared in an interface type 73

org/codehaus/plexus/util/cli/StreamPumper.java

Rule Violation Line
SimplifiedTernary This conditional expression can be simplified with || or && 119

org/codehaus/plexus/util/introspection/ClassMap.java

Rule Violation Line
UnusedLocalVariable Avoid unused local variables such as 'methodKey'. 118

org/codehaus/plexus/util/io/CachingOutputStream.java

Rule Violation Line
UnusedPrivateField Avoid unused private fields such as 'path'. 34

Priority 4

org/codehaus/plexus/util/Base64.java

Rule Violation Line
UselessParentheses Useless parentheses around `b1`. 282
UselessParentheses Useless parentheses around `b2`. 283
UselessParentheses Useless parentheses around `b3`. 284
UselessParentheses Useless parentheses around `b1`. 311
UselessParentheses Useless parentheses around `b1`. 323
UselessParentheses Useless parentheses around `b2`. 324

org/codehaus/plexus/util/CollectionUtils.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'CollectionUtils': 'subtract' is already in scope 73
UnnecessaryFullyQualifiedName Unnecessary qualifier 'CollectionUtils': 'intersection' is already in scope 74

org/codehaus/plexus/util/DirectoryWalker.java

Rule Violation Line
UselessParentheses Useless parentheses around `percentageSize / count`. 86

org/codehaus/plexus/util/ExceptionUtils.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ExceptionUtils': 'getCause' is already in scope 292
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ExceptionUtils': 'getThrowables' is already in scope 346

org/codehaus/plexus/util/FastMap.java

Rule Violation Line
UselessParentheses Useless parentheses around `entry.getValue()`. 578
UselessParentheses Useless parentheses around `_key.equals(entry.getKey())`. 939

org/codehaus/plexus/util/FileUtils.java

Rule Violation Line
UselessParentheses Useless parentheses around `i >= 0 ? filename.substring(0, i) : ""`. 201
UselessParentheses Useless parentheses around `i >= 0 ? filename.substring(i + 1) : filename`. 212
UselessParentheses Useless parentheses around `new File(baseFile, filenm)`. 1148
UnnecessaryFullyQualifiedName Unnecessary qualifier 'FileUtils': 'FS' is already in scope because it is declared in an enclosing type 1590
UnnecessaryFullyQualifiedName Unnecessary qualifier 'FileUtils': 'FS' is already in scope because it is declared in an enclosing type 1602

org/codehaus/plexus/util/Os.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'Os': 'isFamily' is already in scope 344
UselessParentheses Useless parentheses around `validFamilies.contains(theFamily)`. 372

org/codehaus/plexus/util/PathTool.java

Rule Violation Line
UselessParentheses Useless parentheses around `toPath.startsWith(":", 1) && fromPath.startsWit...`. 293

org/codehaus/plexus/util/SelectorUtils.java

Rule Violation Line
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 351
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 352
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 455
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 456
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 610
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 611

org/codehaus/plexus/util/StringUtils.java

Rule Violation Line
UselessParentheses Useless parentheses around `str == null ? "" : str.trim()`. 111
UselessParentheses Useless parentheses around `str == null ? null : str.trim()`. 125
UselessParentheses Useless parentheses around `(str != null) && (!str.isEmpty())`. 157
UselessParentheses Useless parentheses around `(str == null) || str.isEmpty()`. 171
UselessParentheses Useless parentheses around `str.isEmpty()`. 171
UnnecessaryFullyQualifiedName Unnecessary qualifier 'StringUtils': 'isBlank' is already in scope 222
UselessParentheses Useless parentheses around `str1 == null ? str2 == null : str1.equalsIgnore...`. 263
UselessParentheses Useless parentheses around `arraySize == 0 ? 0 : (array[0].toString().lengt...`. 616
UselessParentheses Useless parentheses around `Character.isWhitespace(str.charAt(i)) == false`. 1659
UselessParentheses Useless parentheses around `maxWidth - 3`. 1933

org/codehaus/plexus/util/TypeFormat.java

Rule Violation Line
UselessParentheses Useless parentheses around `isNegative`. 126
UselessParentheses Useless parentheses around `isNegative`. 174
UselessParentheses Useless parentheses around `isNegative`. 222
UselessParentheses Useless parentheses around `c - '0'`. 294
UselessParentheses Useless parentheses around `c - '0'`. 316
UnnecessaryFullyQualifiedName Unnecessary qualifier 'java.lang': 'IllegalArgumentException' is already in scope because it is declared in java.lang 628

org/codehaus/plexus/util/cli/CommandLineUtils.java

Rule Violation Line
DontCallThreadRun Dont call Thread.run() explicitly, use Thread.start() 244

Files

org/codehaus/plexus/util/Base64.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `b1`. 4 282
UselessParentheses Useless parentheses around `b2`. 4 283
UselessParentheses Useless parentheses around `b3`. 4 284
CollapsibleIfStatements This if statement could be combined with its parent 3 296301
UselessParentheses Useless parentheses around `b1`. 4 311
UselessParentheses Useless parentheses around `b1`. 4 323
UselessParentheses Useless parentheses around `b2`. 4 324
CollapsibleIfStatements This if statement could be combined with its parent 3 334341

org/codehaus/plexus/util/CollectionUtils.java

Rule Violation Priority Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'CollectionUtils': 'subtract' is already in scope 4 73
UnnecessaryFullyQualifiedName Unnecessary qualifier 'CollectionUtils': 'intersection' is already in scope 4 74
EmptyCatchBlock Avoid empty catch blocks 3 207208

org/codehaus/plexus/util/DirectoryWalker.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `percentageSize / count`. 4 86

org/codehaus/plexus/util/ExceptionUtils.java

Rule Violation Priority Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ExceptionUtils': 'getCause' is already in scope 4 292
UnnecessaryFullyQualifiedName Unnecessary qualifier 'ExceptionUtils': 'getThrowables' is already in scope 4 346

org/codehaus/plexus/util/Expand.java

Rule Violation Priority Line
EmptyControlStatement Empty for statement 3 144147

org/codehaus/plexus/util/FastMap.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `entry.getValue()`. 4 578
UselessParentheses Useless parentheses around `_key.equals(entry.getKey())`. 4 939

org/codehaus/plexus/util/FileUtils.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `i >= 0 ? filename.substring(0, i) : ""`. 4 201
UselessParentheses Useless parentheses around `i >= 0 ? filename.substring(i + 1) : filename`. 4 212
UselessParentheses Useless parentheses around `new File(baseFile, filenm)`. 4 1148
CollapsibleIfStatements This if statement could be combined with its parent 3 12961300
UnnecessaryFullyQualifiedName Unnecessary qualifier 'FileUtils': 'FS' is already in scope because it is declared in an enclosing type 4 1590
UnnecessaryFullyQualifiedName Unnecessary qualifier 'FileUtils': 'FS' is already in scope because it is declared in an enclosing type 4 1602

org/codehaus/plexus/util/NioFiles.java

Rule Violation Priority Line
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 49
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 52
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 55
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 59
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 62
AvoidUsingOctalValues Avoid integer literals that start with zero (interpreted as octal), remove the leading 0 to get a decimal literal (or use explicit 0x, 0b prefixes) 3 65

org/codehaus/plexus/util/Os.java

Rule Violation Priority Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'Os': 'isFamily' is already in scope 4 344
UselessParentheses Useless parentheses around `validFamilies.contains(theFamily)`. 4 372

org/codehaus/plexus/util/PathTool.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `toPath.startsWith(":", 1) && fromPath.startsWit...`. 4 293
UnnecessaryModifier Unnecessary modifier 'final' on method 'determineRelativePath': private methods cannot be overridden 3 329
UnnecessaryModifier Unnecessary modifier 'final' on method 'determineSeparator': private methods cannot be overridden 3 365
UnnecessaryModifier Unnecessary modifier 'final' on method 'buildRelativePath': private methods cannot be overridden 3 388

org/codehaus/plexus/util/SelectorUtils.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 4 351
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 4 352
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 2 365
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 4 455
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 4 456
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 2 469
UselessParentheses Useless parentheses around `patIdxTmp - patIdxStart - 1`. 4 610
UselessParentheses Useless parentheses around `strIdxEnd - strIdxStart + 1`. 4 611
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 2 623
CollapsibleIfStatements This if statement could be combined with its parent 3 653656

org/codehaus/plexus/util/StringUtils.java

Rule Violation Priority Line
UselessParentheses Useless parentheses around `str == null ? "" : str.trim()`. 4 111
UselessParentheses Useless parentheses around `str == null ? null : str.trim()`. 4 125
UselessParentheses Useless parentheses around `(str != null) && (!str.isEmpty())`. 4 157
UselessParentheses Useless parentheses around `(str == null) || str.isEmpty()`. 4 171
UselessParentheses Useless parentheses around `str.isEmpty()`. 4 171
UnnecessaryFullyQualifiedName Unnecessary qualifier 'StringUtils': 'isBlank' is already in scope 4 222
UselessParentheses Useless parentheses around `str1 == null ? str2 == null : str1.equalsIgnore...`. 4 263
UnusedLocalVariable Avoid unused local variables such as 'sz'. 3 283
UselessParentheses Useless parentheses around `arraySize == 0 ? 0 : (array[0].toString().lengt...`. 4 616
CollapsibleIfStatements This if statement could be combined with its parent 3 10031005
UselessParentheses Useless parentheses around `Character.isWhitespace(str.charAt(i)) == false`. 4 1659
UselessParentheses Useless parentheses around `maxWidth - 3`. 4 1933

org/codehaus/plexus/util/SweeperPool.java

Rule Violation Priority Line
EmptyCatchBlock Avoid empty catch blocks 3 253254
UnnecessaryModifier Unnecessary modifier 'final' on method 'debug': private methods cannot be overridden 3 285

org/codehaus/plexus/util/TypeFormat.java

Rule Violation Priority Line
SimplifiedTernary This conditional expression can be simplified with || or && 3 124
UselessParentheses Useless parentheses around `isNegative`. 4 126
SimplifiedTernary This conditional expression can be simplified with || or && 3 172
UselessParentheses Useless parentheses around `isNegative`. 4 174
SimplifiedTernary This conditional expression can be simplified with || or && 3 220
UselessParentheses Useless parentheses around `isNegative`. 4 222
SimplifiedTernary This conditional expression can be simplified with || or && 3 273
UselessParentheses Useless parentheses around `c - '0'`. 4 294
SimplifiedTernary This conditional expression can be simplified with || or && 3 310
UselessParentheses Useless parentheses around `c - '0'`. 4 316
EmptyControlStatement Empty for statement 3 408
EmptyControlStatement Empty for statement 3 488
UnnecessaryFullyQualifiedName Unnecessary qualifier 'java.lang': 'IllegalArgumentException' is already in scope because it is declared in java.lang 4 628
UnnecessaryModifier Unnecessary modifier 'final' on method 'multE': private methods cannot be overridden 3 757

org/codehaus/plexus/util/cli/CommandLineUtils.java

Rule Violation Priority Line
DontCallThreadRun Dont call Thread.run() explicitly, use Thread.start() 4 244

org/codehaus/plexus/util/cli/ShutdownHookUtils.java

Rule Violation Priority Line
EmptyCatchBlock Avoid empty catch blocks 3 3233
EmptyCatchBlock Avoid empty catch blocks 3 3334
EmptyCatchBlock Avoid empty catch blocks 3 4041
EmptyCatchBlock Avoid empty catch blocks 3 4142

org/codehaus/plexus/util/cli/StreamConsumer.java

Rule Violation Priority Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'consumeLine': the method is declared in an interface type 3 73

org/codehaus/plexus/util/cli/StreamPumper.java

Rule Violation Priority Line
SimplifiedTernary This conditional expression can be simplified with || or && 3 119

org/codehaus/plexus/util/introspection/ClassMap.java

Rule Violation Priority Line
UnusedLocalVariable Avoid unused local variables such as 'methodKey'. 3 118

org/codehaus/plexus/util/io/CachingOutputStream.java

Rule Violation Priority Line
UnusedPrivateField Avoid unused private fields such as 'path'. 3 34