Fork me on GitHub

PMD Results

The following document contains the results of PMD 6.13.0.

Violations By Priority

Priority 1

fr/paris/lutece/plugins/wordtemplate/service/InstructionService.java

Rule Violation Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 47–103

Priority 2

fr/paris/lutece/plugins/wordtemplate/service/WordService.java

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'tableCell' 412
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 522
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 571
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 594

Priority 3

fr/paris/lutece/plugins/wordtemplate/business/AbstractInstructionElement.java

Rule Violation Line
UncommentedEmptyConstructor Document empty constructor 49–51
MissingOverride The method 'getRun()' is missing an @Override annotation. 98–101
MissingOverride The method 'setRun(XWPFRun)' is missing an @Override annotation. 107–110

fr/paris/lutece/plugins/wordtemplate/business/IWordInstructionElement.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getRun': the method is declared in an interface type 59
UnnecessaryModifier Unnecessary modifier 'public' on method 'setRun': the method is declared in an interface type 65

fr/paris/lutece/plugins/wordtemplate/exception/WordTemplateException.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 39–71

fr/paris/lutece/plugins/wordtemplate/service/InstructionService.java

Rule Violation Line
ImmutableField Private field '_listInstructionManager' could be made final; it is only initialized in the declaration or constructor. 50
NonThreadSafeSingleton Singleton is not thread safe 64–67
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'element' 85

fr/paris/lutece/plugins/wordtemplate/service/TemplateEngineService.java

Rule Violation Line
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 48–124

fr/paris/lutece/plugins/wordtemplate/service/WordService.java

Rule Violation Line
GodClass Possible God Class (WMC=91, ATFD=36, TCC=0.000%) 62–710
CyclomaticComplexity The class 'WordService' has a total cyclomatic complexity of 91 (highest 8). 62–710
TooManyMethods This class has too many methods, consider refactoring it. 63–710
ConfusingTernary Avoid if (x != y) ..; else ..; 183
ConfusingTernary Avoid if (x != y) ..; else ..; 229
ConfusingTernary Avoid if (x != y) ..; else ..; 280
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 284
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 326
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'newTable' 351
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 444
EmptyWhileStmt Avoid empty while statements 530–531
EmptyWhileStmt Avoid empty while statements 579–580
EmptyWhileStmt Avoid empty while statements 602–603
TooFewBranchesForASwitchStatement A switch with less than three branches is inefficient, use a if statement instead. 698–706
SwitchStmtsShouldHaveDefault Switch statements should have a default label 698–706

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateParser.java

Rule Violation Line
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 70
UnusedLocalVariable Avoid unused local variables such as 'run'. 104
CyclomaticComplexity The method 'formatInstr(XWPFParagraph, int, int)' has a cyclomatic complexity of 12. 191–242
AvoidReassigningLoopVariables Avoid reassigning the loop control variable 'run' 232

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateService.java

Rule Violation Line
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 48–89
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 56
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 71

fr/paris/lutece/plugins/wordtemplate/service/instruction/IInstructionManager.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'isOfType': the method is declared in an interface type 51
UnnecessaryModifier Unnecessary modifier 'public' on method 'createInstruction': the method is declared in an interface type 59
UnnecessaryModifier Unnecessary modifier 'public' on method 'processInstruction': the method is declared in an interface type 66

fr/paris/lutece/plugins/wordtemplate/service/instruction/InterpolationInstructionManager.java

Rule Violation Line
MissingOverride The method 'isOfType(String)' is missing an @Override annotation. 65–70

Priority 4

fr/paris/lutece/plugins/wordtemplate/service/WordService.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'org.apache.poi.xwpf.usermodel.XWPFDocument' 42

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateParser.java

Rule Violation Line
OneDeclarationPerLine Use one line for each declaration, it enhances code readability. 198

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateService.java

Rule Violation Line
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 75–85

Files

fr/paris/lutece/plugins/wordtemplate/business/AbstractInstructionElement.java

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 49–51
MissingOverride The method 'getRun()' is missing an @Override annotation. 3 98–101
MissingOverride The method 'setRun(XWPFRun)' is missing an @Override annotation. 3 107–110

fr/paris/lutece/plugins/wordtemplate/business/IWordInstructionElement.java

Rule Violation Priority Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getRun': the method is declared in an interface type 3 59
UnnecessaryModifier Unnecessary modifier 'public' on method 'setRun': the method is declared in an interface type 3 65

fr/paris/lutece/plugins/wordtemplate/exception/WordTemplateException.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 39–71

fr/paris/lutece/plugins/wordtemplate/service/InstructionService.java

Rule Violation Priority Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 1 47–103
ImmutableField Private field '_listInstructionManager' could be made final; it is only initialized in the declaration or constructor. 3 50
NonThreadSafeSingleton Singleton is not thread safe 3 64–67
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'element' 3 85

fr/paris/lutece/plugins/wordtemplate/service/TemplateEngineService.java

Rule Violation Priority Line
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 3 48–124

fr/paris/lutece/plugins/wordtemplate/service/WordService.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'org.apache.poi.xwpf.usermodel.XWPFDocument' 4 42
GodClass Possible God Class (WMC=91, ATFD=36, TCC=0.000%) 3 62–710
CyclomaticComplexity The class 'WordService' has a total cyclomatic complexity of 91 (highest 8). 3 62–710
TooManyMethods This class has too many methods, consider refactoring it. 3 63–710
ConfusingTernary Avoid if (x != y) ..; else ..; 3 183
ConfusingTernary Avoid if (x != y) ..; else ..; 3 229
ConfusingTernary Avoid if (x != y) ..; else ..; 3 280
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 284
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 326
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'newTable' 3 351
AvoidReassigningParameters Avoid reassigning parameters such as 'tableCell' 2 412
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 444
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 2 522
EmptyWhileStmt Avoid empty while statements 3 530–531
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 2 571
EmptyWhileStmt Avoid empty while statements 3 579–580
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 2 594
EmptyWhileStmt Avoid empty while statements 3 602–603
TooFewBranchesForASwitchStatement A switch with less than three branches is inefficient, use a if statement instead. 3 698–706
SwitchStmtsShouldHaveDefault Switch statements should have a default label 3 698–706

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateParser.java

Rule Violation Priority Line
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 70
UnusedLocalVariable Avoid unused local variables such as 'run'. 3 104
CyclomaticComplexity The method 'formatInstr(XWPFParagraph, int, int)' has a cyclomatic complexity of 12. 3 191–242
OneDeclarationPerLine Use one line for each declaration, it enhances code readability. 4 198
AvoidReassigningLoopVariables Avoid reassigning the loop control variable 'run' 3 232

fr/paris/lutece/plugins/wordtemplate/service/WordTemplateService.java

Rule Violation Priority Line
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 3 48–89
AvoidUncheckedExceptionsInSignatures A method or constructor should not explicitly declare unchecked exceptions in its 'throws' clause 3 56
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 71
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 4 75–85

fr/paris/lutece/plugins/wordtemplate/service/instruction/IInstructionManager.java

Rule Violation Priority Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'isOfType': the method is declared in an interface type 3 51
UnnecessaryModifier Unnecessary modifier 'public' on method 'createInstruction': the method is declared in an interface type 3 59
UnnecessaryModifier Unnecessary modifier 'public' on method 'processInstruction': the method is declared in an interface type 3 66

fr/paris/lutece/plugins/wordtemplate/service/instruction/InterpolationInstructionManager.java

Rule Violation Priority Line
MissingOverride The method 'isOfType(String)' is missing an @Override annotation. 3 65–70