Apache Commons logo Apache Commons Numbers

PMD Results

The following document contains the results of PMD 6.21.0.

Violations By Priority

Priority 2

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

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 478
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 478
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 506
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 506
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 539
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 572

Priority 3

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

Rule Violation Line
GodClass Possible God Class (WMC=105, ATFD=8, TCC=10.989%) 27607
CyclomaticComplexity The class 'ArithmeticUtils' has a total cyclomatic complexity of 105 (highest 17). 27607
NPathComplexity The method 'gcd(long, long)' has an NPath complexity of 1600 142198
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 171
NPathComplexity The method 'pow(int, int)' has an NPath complexity of 360 285324
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 303
NPathComplexity The method 'pow(long, int)' has an NPath complexity of 360 345384
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 351
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 355
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 363
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 507
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 508
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 573
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 574

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
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/Precision.java

Rule Violation Line
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 401

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
GodClass Possible God Class (WMC=105, ATFD=8, TCC=10.989%) 3 27607
CyclomaticComplexity The class 'ArithmeticUtils' has a total cyclomatic complexity of 105 (highest 17). 3 27607
NPathComplexity The method 'gcd(long, long)' has an NPath complexity of 1600 3 142198
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 171
NPathComplexity The method 'pow(int, int)' has an NPath complexity of 360 3 285324
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 303
NPathComplexity The method 'pow(long, int)' has an NPath complexity of 360 3 345384
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 351
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 355
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 363
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 478
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 478
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 506
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 506
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 507
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 508
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 539
AvoidReassigningParameters Avoid reassigning parameters such as 'dividend' 2 572
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 573
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 574

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
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/Precision.java

Rule Violation Priority Line
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 401

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