Apache Commons logo Apache Commons RNG

PMD Results

The following document contains the results of PMD 7.23.0.

Violations By Priority

Priority 1

org/apache/commons/rng/examples/stress/ListCommand.java

Rule Violation Line
ReturnEmptyCollectionRatherThanNull Return an empty collection rather than null. 281

Priority 2

org/apache/commons/rng/examples/stress/BridgeTestCommand.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 142
GuardLogStatement Logger calls should be surrounded by log level guards. 146

org/apache/commons/rng/examples/stress/EndianessCommand.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 46

org/apache/commons/rng/examples/stress/ExamplesStressApplication.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 84
GuardLogStatement Logger calls should be surrounded by log level guards. 86

org/apache/commons/rng/examples/stress/ResultsCommand.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 876

org/apache/commons/rng/examples/stress/StressTestCommand.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 360
GuardLogStatement Logger calls should be surrounded by log level guards. 401
GuardLogStatement Logger calls should be surrounded by log level guards. 704

Priority 3

org/apache/commons/rng/examples/stress/AlphaNumericComparator.java

Rule Violation Line
PublicMemberInNonPublicType Public member 'INSTANCE' declared in a non-public type 56
UnusedAssignment The initializer for variable 'result' is never used (overwritten on lines 90 and 92) 88

org/apache/commons/rng/examples/stress/ListCommand.java

Rule Violation Line
RedundantFieldInitializer Avoid using redundant field initializer for 'min' 64
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 122130
CloseResource Ensure that resources like this Formatter object are closed after use 202
LooseCoupling Avoid using implementation types like 'HashSet'; use the interface instead 230
CloseResource Ensure that resources like this Scanner object are closed after use 234
PreserveStackTrace Thrown exception does not preserve the stack trace of exception 'ex' on all code paths 260
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 293

org/apache/commons/rng/examples/stress/ManifestVersionProvider.java

Rule Violation Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 45
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 47
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 65
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 76

org/apache/commons/rng/examples/stress/OutputCommand.java

Rule Violation Line
GodClass Possible God Class (WMC=61, ATFD=6, TCC=7.619%) 50
NPathComplexity The method 'call()' has an NPath complexity of 322, current threshold is 200 161
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 194206
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 259

org/apache/commons/rng/examples/stress/ProcessUtils.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 72
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 118
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 121

org/apache/commons/rng/examples/stress/RNGUtils.java

Rule Violation Line
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 165179
CommentRequired Field comments are required 217
CommentRequired Field comments are required 253
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 517530

org/apache/commons/rng/examples/stress/ResultsCommand.java

Rule Violation Line
ExcessiveImports A high number of imports (32) can indicate a high degree of coupling within an object; current threshold is 30. 171570
CouplingBetweenObjects A value of 32 may denote a high amount of coupling within the class (threshold: 20) 171570
GodClass Possible God Class (WMC=166, ATFD=59, TCC=0.846%) 66
CyclomaticComplexity The class 'ResultsCommand' has a total cyclomatic complexity of 166 (highest 9). 66
TestClassWithoutTestCases The class 'TestResult' might be a test class, but it contains no test cases. 186
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 400415
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 428
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 471
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 490
CognitiveComplexity The method 'writeAPT(OutputStream, List<TestResult>)' has a cognitive complexity of 24, current threshold is 15 962
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 1033
LooseCoupling Avoid using implementation types like 'EnumSet'; use the interface instead 1056
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1060
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1072
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1223
LooseCoupling Avoid using implementation types like 'HashMap'; use the interface instead 1241
LooseCoupling Avoid using implementation types like 'HashSet'; use the interface instead 1253
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 1253
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1388
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1407
CognitiveComplexity The method 'writeFailures(OutputStream, List<TestResult>)' has a cognitive complexity of 19, current threshold is 15 1480
UnusedFormalParameter Avoid unused method parameters such as 'testNames'. 1530
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 1532

org/apache/commons/rng/examples/stress/RngDataOutput.java

Rule Violation Line
PublicMemberInNonPublicType Public member 'write' declared in a non-public type 243
PublicMemberInNonPublicType Public member 'fillBuffer' declared in a non-public type 253
AvoidDuplicateLiterals The String literal "resource" appears 4 times in this file; the first occurrence is on line 377 377

org/apache/commons/rng/examples/stress/StressTestCommand.java

Rule Violation Line
ExcessiveImports A high number of imports (32) can indicate a high degree of coupling within an object; current threshold is 30. 171242
CouplingBetweenObjects A value of 23 may denote a high amount of coupling within the class (threshold: 20) 171242
GodClass Possible God Class (WMC=57, ATFD=30, TCC=7.692%) 65
TooManyFields Too many fields 651242
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 386
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 406
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 410
CognitiveComplexity The method 'createTasks(List<String>, String, Iterable<StressTestData>, ProgressTracker)' has a cognitive complexity of 36, current threshold is 15 495
NPathComplexity The method 'createTasks(List<String>, String, Iterable<StressTestData>, ProgressTracker)' has an NPath complexity of 652, current threshold is 200 495
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 559560
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 592
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 595
AvoidSynchronizedAtMethodLevel Use block level locking rather than method level synchronization 638
LocalVariableCouldBeFinal Local variable 'id' could be declared final 651
AvoidSynchronizedStatement Use ReentrantLock rather than synchronization 652657
LocalVariableCouldBeFinal Local variable 'duration' could be declared final 668
AvoidSynchronizedStatement Use ReentrantLock rather than synchronization 669674
AvoidLiteralsInIfCondition Avoid using literals such as 4 in if statements 831
AvoidLiteralsInIfCondition Avoid using literals such as 10 in if statements 904
ArrayIsStoredDirectly The user-supplied array 'seed' is stored directly. 966
LocalVariableCouldBeFinal Local variable 'exitValue' could be declared final 984
LocalVariableCouldBeFinal Local variable 'millis' could be declared final 985
ReplaceJavaUtilDate Usage of java.util.Date should be replaced with classes from java.time 1176

org/apache/commons/rng/examples/stress/StressTestData.java

Rule Violation Line
ArrayIsStoredDirectly The user-supplied array 'args' is stored directly. 73
MethodReturnsInternalArray Returning 'args' may expose an internal array. 133

org/apache/commons/rng/examples/stress/StressTestDataList.java

Rule Violation Line
LooseCoupling Avoid using implementation types like 'EnumMap'; use the interface instead 37
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 68
PublicMemberInNonPublicType Public member 'subsetIntSource' declared in a non-public type 87
PublicMemberInNonPublicType Public member 'subsetLongSource' declared in a non-public type 96
LocalVariableCouldBeFinal Local variable 'source' could be declared final 110
PublicMemberInNonPublicType Public member 'subsetRandomSource' declared in a non-public type 131

Priority 4

org/apache/commons/rng/examples/stress/Hex.java

Rule Violation Line
ShortClassName Avoid short class names like Hex 24

org/apache/commons/rng/examples/stress/LogUtils.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'LogUtils': 'logLevel' is already in scope because it is declared in an enclosing type 100

Files

org/apache/commons/rng/examples/stress/AlphaNumericComparator.java

Rule Violation Priority Line
PublicMemberInNonPublicType Public member 'INSTANCE' declared in a non-public type 3 56
UnusedAssignment The initializer for variable 'result' is never used (overwritten on lines 90 and 92) 3 88

org/apache/commons/rng/examples/stress/BridgeTestCommand.java

Rule Violation Priority Line
GuardLogStatement Logger calls should be surrounded by log level guards. 2 142
GuardLogStatement Logger calls should be surrounded by log level guards. 2 146

org/apache/commons/rng/examples/stress/EndianessCommand.java

Rule Violation Priority Line
GuardLogStatement Logger calls should be surrounded by log level guards. 2 46

org/apache/commons/rng/examples/stress/ExamplesStressApplication.java

Rule Violation Priority Line
GuardLogStatement Logger calls should be surrounded by log level guards. 2 84
GuardLogStatement Logger calls should be surrounded by log level guards. 2 86

org/apache/commons/rng/examples/stress/Hex.java

Rule Violation Priority Line
ShortClassName Avoid short class names like Hex 4 24

org/apache/commons/rng/examples/stress/ListCommand.java

Rule Violation Priority Line
RedundantFieldInitializer Avoid using redundant field initializer for 'min' 3 64
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 122130
CloseResource Ensure that resources like this Formatter object are closed after use 3 202
LooseCoupling Avoid using implementation types like 'HashSet'; use the interface instead 3 230
CloseResource Ensure that resources like this Scanner object are closed after use 3 234
PreserveStackTrace Thrown exception does not preserve the stack trace of exception 'ex' on all code paths 3 260
ReturnEmptyCollectionRatherThanNull Return an empty collection rather than null. 1 281
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 293

org/apache/commons/rng/examples/stress/LogUtils.java

Rule Violation Priority Line
UnnecessaryFullyQualifiedName Unnecessary qualifier 'LogUtils': 'logLevel' is already in scope because it is declared in an enclosing type 4 100

org/apache/commons/rng/examples/stress/ManifestVersionProvider.java

Rule Violation Priority Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 45
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 3 47
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 3 65
LooseCoupling Avoid using implementation types like 'Attributes'; use the interface instead 3 76

org/apache/commons/rng/examples/stress/OutputCommand.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=61, ATFD=6, TCC=7.619%) 3 50
NPathComplexity The method 'call()' has an NPath complexity of 322, current threshold is 200 3 161
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 194206
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 259

org/apache/commons/rng/examples/stress/ProcessUtils.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 72
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 118
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 121

org/apache/commons/rng/examples/stress/RNGUtils.java

Rule Violation Priority Line
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 165179
CommentRequired Field comments are required 3 217
CommentRequired Field comments are required 3 253
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 517530

org/apache/commons/rng/examples/stress/ResultsCommand.java

Rule Violation Priority Line
ExcessiveImports A high number of imports (32) can indicate a high degree of coupling within an object; current threshold is 30. 3 171570
CouplingBetweenObjects A value of 32 may denote a high amount of coupling within the class (threshold: 20) 3 171570
GodClass Possible God Class (WMC=166, ATFD=59, TCC=0.846%) 3 66
CyclomaticComplexity The class 'ResultsCommand' has a total cyclomatic complexity of 166 (highest 9). 3 66
TestClassWithoutTestCases The class 'TestResult' might be a test class, but it contains no test cases. 3 186
ExhaustiveSwitchHasDefault The switch block is exhaustive even without the default case 3 400415
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 428
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 471
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 490
GuardLogStatement Logger calls should be surrounded by log level guards. 2 876
CognitiveComplexity The method 'writeAPT(OutputStream, List<TestResult>)' has a cognitive complexity of 24, current threshold is 15 3 962
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 1033
LooseCoupling Avoid using implementation types like 'EnumSet'; use the interface instead 3 1056
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1060
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1072
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1223
LooseCoupling Avoid using implementation types like 'HashMap'; use the interface instead 3 1241
LooseCoupling Avoid using implementation types like 'HashSet'; use the interface instead 3 1253
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 1253
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1388
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1407
CognitiveComplexity The method 'writeFailures(OutputStream, List<TestResult>)' has a cognitive complexity of 19, current threshold is 15 3 1480
UnusedFormalParameter Avoid unused method parameters such as 'testNames'. 3 1530
LooseCoupling Avoid using implementation types like 'ArrayList'; use the interface instead 3 1532

org/apache/commons/rng/examples/stress/RngDataOutput.java

Rule Violation Priority Line
PublicMemberInNonPublicType Public member 'write' declared in a non-public type 3 243
PublicMemberInNonPublicType Public member 'fillBuffer' declared in a non-public type 3 253
AvoidDuplicateLiterals The String literal "resource" appears 4 times in this file; the first occurrence is on line 377 3 377

org/apache/commons/rng/examples/stress/StressTestCommand.java

Rule Violation Priority Line
ExcessiveImports A high number of imports (32) can indicate a high degree of coupling within an object; current threshold is 30. 3 171242
CouplingBetweenObjects A value of 23 may denote a high amount of coupling within the class (threshold: 20) 3 171242
GodClass Possible God Class (WMC=57, ATFD=30, TCC=7.692%) 3 65
TooManyFields Too many fields 3 651242
GuardLogStatement Logger calls should be surrounded by log level guards. 2 360
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 386
GuardLogStatement Logger calls should be surrounded by log level guards. 2 401
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 406
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 410
CognitiveComplexity The method 'createTasks(List<String>, String, Iterable<StressTestData>, ProgressTracker)' has a cognitive complexity of 36, current threshold is 15 3 495
NPathComplexity The method 'createTasks(List<String>, String, Iterable<StressTestData>, ProgressTracker)' has an NPath complexity of 652, current threshold is 200 3 495
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 559560
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 592
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 595
AvoidSynchronizedAtMethodLevel Use block level locking rather than method level synchronization 3 638
LocalVariableCouldBeFinal Local variable 'id' could be declared final 3 651
AvoidSynchronizedStatement Use ReentrantLock rather than synchronization 3 652657
LocalVariableCouldBeFinal Local variable 'duration' could be declared final 3 668
AvoidSynchronizedStatement Use ReentrantLock rather than synchronization 3 669674
GuardLogStatement Logger calls should be surrounded by log level guards. 2 704
AvoidLiteralsInIfCondition Avoid using literals such as 4 in if statements 3 831
AvoidLiteralsInIfCondition Avoid using literals such as 10 in if statements 3 904
ArrayIsStoredDirectly The user-supplied array 'seed' is stored directly. 3 966
LocalVariableCouldBeFinal Local variable 'exitValue' could be declared final 3 984
LocalVariableCouldBeFinal Local variable 'millis' could be declared final 3 985
ReplaceJavaUtilDate Usage of java.util.Date should be replaced with classes from java.time 3 1176

org/apache/commons/rng/examples/stress/StressTestData.java

Rule Violation Priority Line
ArrayIsStoredDirectly The user-supplied array 'args' is stored directly. 3 73
MethodReturnsInternalArray Returning 'args' may expose an internal array. 3 133

org/apache/commons/rng/examples/stress/StressTestDataList.java

Rule Violation Priority Line
LooseCoupling Avoid using implementation types like 'EnumMap'; use the interface instead 3 37
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 68
PublicMemberInNonPublicType Public member 'subsetIntSource' declared in a non-public type 3 87
PublicMemberInNonPublicType Public member 'subsetLongSource' declared in a non-public type 3 96
LocalVariableCouldBeFinal Local variable 'source' could be declared final 3 110
PublicMemberInNonPublicType Public member 'subsetRandomSource' declared in a non-public type 3 131