Apache Commons logo Apache Commons RNG

PMD Results

The following document contains the results of PMD 6.49.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. 359
GuardLogStatement Logger calls should be surrounded by log level guards. 400
GuardLogStatement Logger calls should be surrounded by log level guards. 703

Priority 3

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

Rule Violation Line
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
CloseResource Ensure that resources like this Formatter object are closed after use 202
CloseResource Ensure that resources like this Scanner object are closed after use 234

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

Rule Violation Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 45

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

Rule Violation Line
GodClass Possible God Class (WMC=61, ATFD=33, TCC=10.000%) 50548
NPathComplexity The method 'call()' has an NPath complexity of 720, current threshold is 200 161211
CompareObjectsWithEquals Use equals() to compare object references. 317

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

Rule Violation Line
UnusedPrivateMethod Avoid unused private methods such as 'createIntProvider(UniformRandomProvider)'. 182
CommentRequired Field comments are required 209
CommentRequired Field comments are required 245

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

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 171570
GodClass Possible God Class (WMC=166, ATFD=107, TCC=0.808%) 661570
CyclomaticComplexity The class 'ResultsCommand' has a total cyclomatic complexity of 166 (highest 9). 661570
CognitiveComplexity The method 'writeAPT(OutputStream, List)' has a cognitive complexity of 24, current threshold is 15 9621047
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 1033
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 1253
CognitiveComplexity The method 'writeFailures(OutputStream, List)' has a cognitive complexity of 19, current threshold is 15 14801521
UnusedFormalParameter Avoid unused method parameters such as 'testNames'. 1530

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

Rule Violation Line
AvoidDuplicateLiterals The String literal "resource" appears 4 times in this file; the first occurrence is on line 377 377
CompareObjectsWithEquals Use equals() to compare object references. 381
CompareObjectsWithEquals Use equals() to compare object references. 399
CompareObjectsWithEquals Use equals() to compare object references. 431
CompareObjectsWithEquals Use equals() to compare object references. 463

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

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 171239
GodClass Possible God Class (WMC=57, ATFD=29, TCC=7.692%) 641239
TooManyFields Too many fields 641239
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 385
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 409
NPathComplexity The method 'createTasks(List, String, Iterable, ProgressTracker)' has an NPath complexity of 2404, current threshold is 200 494564
CognitiveComplexity The method 'createTasks(List, String, Iterable, ProgressTracker)' has a cognitive complexity of 36, current threshold is 15 494564
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 558559
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 591
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 637641
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 830
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 903
ArrayIsStoredDirectly The user-supplied array 'seed' is stored directly. 965

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
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 68

Priority 4

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

Rule Violation Line
ShortClassName Avoid short class names like Hex 24105

Files

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

Rule Violation Priority Line
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 24105

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

Rule Violation Priority Line
RedundantFieldInitializer Avoid using redundant field initializer for 'min' 3 64
CloseResource Ensure that resources like this Formatter object are closed after use 3 202
CloseResource Ensure that resources like this Scanner object are closed after use 3 234
ReturnEmptyCollectionRatherThanNull Return an empty collection rather than null. 1 281

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

Rule Violation Priority Line
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 45

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

Rule Violation Priority Line
GodClass Possible God Class (WMC=61, ATFD=33, TCC=10.000%) 3 50548
NPathComplexity The method 'call()' has an NPath complexity of 720, current threshold is 200 3 161211
CompareObjectsWithEquals Use equals() to compare object references. 3 317

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

Rule Violation Priority Line
UnusedPrivateMethod Avoid unused private methods such as 'createIntProvider(UniformRandomProvider)'. 3 182
CommentRequired Field comments are required 3 209
CommentRequired Field comments are required 3 245

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

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 171570
GodClass Possible God Class (WMC=166, ATFD=107, TCC=0.808%) 3 661570
CyclomaticComplexity The class 'ResultsCommand' has a total cyclomatic complexity of 166 (highest 9). 3 661570
GuardLogStatement Logger calls should be surrounded by log level guards. 2 876
CognitiveComplexity The method 'writeAPT(OutputStream, List)' has a cognitive complexity of 24, current threshold is 15 3 9621047
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 1033
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 1253
CognitiveComplexity The method 'writeFailures(OutputStream, List)' has a cognitive complexity of 19, current threshold is 15 3 14801521
UnusedFormalParameter Avoid unused method parameters such as 'testNames'. 3 1530

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

Rule Violation Priority Line
AvoidDuplicateLiterals The String literal "resource" appears 4 times in this file; the first occurrence is on line 377 3 377
CompareObjectsWithEquals Use equals() to compare object references. 3 381
CompareObjectsWithEquals Use equals() to compare object references. 3 399
CompareObjectsWithEquals Use equals() to compare object references. 3 431
CompareObjectsWithEquals Use equals() to compare object references. 3 463

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

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 171239
GodClass Possible God Class (WMC=57, ATFD=29, TCC=7.692%) 3 641239
TooManyFields Too many fields 3 641239
GuardLogStatement Logger calls should be surrounded by log level guards. 2 359
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 385
GuardLogStatement Logger calls should be surrounded by log level guards. 2 400
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 409
NPathComplexity The method 'createTasks(List, String, Iterable, ProgressTracker)' has an NPath complexity of 2404, current threshold is 200 3 494564
CognitiveComplexity The method 'createTasks(List, String, Iterable, ProgressTracker)' has a cognitive complexity of 36, current threshold is 15 3 494564
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 558559
DoNotUseThreads To be compliant to J2EE, a webapp should not use any thread. 3 591
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 637641
GuardLogStatement Logger calls should be surrounded by log level guards. 2 703
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 830
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 903
ArrayIsStoredDirectly The user-supplied array 'seed' is stored directly. 3 965

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
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 68

Suppressed Violations

Filename Rule message Suppression type Reason
org/apache/commons/rng/examples/stress/BridgeTestCommand.java Private field 'executableArguments' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/BridgeTestCommand.java Private field 'fileOutputPrefix' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/BridgeTestCommand.java Private field 'byteOrder' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ExamplesStressCommand.java Avoid unused private fields such as 'reusableOptions'. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'listFormat' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'providerType' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'min' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'max' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'idPrefix' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ListCommand.java Private field 'trials' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/OutputCommand.java Private field 'arguments' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/OutputCommand.java Private field 'outputFormat' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/OutputCommand.java Private field 'count' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/OutputCommand.java Private field 'bufferSize' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/OutputCommand.java Private field 'byteOrder' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ResultsCommand.java Avoid really long classes. annotation
org/apache/commons/rng/examples/stress/ResultsCommand.java Private field 'resultsFiles' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ResultsCommand.java Private field 'outputFormat' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/ResultsCommand.java Private field 'pathPrefix' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Avoid really long classes. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'executableArguments' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'fileOutputPrefix' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'outputMode' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'trials' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'processors' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'applicationThreads' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'bufferSize' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'byteOrder' could be made final; it is only initialized in the declaration or constructor. annotation
org/apache/commons/rng/examples/stress/StressTestCommand.java Private field 'stopFileLock' could be made final; it is only initialized in the declaration or constructor. annotation