PMD Results

The following document contains the results of PMD 4.2.5.

Files

org/apache/commons/jexl2/Debugger.java

ViolationLine
This class has a bunch of public methods and attributes17 - 700
A high number of imports can indicate a high degree of coupling within an object.17 - 700
This class has too many methods, consider refactoring it.84 - 700
Use equals() to compare object references.172
Use equals() to compare object references.176
Use equals() to compare object references.210
Avoid if (x != y) ..; else ..;213 - 217
Use equals() to compare object references.218

org/apache/commons/jexl2/DebugInfo.java

ViolationLine
Avoid if (x != y) ..; else ..;49

org/apache/commons/jexl2/internal/AbstractExecutor.java

ViolationLine
This class has too many methods, consider refactoring it.31 - 375
An empty method in an abstract class should be abstract instead159 - 161
Use equals() to compare object references.178

org/apache/commons/jexl2/internal/ArrayIterator.java

ViolationLine
Avoid if (x != y) ..; else ..;57 - 63

org/apache/commons/jexl2/internal/ArrayListWrapper.java

ViolationLine
This class has too many methods, consider refactoring it.33 - 199
The String literal "Not supported." appears 9 times in this file; the first occurrence is on line 156156

org/apache/commons/jexl2/internal/introspection/ClassMap.java

ViolationLine
Avoid reassigning parameters such as 'classToReflect'131
Use equals() to compare object references.293
Avoid if (x != y) ..; else ..;301 - 305
Avoid if (x != y) ..; else ..;354 - 358

org/apache/commons/jexl2/internal/introspection/IntrospectorBase.java

ViolationLine
The class 'IntrospectorBase' has a Cyclomatic Complexity of 4 (Highest = 14).51 - 327
Document empty constructor174
Avoid reassigning parameters such as 'cloader'185
The method 'getConstructor' has a Cyclomatic Complexity of 14.257 - 310
Avoid if (x != y) ..; else ..;287 - 291

org/apache/commons/jexl2/internal/introspection/MethodKey.java

ViolationLine
The class 'MethodKey' has a Cyclomatic Complexity of 6 (Highest = 41).45 - 652
The method isInvocationConvertible() has an NPath complexity of 8164845216 - 278
The method 'isInvocationConvertible' has a Cyclomatic Complexity of 41.216 - 278
Avoid reassigning parameters such as 'actual'217
The method isStrictInvocationConvertible() has an NPath complexity of 75630296 - 345
The method 'isStrictInvocationConvertible' has a Cyclomatic Complexity of 29.296 - 345
Avoid reassigning parameters such as 'actual'297
The class 'Parameters' has a Cyclomatic Complexity of 6 (Highest = 14).376 - 631
Switch statements should have a default label423 - 442
A switch with less than 3 branches is inefficient, use a if statement instead.423 - 442
The method moreSpecific() has an NPath complexity of 1080465 - 519
The method 'moreSpecific' has a Cyclomatic Complexity of 13.465 - 519
Avoid using implementation types like 'LinkedList'; use the interface instead530
The method 'isApplicable' has a Cyclomatic Complexity of 14.551 - 600

org/apache/commons/jexl2/internal/introspection/MethodMap.java

ViolationLine
Use block level rather than method level synchronization42 - 53
Use block level rather than method level synchronization61 - 63
Use block level rather than method level synchronization69 - 72

org/apache/commons/jexl2/internal/Introspector.java

ViolationLine
Avoid if (x != y) ..; else ..;198 - 202

org/apache/commons/jexl2/internal/ListGetExecutor.java

ViolationLine
Avoid unused constructor parameters such as 'is'.41 - 44

org/apache/commons/jexl2/internal/ListSetExecutor.java

ViolationLine
Avoid unused constructor parameters such as 'is'.42 - 45
Avoid unused constructor parameters such as 'value'.42 - 45

org/apache/commons/jexl2/internal/MapGetExecutor.java

ViolationLine
Avoid unused constructor parameters such as 'is'.39 - 42

org/apache/commons/jexl2/internal/MapSetExecutor.java

ViolationLine
Avoid unused constructor parameters such as 'is'.38 - 41
Avoid unused constructor parameters such as 'value'.38 - 41

org/apache/commons/jexl2/internal/MethodExecutor.java

ViolationLine
Avoid reassigning parameters such as 'args'51
Avoid reassigning parameters such as 'actual'129

org/apache/commons/jexl2/Interpreter.java

ViolationLine
This class has a bunch of public methods and attributes17 - 1666
A high number of imports can indicate a high degree of coupling within an object.17 - 1666
This class has too many methods, consider refactoring it.95 - 1666
Avoid really long classes.95 - 1666
The class 'Interpreter' has a Cyclomatic Complexity of 5 (Highest = 31).95 - 1666
Avoid if (x != y) ..; else ..;161
Consider simply returning the value vs storing it in local variable 'value'235
Avoid if (x != y) ..; else ..;289 - 295
The method 'resolveNamespace' has a Cyclomatic Complexity of 11.369 - 405
The String literal "boolean coercion error" appears 4 times in this file; the first occurrence is on line 456456
The method visit() has an NPath complexity of 912000506 - 636
Avoid really long methods.506 - 636
The method 'visit' has a Cyclomatic Complexity of 31.506 - 636
The method 'visit' has a Cyclomatic Complexity of 10.707 - 726
The method visit() has an NPath complexity of 865803 - 857
The method 'visit' has a Cyclomatic Complexity of 24.803 - 857
The String literal "contains" appears 4 times in this file; the first occurrence is on line 827827
Avoid if (x != y) ..; else ..;828 - 835
New exception is thrown in catch block, original stack trace may be lost837
Use equals() to compare object references.846
The method call() has an NPath complexity of 17361007 - 1081
The method 'call' has a Cyclomatic Complexity of 20.1007 - 1081
Use equals() to compare object references.1042
Avoid reassigning parameters such as 'data'1084
Avoid reassigning parameters such as 'data'1084
The method visit() has an NPath complexity of 3281114 - 1164
The method 'visit' has a Cyclomatic Complexity of 14.1114 - 1164
The method visit() has an NPath complexity of 8651206 - 1259
The method 'visit' has a Cyclomatic Complexity of 24.1206 - 1259
Avoid if (x != y) ..; else ..;1230 - 1237
New exception is thrown in catch block, original stack trace may be lost1239
Use equals() to compare object references.1248
The method visit() has an NPath complexity of 5881296 - 1348
The method 'visit' has a Cyclomatic Complexity of 18.1296 - 1348
Avoid if (x != y) ..; else ..;1341 - 1343
The method getAttribute() has an NPath complexity of 2001519 - 1561
The method 'getAttribute' has a Cyclomatic Complexity of 15.1519 - 1561
The method setAttribute() has an NPath complexity of 32401584 - 1645
The method 'setAttribute' has a Cyclomatic Complexity of 20.1584 - 1645

org/apache/commons/jexl2/introspection/Sandbox.java

ViolationLine
This class has too many methods, consider refactoring it.58 - 396
An empty method in an abstract class should be abstract instead172 - 174
Avoid if (x != y) ..; else ..;245
Avoid if (x != y) ..; else ..;279
Avoid if (x != y) ..; else ..;280
Avoid if (x != y) ..; else ..;281

org/apache/commons/jexl2/introspection/SandboxUberspectImpl.java

ViolationLine
Avoid if (x != y) ..; else ..;60 - 64

org/apache/commons/jexl2/introspection/UberspectImpl.java

ViolationLine
This class has too many methods, consider refactoring it.47 - 560
Avoid if (x != y) ..; else ..;125 - 129
Avoid instantiation through private constructors from outside of the constructor's class.126
Avoid instantiation through private constructors from outside of the constructor's class.237
Avoid instantiation through private constructors from outside of the constructor's class.248
Use equals() to compare object references.258
The class 'ConstructorMethod' has a Cyclomatic Complexity of 3 (Highest = 10).365 - 445
Avoid if (x != y) ..; else ..;384 - 388
The method 'tryInvoke' has a Cyclomatic Complexity of 10.399 - 423
Avoid if (x != y) ..; else ..;403 - 407
Use equals() to compare object references.429
Use equals() to compare object references.491
Use equals() to compare object references.550

org/apache/commons/jexl2/JexlArithmetic.java

ViolationLine
This class has too many methods, consider refactoring it.46 - 1144
Avoid really long classes.46 - 1144
The class 'JexlArithmetic' has a Cyclomatic Complexity of 6 (Highest = 27).46 - 1144
The method 'narrowArrayType' has a Cyclomatic Complexity of 15.298 - 350
Avoid if (x != y) ..; else ..;305 - 328
Use equals() to compare object references.364
The method 'divide' has a Cyclomatic Complexity of 10.422 - 456
The method 'mod' has a Cyclomatic Complexity of 10.465 - 499
The method 'negate' has a Cyclomatic Complexity of 11.573 - 602
The method 'compare' has a Cyclomatic Complexity of 24.688 - 742
Use equals() to compare object references.752
Use equals() to compare object references.771
Use equals() to compare object references.787
Use equals() to compare object references.802
Use equals() to compare object references.819
The method 'toInteger' has a Cyclomatic Complexity of 10.857 - 882
Avoid if (x != y) ..; else ..;862 - 866
The method 'toLong' has a Cyclomatic Complexity of 10.890 - 916
Avoid if (x != y) ..; else ..;895 - 899
Avoid if (x != y) ..; else ..;932 - 936
Avoid if (x != y) ..; else ..;975 - 979
Consider simply returning the value vs storing it in local variable 'i'1020
The method narrowNumber() has an NPath complexity of 7361082 - 1143
The method 'narrowNumber' has a Cyclomatic Complexity of 27.1082 - 1143

org/apache/commons/jexl2/JexlEngine.java

ViolationLine
This class has a bunch of public methods and attributes17 - 1369
A high number of imports can indicate a high degree of coupling within an object.17 - 1369
This class has too many methods, consider refactoring it.98 - 1369
Avoid really long classes.98 - 1369
The class 'JexlEngine' has a Cyclomatic Complexity of 3 (Highest = 21).98 - 1369
Avoid reassigning parameters such as 'log'194
Avoid if (x != y) ..; else ..;385
Avoid reassigning parameters such as 'context'601
Avoid reassigning parameters such as 'expr'601
Avoid reassigning parameters such as 'context'656
Avoid reassigning parameters such as 'expr'656
Avoid if (x != y) ..; else ..;699 - 703
Avoid if (x != y) ..; else ..;757 - 761
Avoid if (x != y) ..; else ..;842
Avoid if (x != y) ..; else ..;843
Avoid if (x != y) ..; else ..;852
Avoid if (x != y) ..; else ..;853
Avoid if (x != y) ..; else ..;862
The method getVariables() has an NPath complexity of 228926 - 979
The method 'getVariables' has a Cyclomatic Complexity of 21.926 - 979
Avoid if (x != y) ..; else ..;931
Use equals() to compare object references.971
Avoid if (x != y) ..; else ..;1030 - 1038
Avoid if (x != y) ..; else ..;1074
Avoid if (x != y) ..; else ..;1103 - 1111
Avoid if (x != y) ..; else ..;1127
Private field 'registers' could be made final; it is only initialized in the declaration or constructor.1175
Private field 'parameters' could be made final; it is only initialized in the declaration or constructor.1177
The method 'parse' has a Cyclomatic Complexity of 12.1225 - 1266
Avoid reassigning parameters such as 'frame'1225

org/apache/commons/jexl2/JexlException.java

ViolationLine
Avoid if (x != y) ..; else ..;49
Avoid if (x != y) ..; else ..;62
Avoid if (x != y) ..; else ..;158
Avoid if (x != y) ..; else ..;203

org/apache/commons/jexl2/JexlThreadedArithmetic.java

ViolationLine
Document empty constructor31
Private field 'lenient' could be made final; it is only initialized in the declaration or constructor.33
Private field 'mathContext' could be made final; it is only initialized in the declaration or constructor.35
Private field 'mathScale' could be made final; it is only initialized in the declaration or constructor.37
Use block level rather than method level synchronization61 - 63

org/apache/commons/jexl2/Main.java

ViolationLine
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.29 - 68

org/apache/commons/jexl2/parser/ASTJexlScript.java

ViolationLine
Avoid if (x != y) ..; else ..;62
Avoid if (x != y) ..; else ..;70
Avoid if (x != y) ..; else ..;78
Avoid if (x != y) ..; else ..;86
Avoid if (x != y) ..; else ..;94

org/apache/commons/jexl2/parser/ASTNumberLiteral.java

ViolationLine
Avoid reassigning parameters such as 's'69

org/apache/commons/jexl2/parser/JexlNode.java

ViolationLine
Avoid if (x != y) ..; else ..;60
Deeply nested if..then statements are hard to read78 - 80
Deeply nested if..then statements are hard to read83 - 85
Deeply nested if..then statements are hard to read86 - 88

org/apache/commons/jexl2/parser/JexlParser.java

ViolationLine
Document empty method109 - 110
Avoid if (x != y) ..; else ..;121 - 125

org/apache/commons/jexl2/parser/ParseException.java

ViolationLine
Avoid unused constructor parameters such as 'expectedTokenSequences'.80 - 86
Avoid unused constructor parameters such as 'tokenImage'.80 - 86

org/apache/commons/jexl2/parser/SimpleNode.java

ViolationLine
This class has too many methods, consider refactoring it.34 - 183
Avoid unused constructor parameters such as 'p'.57 - 59
Document empty method62 - 63
Document empty method66 - 67

org/apache/commons/jexl2/parser/StringParser.java

ViolationLine
The class 'StringParser' has a Cyclomatic Complexity of 7 (Highest = 15).36 - 208
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.36 - 208
Document empty constructor38 - 39
The method 'read' has a Cyclomatic Complexity of 12.81 - 110
The method 'escapeString' has a Cyclomatic Complexity of 15.154 - 207

org/apache/commons/jexl2/parser/TokenMgrError.java

ViolationLine
Private field 'errorCode' could be made final; it is only initialized in the declaration or constructor.53
Perhaps 'state' could be replaced by a local variable.58

org/apache/commons/jexl2/scripting/JexlScriptEngine.java

ViolationLine
Avoid if (x != y) ..; else ..;128 - 132
Avoid if (x != y) ..; else ..;143 - 147
Avoid instantiation through private constructors from outside of the constructor's class.215
New exception is thrown in catch block, original stack trace may be lost218
Avoid instantiation through private constructors from outside of the constructor's class.235
New exception is thrown in catch block, original stack trace may be lost237
Non-static initializers are confusing283 - 285
Avoid instantiation through private constructors from outside of the constructor's class.361
New exception is thrown in catch block, original stack trace may be lost364

org/apache/commons/jexl2/scripting/JexlScriptEngineFactory.java

ViolationLine
Position literals first in String comparisons120
Consider simply returning the value vs storing it in local variable 'engine'147

org/apache/commons/jexl2/scripting/Main.java

ViolationLine
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.31 - 69

org/apache/commons/jexl2/UnifiedJEXL.java

ViolationLine
This class has too many methods, consider refactoring it.87 - 1464
Avoid really long classes.87 - 1464
The class 'UnifiedJEXL' has a Cyclomatic Complexity of 5 (Highest = 27).87 - 1464
Perhaps 'index' could be replaced by a local variable.134
Avoid using implementation types like 'ArrayList'; use the interface instead153
Avoid if (x != y) ..; else ..;251
An empty method in an abstract class should be abstract instead258 - 260
An empty method in an abstract class should be abstract instead328 - 330
Avoid reassigning parameters such as 'val'441
Avoid if (x != y) ..; else ..;547
Avoid using implementation types like 'ArrayList'; use the interface instead653
Use equals() to compare object references.712
Consider simply returning the value vs storing it in local variable 'ready'715
The method parseExpression() has an NPath complexity of 212825 - 965
Avoid really long methods.825 - 965
The method 'parseExpression' has a Cyclomatic Complexity of 27.825 - 965
The method parseExpression() has an NCSS line count of 102825 - 965
The default label should be the last label in a switch statement835 - 953
A high ratio of statements to labels in a switch statement. Consider refactoring.835 - 953
The class 'Template' has a Cyclomatic Complexity of 4 (Highest = 13).1049 - 1198
The constructor 'Template' has a Cyclomatic Complexity of 13.1068 - 1114
Avoid if (x != y) ..; else ..;1326 - 1330
Avoid reassigning parameters such as 'sequence'1348
The method 'readTemplate' has a Cyclomatic Complexity of 11.1369 - 1430