Apache Commons logo Commons Math

PMD Results

The following document contains the results of PMD 6.55.0.

Violations By Priority

Priority 1

org/apache/commons/math4/legacy/core/dfp/Dfp.java

Rule Violation Line
ConstructorCallsOverridableMethod Overridable method 'getRadixDigits' called during object construction 345
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 527

org/apache/commons/math4/legacy/core/dfp/DfpDec.java

Rule Violation Line
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 65
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 73
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 82

Priority 2

org/apache/commons/math4/legacy/core/dfp/Dfp.java

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'x' 221
AvoidReassigningParameters Avoid reassigning parameters such as 'extra' 1230

org/apache/commons/math4/legacy/core/dfp/DfpMath.java

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 169
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 220
AvoidReassigningParameters Avoid reassigning parameters such as 'x' 567
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 936

Priority 3

org/apache/commons/math4/legacy/core/FieldElement.java

Rule Violation Line
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 36
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 43
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 64
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 72
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 72
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 79

org/apache/commons/math4/legacy/core/IntegerSequence.java

Rule Violation Line
AvoidFieldNameMatchingMethodName Field size has the same name as a method 74
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 137
AvoidFieldNameMatchingMethodName Field increment has the same name as a method 147
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 164
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 182
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 317
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 343

org/apache/commons/math4/legacy/core/MathArrays.java

Rule Violation Line
ExcessivePublicCount This class has a bunch of public methods and attributes 181135
CyclomaticComplexity The class 'MathArrays' has a total cyclomatic complexity of 172 (highest 16). 461135
GodClass Possible God Class (WMC=172, ATFD=85, TCC=0.000%) 461135
CognitiveComplexity The method 'isMonotonic(T, OrderDirection, boolean)' has a cognitive complexity of 27, current threshold is 15 307347
CognitiveComplexity The method 'checkOrder(double, OrderDirection, boolean, boolean)' has a cognitive complexity of 34, current threshold is 15 447501
LocalVariableCouldBeFinal Local variable 'x' could be declared final 555
LocalVariableCouldBeFinal Local variable 'x' could be declared final 570
LocalVariableCouldBeFinal Local variable 'x' could be declared final 585
LocalVariableCouldBeFinal Local variable 'i' could be declared final 600
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 615621
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 758
LocalVariableCouldBeFinal Local variable 'array' could be declared final 793
LocalVariableCouldBeFinal Local variable 'dummyRow' could be declared final 814
CognitiveComplexity The method 'verifyValues(double, double, int, int, boolean)' has a cognitive complexity of 20, current threshold is 15 10431078
LocalVariableCouldBeFinal Local variable 'a' could be declared final 1093
UnusedAssignment The initializer for variable 'curLength' is never used (overwritten on line 1100) 1097
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 10991103
LocalVariableCouldBeFinal Local variable 'values' could be declared final 1122
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 11231125
LocalVariableCouldBeFinal Local variable 'iterator' could be declared final 1128

org/apache/commons/math4/legacy/core/Pair.java

Rule Violation Line
ConfusingTernary Avoid if (x != y) ..; else ..; 108118
LocalVariableCouldBeFinal Local variable 'oP' could be declared final 111

org/apache/commons/math4/legacy/core/RealFieldElement.java

Rule Violation Line
ExcessivePublicCount This class has a bunch of public methods and attributes 17422
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 73
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 147
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 187
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 251
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 292
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 303

org/apache/commons/math4/legacy/core/dfp/Dfp.java

Rule Violation Line
ExcessivePublicCount This class has a bunch of public methods and attributes 182897
GodClass Possible God Class (WMC=478, ATFD=424, TCC=14.011%) 962897
CyclomaticComplexity The class 'Dfp' has a total cyclomatic complexity of 478 (highest 39). 962897
AvoidFieldNameMatchingMethodName Field exp has the same name as a method 170
UnusedAssignment The value assigned to field 'sign' is never used (overwritten on lines 274, 292, 295, 298 and 313) 260
UnusedAssignment The value assigned to field 'exp' is never used (overwritten on line 314) 261
UnusedAssignment The value assigned to field 'nans' is never used (overwritten on lines 293, 296, 299 and 315) 262
LocalVariableCouldBeFinal Local variable 'bits' could be declared final 265
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 289
CognitiveComplexity The constructor 'Dfp(DfpField, String)' has a cognitive complexity of 61, current threshold is 15 333529
NPathComplexity The constructor 'Dfp(DfpField, String)' has an NPath complexity of 689472000, current threshold is 200 333529
CyclomaticComplexity The constructor 'Dfp(DfpField, String)' has a cyclomatic complexity of 39. 333529
UnusedAssignment The value assigned to field 'exp' is never used (overwritten on line 523) 338
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 342
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 345
LiteralsFirstInComparisons Position literals first in String comparisons 348
LiteralsFirstInComparisons Position literals first in String comparisons 354
LiteralsFirstInComparisons Position literals first in String comparisons 360
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 367
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 369
ConfusingTernary Avoid if (x != y) ..; else ..; 374396
LocalVariableCouldBeFinal Local variable 'fpexp' could be declared final 377
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 381
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 399
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 417
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 445
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 471
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 494
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 694
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 695
LocalVariableCouldBeFinal Local variable 'diff' could be declared final 697
LocalVariableCouldBeFinal Local variable 'result' could be declared final 857
NPathComplexity The method 'compare(Dfp, Dfp)' has an NPath complexity of 12150, current threshold is 200 936987
CyclomaticComplexity The method 'compare(Dfp, Dfp)' has a cyclomatic complexity of 20. 936987
CognitiveComplexity The method 'compare(Dfp, Dfp)' has a cognitive complexity of 23, current threshold is 15 936987
CognitiveComplexity The method 'trunc(DfpField.RoundingMode)' has a cognitive complexity of 22, current threshold is 15 10421126
NPathComplexity The method 'trunc(DfpField.RoundingMode)' has an NPath complexity of 896, current threshold is 200 10421126
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1043
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1134
LocalVariableCouldBeFinal Local variable 'd' could be declared final 1171
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 1181
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 1184
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 1187
ImplicitSwitchFallThrough A switch statement does not contain a break 12061217
CognitiveComplexity The method 'add(Dfp)' has a cognitive complexity of 42, current threshold is 15 12511396
CyclomaticComplexity The method 'add(Dfp)' has a cyclomatic complexity of 32. 12511396
NPathComplexity The method 'add(Dfp)' has an NPath complexity of 13317120, current threshold is 200 12511396
LocalVariableCouldBeFinal Local variable 'a' could be declared final 1293
LocalVariableCouldBeFinal Local variable 'b' could be declared final 1294
LocalVariableCouldBeFinal Local variable 'result' could be declared final 1403
CognitiveComplexity The method 'round(int)' has a cognitive complexity of 15, current threshold is 15 14211493
NPathComplexity The method 'round(int)' has an NPath complexity of 360, current threshold is 200 14211493
NPathComplexity The method 'multiply(Dfp)' has an NPath complexity of 775296, current threshold is 200 15001599
CyclomaticComplexity The method 'multiply(Dfp)' has a cyclomatic complexity of 29. 15001599
CognitiveComplexity The method 'multiply(Dfp)' has a cognitive complexity of 32, current threshold is 15 15001599
NPathComplexity The method 'multiplyFast(int)' has an NPath complexity of 912, current threshold is 200 16191675
CognitiveComplexity The method 'multiplyFast(int)' has a cognitive complexity of 15, current threshold is 15 16191675
CyclomaticComplexity The method 'divide(Dfp)' has a cyclomatic complexity of 38. 16821888
CognitiveComplexity The method 'divide(Dfp)' has a cognitive complexity of 71, current threshold is 15 16821888
NPathComplexity The method 'divide(Dfp)' has an NPath complexity of 731512320, current threshold is 200 16821888
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1683
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1684
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1685
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1686
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1687
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1688
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1689
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1690
UnusedAssignment The initializer for variable 'md' is never used (overwritten on line 1856) 1691
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1691
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1692
LocalVariableCouldBeFinal Local variable 'dm' could be declared final 1782
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 1807
NPathComplexity The method 'divide(int)' has an NPath complexity of 240, current threshold is 200 18951952
NPathComplexity The method 'sqrt()' has an NPath complexity of 4680, current threshold is 200 19652055
CognitiveComplexity The method 'sqrt()' has a cognitive complexity of 19, current threshold is 15 19652055
ImplicitSwitchFallThrough A switch statement does not contain a break 20122024
UnusedAssignment The initializer for variable 'dx' is never used (overwritten on line 2034) 2026
UnusedAssignment The initializer for variable 'ppx' is never used (overwritten on line 2038) 2032
NPathComplexity The method 'dfp2sci()' has an NPath complexity of 576, current threshold is 200 20812157
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 2086
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 2087
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 2101
ConfusingTernary Avoid if (x != y) ..; else ..; 21132128
UnusedAssignment The updated value of variable 'q' is never used 2126
NPathComplexity The method 'dfp2string()' has an NPath complexity of 768, current threshold is 200 21622229
AssignmentInOperand Avoid assignments in operands 2190
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 2214
CognitiveComplexity The method 'dotrap(int, String, Dfp, Dfp)' has a cognitive complexity of 16, current threshold is 15 22382294
LocalVariableCouldBeFinal Local variable 'result' could be declared final 2325
NPathComplexity The method 'nextAfter(Dfp)' has an NPath complexity of 432, current threshold is 200 23352397
CognitiveComplexity The method 'nextAfter(Dfp)' has a cognitive complexity of 16, current threshold is 15 23352397
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 2346
NPathComplexity The method 'toDouble()' has an NPath complexity of 27648, current threshold is 200 24032486
CognitiveComplexity The method 'toDouble()' has a cognitive complexity of 21, current threshold is 15 24032486
LocalVariableCouldBeFinal Local variable 'cmp0' could be declared final 2419
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 2452
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 2462
LocalVariableCouldBeFinal Local variable 'bits' could be declared final 2478
LocalVariableCouldBeFinal Local variable 'mask' could be declared final 2494
LocalVariableCouldBeFinal Local variable 'sb' could be declared final 2586
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 2744
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 2817
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 2833

org/apache/commons/math4/legacy/core/dfp/DfpDec.java

Rule Violation Line
GodClass Possible God Class (WMC=56, ATFD=27, TCC=0.000%) 26366
CyclomaticComplexity The method 'round(int)' has a cyclomatic complexity of 23. 163287
CognitiveComplexity The method 'round(int)' has a cognitive complexity of 27, current threshold is 15 163287
NPathComplexity The method 'round(int)' has an NPath complexity of 51840, current threshold is 200 163287
LocalVariableCouldBeFinal Local variable 'msb' could be declared final 165
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 188
NPathComplexity The method 'nextAfter(Dfp)' has an NPath complexity of 1728, current threshold is 200 291365
CognitiveComplexity The method 'nextAfter(Dfp)' has a cognitive complexity of 23, current threshold is 15 291365
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 304
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 305

org/apache/commons/math4/legacy/core/dfp/DfpField.java

Rule Violation Line
TooManyFields Too many fields 26753
CognitiveComplexity The method 'split(String)' has a cognitive complexity of 15, current threshold is 15 528570
NPathComplexity The method 'split(String)' has an NPath complexity of 245, current threshold is 200 528570
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 543
NonThreadSafeSingleton Singleton is not thread safe 576597
LocalVariableCouldBeFinal Local variable 'sqrt2' could be declared final 608
LocalVariableCouldBeFinal Local variable 'four' could be declared final 610
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 663
LocalVariableCouldBeFinal Local variable 'x' could be declared final 734
LocalVariableCouldBeFinal Local variable 't' could be declared final 743
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 748

org/apache/commons/math4/legacy/core/dfp/DfpMath.java

Rule Violation Line
CyclomaticComplexity The class 'DfpMath' has a total cyclomatic complexity of 118 (highest 40). 24946
GodClass Possible God Class (WMC=118, ATFD=107, TCC=0.000%) 24946
NPathComplexity The method 'split(DfpField, String)' has an NPath complexity of 245, current threshold is 200 4487
CognitiveComplexity The method 'split(DfpField, String)' has a cognitive complexity of 15, current threshold is 15 4487
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 4487
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 60
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 9399
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 109126
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 135145
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 152201
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 153
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 155
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 209
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 225
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 231
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 261
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 264
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 286303
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 299
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 313
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 314
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 315
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 316
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 431458
LocalVariableCouldBeFinal Local variable 'x' could be declared final 437
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 452
CognitiveComplexity The method 'pow(Dfp, Dfp)' has a cognitive complexity of 77, current threshold is 15 500657
CyclomaticComplexity The method 'pow(Dfp, Dfp)' has a cyclomatic complexity of 40. 500657
NPathComplexity The method 'pow(Dfp, Dfp)' has an NPath complexity of 13436928, current threshold is 200 500657
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 512
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 513
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 514
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 664686
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 682
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 693719
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 715
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 827845
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 841
LocalVariableCouldBeFinal Local variable 'negative' could be declared final 934

Files

org/apache/commons/math4/legacy/core/FieldElement.java

Rule Violation Priority Line
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 36
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 43
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 64
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 72
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 72
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 79

org/apache/commons/math4/legacy/core/IntegerSequence.java

Rule Violation Priority Line
AvoidFieldNameMatchingMethodName Field size has the same name as a method 3 74
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 137
AvoidFieldNameMatchingMethodName Field increment has the same name as a method 3 147
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 164
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 182
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 317
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 343

org/apache/commons/math4/legacy/core/MathArrays.java

Rule Violation Priority Line
ExcessivePublicCount This class has a bunch of public methods and attributes 3 181135
CyclomaticComplexity The class 'MathArrays' has a total cyclomatic complexity of 172 (highest 16). 3 461135
GodClass Possible God Class (WMC=172, ATFD=85, TCC=0.000%) 3 461135
CognitiveComplexity The method 'isMonotonic(T, OrderDirection, boolean)' has a cognitive complexity of 27, current threshold is 15 3 307347
CognitiveComplexity The method 'checkOrder(double, OrderDirection, boolean, boolean)' has a cognitive complexity of 34, current threshold is 15 3 447501
LocalVariableCouldBeFinal Local variable 'x' could be declared final 3 555
LocalVariableCouldBeFinal Local variable 'x' could be declared final 3 570
LocalVariableCouldBeFinal Local variable 'x' could be declared final 3 585
LocalVariableCouldBeFinal Local variable 'i' could be declared final 3 600
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 615621
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 758
LocalVariableCouldBeFinal Local variable 'array' could be declared final 3 793
LocalVariableCouldBeFinal Local variable 'dummyRow' could be declared final 3 814
CognitiveComplexity The method 'verifyValues(double, double, int, int, boolean)' has a cognitive complexity of 20, current threshold is 15 3 10431078
LocalVariableCouldBeFinal Local variable 'a' could be declared final 3 1093
UnusedAssignment The initializer for variable 'curLength' is never used (overwritten on line 1100) 3 1097
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 10991103
LocalVariableCouldBeFinal Local variable 'values' could be declared final 3 1122
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 11231125
LocalVariableCouldBeFinal Local variable 'iterator' could be declared final 3 1128

org/apache/commons/math4/legacy/core/Pair.java

Rule Violation Priority Line
ConfusingTernary Avoid if (x != y) ..; else ..; 3 108118
LocalVariableCouldBeFinal Local variable 'oP' could be declared final 3 111

org/apache/commons/math4/legacy/core/RealFieldElement.java

Rule Violation Priority Line
ExcessivePublicCount This class has a bunch of public methods and attributes 3 17422
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 73
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 147
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 187
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 251
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 292
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 303

org/apache/commons/math4/legacy/core/dfp/Dfp.java

Rule Violation Priority Line
ExcessivePublicCount This class has a bunch of public methods and attributes 3 182897
GodClass Possible God Class (WMC=478, ATFD=424, TCC=14.011%) 3 962897
CyclomaticComplexity The class 'Dfp' has a total cyclomatic complexity of 478 (highest 39). 3 962897
AvoidFieldNameMatchingMethodName Field exp has the same name as a method 3 170
AvoidReassigningParameters Avoid reassigning parameters such as 'x' 2 221
UnusedAssignment The value assigned to field 'sign' is never used (overwritten on lines 274, 292, 295, 298 and 313) 3 260
UnusedAssignment The value assigned to field 'exp' is never used (overwritten on line 314) 3 261
UnusedAssignment The value assigned to field 'nans' is never used (overwritten on lines 293, 296, 299 and 315) 3 262
LocalVariableCouldBeFinal Local variable 'bits' could be declared final 3 265
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 289
CognitiveComplexity The constructor 'Dfp(DfpField, String)' has a cognitive complexity of 61, current threshold is 15 3 333529
NPathComplexity The constructor 'Dfp(DfpField, String)' has an NPath complexity of 689472000, current threshold is 200 3 333529
CyclomaticComplexity The constructor 'Dfp(DfpField, String)' has a cyclomatic complexity of 39. 3 333529
UnusedAssignment The value assigned to field 'exp' is never used (overwritten on line 523) 3 338
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 342
ConstructorCallsOverridableMethod Overridable method 'getRadixDigits' called during object construction 1 345
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 345
LiteralsFirstInComparisons Position literals first in String comparisons 3 348
LiteralsFirstInComparisons Position literals first in String comparisons 3 354
LiteralsFirstInComparisons Position literals first in String comparisons 3 360
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 367
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 369
ConfusingTernary Avoid if (x != y) ..; else ..; 3 374396
LocalVariableCouldBeFinal Local variable 'fpexp' could be declared final 3 377
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 381
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 399
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 417
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 445
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 471
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 494
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 1 527
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 694
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 695
LocalVariableCouldBeFinal Local variable 'diff' could be declared final 3 697
LocalVariableCouldBeFinal Local variable 'result' could be declared final 3 857
NPathComplexity The method 'compare(Dfp, Dfp)' has an NPath complexity of 12150, current threshold is 200 3 936987
CyclomaticComplexity The method 'compare(Dfp, Dfp)' has a cyclomatic complexity of 20. 3 936987
CognitiveComplexity The method 'compare(Dfp, Dfp)' has a cognitive complexity of 23, current threshold is 15 3 936987
CognitiveComplexity The method 'trunc(DfpField.RoundingMode)' has a cognitive complexity of 22, current threshold is 15 3 10421126
NPathComplexity The method 'trunc(DfpField.RoundingMode)' has an NPath complexity of 896, current threshold is 200 3 10421126
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1043
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1134
LocalVariableCouldBeFinal Local variable 'd' could be declared final 3 1171
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 1181
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 1184
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 1187
ImplicitSwitchFallThrough A switch statement does not contain a break 3 12061217
AvoidReassigningParameters Avoid reassigning parameters such as 'extra' 2 1230
CognitiveComplexity The method 'add(Dfp)' has a cognitive complexity of 42, current threshold is 15 3 12511396
CyclomaticComplexity The method 'add(Dfp)' has a cyclomatic complexity of 32. 3 12511396
NPathComplexity The method 'add(Dfp)' has an NPath complexity of 13317120, current threshold is 200 3 12511396
LocalVariableCouldBeFinal Local variable 'a' could be declared final 3 1293
LocalVariableCouldBeFinal Local variable 'b' could be declared final 3 1294
LocalVariableCouldBeFinal Local variable 'result' could be declared final 3 1403
CognitiveComplexity The method 'round(int)' has a cognitive complexity of 15, current threshold is 15 3 14211493
NPathComplexity The method 'round(int)' has an NPath complexity of 360, current threshold is 200 3 14211493
NPathComplexity The method 'multiply(Dfp)' has an NPath complexity of 775296, current threshold is 200 3 15001599
CyclomaticComplexity The method 'multiply(Dfp)' has a cyclomatic complexity of 29. 3 15001599
CognitiveComplexity The method 'multiply(Dfp)' has a cognitive complexity of 32, current threshold is 15 3 15001599
NPathComplexity The method 'multiplyFast(int)' has an NPath complexity of 912, current threshold is 200 3 16191675
CognitiveComplexity The method 'multiplyFast(int)' has a cognitive complexity of 15, current threshold is 15 3 16191675
CyclomaticComplexity The method 'divide(Dfp)' has a cyclomatic complexity of 38. 3 16821888
CognitiveComplexity The method 'divide(Dfp)' has a cognitive complexity of 71, current threshold is 15 3 16821888
NPathComplexity The method 'divide(Dfp)' has an NPath complexity of 731512320, current threshold is 200 3 16821888
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1683
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1684
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1685
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1686
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1687
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1688
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1689
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1690
UnusedAssignment The initializer for variable 'md' is never used (overwritten on line 1856) 3 1691
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1691
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1692
LocalVariableCouldBeFinal Local variable 'dm' could be declared final 3 1782
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 1807
NPathComplexity The method 'divide(int)' has an NPath complexity of 240, current threshold is 200 3 18951952
NPathComplexity The method 'sqrt()' has an NPath complexity of 4680, current threshold is 200 3 19652055
CognitiveComplexity The method 'sqrt()' has a cognitive complexity of 19, current threshold is 15 3 19652055
ImplicitSwitchFallThrough A switch statement does not contain a break 3 20122024
UnusedAssignment The initializer for variable 'dx' is never used (overwritten on line 2034) 3 2026
UnusedAssignment The initializer for variable 'ppx' is never used (overwritten on line 2038) 3 2032
NPathComplexity The method 'dfp2sci()' has an NPath complexity of 576, current threshold is 200 3 20812157
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 2086
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 2087
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 2101
ConfusingTernary Avoid if (x != y) ..; else ..; 3 21132128
UnusedAssignment The updated value of variable 'q' is never used 3 2126
NPathComplexity The method 'dfp2string()' has an NPath complexity of 768, current threshold is 200 3 21622229
AssignmentInOperand Avoid assignments in operands 3 2190
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 2214
CognitiveComplexity The method 'dotrap(int, String, Dfp, Dfp)' has a cognitive complexity of 16, current threshold is 15 3 22382294
LocalVariableCouldBeFinal Local variable 'result' could be declared final 3 2325
NPathComplexity The method 'nextAfter(Dfp)' has an NPath complexity of 432, current threshold is 200 3 23352397
CognitiveComplexity The method 'nextAfter(Dfp)' has a cognitive complexity of 16, current threshold is 15 3 23352397
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 2346
NPathComplexity The method 'toDouble()' has an NPath complexity of 27648, current threshold is 200 3 24032486
CognitiveComplexity The method 'toDouble()' has a cognitive complexity of 21, current threshold is 15 3 24032486
LocalVariableCouldBeFinal Local variable 'cmp0' could be declared final 3 2419
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 2452
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 2462
LocalVariableCouldBeFinal Local variable 'bits' could be declared final 3 2478
LocalVariableCouldBeFinal Local variable 'mask' could be declared final 3 2494
LocalVariableCouldBeFinal Local variable 'sb' could be declared final 3 2586
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 2744
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 2817
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 2833

org/apache/commons/math4/legacy/core/dfp/DfpDec.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=56, ATFD=27, TCC=0.000%) 3 26366
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 1 65
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 1 73
ConstructorCallsOverridableMethod Overridable method 'round' called during object construction 1 82
CyclomaticComplexity The method 'round(int)' has a cyclomatic complexity of 23. 3 163287
CognitiveComplexity The method 'round(int)' has a cognitive complexity of 27, current threshold is 15 3 163287
NPathComplexity The method 'round(int)' has an NPath complexity of 51840, current threshold is 200 3 163287
LocalVariableCouldBeFinal Local variable 'msb' could be declared final 3 165
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 188
NPathComplexity The method 'nextAfter(Dfp)' has an NPath complexity of 1728, current threshold is 200 3 291365
CognitiveComplexity The method 'nextAfter(Dfp)' has a cognitive complexity of 23, current threshold is 15 3 291365
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 304
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 305

org/apache/commons/math4/legacy/core/dfp/DfpField.java

Rule Violation Priority Line
TooManyFields Too many fields 3 26753
CognitiveComplexity The method 'split(String)' has a cognitive complexity of 15, current threshold is 15 3 528570
NPathComplexity The method 'split(String)' has an NPath complexity of 245, current threshold is 200 3 528570
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 543
NonThreadSafeSingleton Singleton is not thread safe 3 576597
LocalVariableCouldBeFinal Local variable 'sqrt2' could be declared final 3 608
LocalVariableCouldBeFinal Local variable 'four' could be declared final 3 610
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 663
LocalVariableCouldBeFinal Local variable 'x' could be declared final 3 734
LocalVariableCouldBeFinal Local variable 't' could be declared final 3 743
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 748

org/apache/commons/math4/legacy/core/dfp/DfpMath.java

Rule Violation Priority Line
CyclomaticComplexity The class 'DfpMath' has a total cyclomatic complexity of 118 (highest 40). 3 24946
GodClass Possible God Class (WMC=118, ATFD=107, TCC=0.000%) 3 24946
NPathComplexity The method 'split(DfpField, String)' has an NPath complexity of 245, current threshold is 200 3 4487
CognitiveComplexity The method 'split(DfpField, String)' has a cognitive complexity of 15, current threshold is 15 3 4487
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 4487
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 60
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 9399
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 109126
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 135145
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 152201
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 153
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 155
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 2 169
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 209
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 2 220
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 225
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 231
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 261
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 264
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 286303
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 299
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 313
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 314
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 315
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 316
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 431458
LocalVariableCouldBeFinal Local variable 'x' could be declared final 3 437
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 452
CognitiveComplexity The method 'pow(Dfp, Dfp)' has a cognitive complexity of 77, current threshold is 15 3 500657
CyclomaticComplexity The method 'pow(Dfp, Dfp)' has a cyclomatic complexity of 40. 3 500657
NPathComplexity The method 'pow(Dfp, Dfp)' has an NPath complexity of 13436928, current threshold is 200 3 500657
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 512
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 513
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 514
AvoidReassigningParameters Avoid reassigning parameters such as 'x' 2 567
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 664686
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 682
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 693719
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 715
AvoidProtectedMethodInFinalClassNotExtending Avoid protected methods in a final class that doesnt extend anything other than Object. Change to private or package access. 3 827845
AvoidInstantiatingObjectsInLoops Avoid instantiating new objects inside loops 3 841
LocalVariableCouldBeFinal Local variable 'negative' could be declared final 3 934
AvoidReassigningParameters Avoid reassigning parameters such as 'a' 2 936