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 47103

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 4951
MissingOverride The method 'getRun()' is missing an @Override annotation. 98101
MissingOverride The method 'setRun(XWPFRun)' is missing an @Override annotation. 107110

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 3971

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 6467
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. 48124

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

Rule Violation Line
GodClass Possible God Class (WMC=91, ATFD=36, TCC=0.000%) 62710
CyclomaticComplexity The class 'WordService' has a total cyclomatic complexity of 91 (highest 8). 62710
TooManyMethods This class has too many methods, consider refactoring it. 63710
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 530531
EmptyWhileStmt Avoid empty while statements 579580
EmptyWhileStmt Avoid empty while statements 602603
TooFewBranchesForASwitchStatement A switch with less than three branches is inefficient, use a if statement instead. 698706
SwitchStmtsShouldHaveDefault Switch statements should have a default label 698706

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. 191242
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. 4889
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. 6570

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. 7585

Files

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

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 4951
MissingOverride The method 'getRun()' is missing an @Override annotation. 3 98101
MissingOverride The method 'setRun(XWPFRun)' is missing an @Override annotation. 3 107110

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 3971

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

Rule Violation Priority Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 1 47103
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 6467
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 48124

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 62710
CyclomaticComplexity The class 'WordService' has a total cyclomatic complexity of 91 (highest 8). 3 62710
TooManyMethods This class has too many methods, consider refactoring it. 3 63710
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 530531
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 2 571
EmptyWhileStmt Avoid empty while statements 3 579580
AvoidReassigningParameters Avoid reassigning parameters such as 'pos' 2 594
EmptyWhileStmt Avoid empty while statements 3 602603
TooFewBranchesForASwitchStatement A switch with less than three branches is inefficient, use a if statement instead. 3 698706
SwitchStmtsShouldHaveDefault Switch statements should have a default label 3 698706

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 191242
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 4889
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 7585

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 6570