Apache Commons logo Apache Commons Numbers

PMD Results

The following document contains the results of PMD 6.49.0.

Violations By Priority

Priority 2

org/apache/commons/numbers/core/ArithmeticUtils.java

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 485
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 513
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 546
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 579

Priority 3

org/apache/commons/numbers/core/ArithmeticUtils.java

Rule Violation Line
CyclomaticComplexity The class 'ArithmeticUtils' has a total cyclomatic complexity of 105 (highest 17). 27606
GodClass Possible God Class (WMC=105, ATFD=8, TCC=10.989%) 27606
NPathComplexity The method 'gcd(long, long)' has an NPath complexity of 1600, current threshold is 200 141197
CognitiveComplexity The method 'gcd(long, long)' has a cognitive complexity of 17, current threshold is 15 141197
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 170
NPathComplexity The method 'pow(int, int)' has an NPath complexity of 360, current threshold is 200 284323
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 302
NPathComplexity The method 'pow(long, int)' has an NPath complexity of 360, current threshold is 200 344383
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 350
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 354
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 362
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 506
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 507
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 572
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 573

org/apache/commons/numbers/core/Norm.java

Rule Violation Line
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 107
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 109
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 111
ShortMethodName Avoid using short method names 149152
ShortMethodName Avoid using short method names 169173
ShortMethodName Avoid using short method names 189192
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 241243
ConfusingTernary Avoid if (x != y) ..; else ..; 283289
LocalVariableCouldBeFinal Local variable 'sx' could be declared final 309
LocalVariableCouldBeFinal Local variable 'sy' could be declared final 317
LocalVariableCouldBeFinal Local variable 'sx' could be declared final 374
LocalVariableCouldBeFinal Local variable 'sy' could be declared final 382
ConfusingTernary Avoid if (x != y) ..; else ..; 423469
ConfusingTernary Avoid if (x != y) ..; else ..; 476490
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 556558

org/apache/commons/numbers/core/Sum.java

Rule Violation Line
AvoidFieldNameMatchingTypeName It is somewhat confusing to have a field name matching the declaring class name 89
LocalVariableCouldBeFinal Local variable 't' could be declared final 124

Files

org/apache/commons/numbers/core/ArithmeticUtils.java

Rule Violation Priority Line
CyclomaticComplexity The class 'ArithmeticUtils' has a total cyclomatic complexity of 105 (highest 17). 3 27606
GodClass Possible God Class (WMC=105, ATFD=8, TCC=10.989%) 3 27606
NPathComplexity The method 'gcd(long, long)' has an NPath complexity of 1600, current threshold is 200 3 141197
CognitiveComplexity The method 'gcd(long, long)' has a cognitive complexity of 17, current threshold is 15 3 141197
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 170
NPathComplexity The method 'pow(int, int)' has an NPath complexity of 360, current threshold is 200 3 284323
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 302
NPathComplexity The method 'pow(long, int)' has an NPath complexity of 360, current threshold is 200 3 344383
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 350
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 354
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 362
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 485
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 506
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 507
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 513
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 546
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 572
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 573
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 579

org/apache/commons/numbers/core/Norm.java

Rule Violation Priority Line
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 107
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 109
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 111
ShortMethodName Avoid using short method names 3 149152
ShortMethodName Avoid using short method names 3 169173
ShortMethodName Avoid using short method names 3 189192
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 241243
ConfusingTernary Avoid if (x != y) ..; else ..; 3 283289
LocalVariableCouldBeFinal Local variable 'sx' could be declared final 3 309
LocalVariableCouldBeFinal Local variable 'sy' could be declared final 3 317
LocalVariableCouldBeFinal Local variable 'sx' could be declared final 3 374
LocalVariableCouldBeFinal Local variable 'sy' could be declared final 3 382
ConfusingTernary Avoid if (x != y) ..; else ..; 3 423469
ConfusingTernary Avoid if (x != y) ..; else ..; 3 476490
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 556558

org/apache/commons/numbers/core/Sum.java

Rule Violation Priority Line
AvoidFieldNameMatchingTypeName It is somewhat confusing to have a field name matching the declaring class name 3 89
LocalVariableCouldBeFinal Local variable 't' could be declared final 3 124

Suppressed Violations

Filename Rule message Suppression type Reason
org/apache/commons/numbers/core/Norm.java Avoid using short method names annotation
org/apache/commons/numbers/core/Norm.java Avoid using short method names annotation
org/apache/commons/numbers/core/Norm.java Avoid using short method names annotation
org/apache/commons/numbers/core/Precision.java Avoid using short method names annotation
org/apache/commons/numbers/core/Precision.java Avoid using short method names annotation
org/apache/commons/numbers/core/Precision.java Avoid using short method names annotation
org/apache/commons/numbers/core/Sum.java Avoid using short method names annotation
org/apache/commons/numbers/core/Sum.java Avoid using short method names annotation