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/plugin/modules/sample/business/IProjectDAO.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_plugin' doesn't match '[a-z][a-zA-Z0-9]*' 106

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleChoiceFinder.java

Rule Violation Line
ClassNamingConventions The utility class name 'SampleChoiceFinder' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 6–20

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleDateIntervals.java

Rule Violation Line
ClassNamingConventions The utility class name 'SampleDateIntervals' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 8–64

Priority 3

fr/paris/lutece/plugins/plugin/modules/sample/business/ProjectDAO.java

Rule Violation Line
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 230–232

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleChoiceFinder.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. 6–20
CommentRequired Header comments are required 6–20
CommentRequired Public method and constructor comments are required 8–19
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'topChoice' 18

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleDateIntervals.java

Rule Violation Line
CommentRequired Header comments are required 8–64
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. 8–64
CommentRequired Public method and constructor comments are required 10–63
CyclomaticComplexity The method 'intervalChoices(String)' has a cyclomatic complexity of 14. 10–63
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 16
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 17
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 17
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 18
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 18
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 19
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 19
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 20
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 20
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 21
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 21
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 22
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 22
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 23
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 41
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 55

fr/paris/lutece/plugins/plugin/modules/sample/web/AbstractManageSampleJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 50–110
DefaultPackage Use explicit scoping instead of the default package private level 109
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the getItemsFromIds method if you want a default access modifier 109

fr/paris/lutece/plugins/plugin/modules/sample/web/ProjectJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 62–298
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 120
DefaultPackage Use explicit scoping instead of the default package private level 137–146
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the getItemsFromIds method if you want a default access modifier 138–146
ConfusingTernary Avoid if (x != y) ..; else ..; 165

fr/paris/lutece/plugins/plugin/modules/sample/web/ProjectXPage.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 62–256
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 109
ConfusingTernary Avoid if (x != y) ..; else ..; 127

Priority 4

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleDateIntervals.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.HashMap' 3
UnusedImports Avoid unused imports such as 'java.util.Map' 5
UnusedImports Avoid unused imports such as 'java.util.TreeMap' 6

Files

fr/paris/lutece/plugins/plugin/modules/sample/business/IProjectDAO.java

Rule Violation Priority Line
FormalParameterNamingConventions The method parameter name '_plugin' doesn't match '[a-z][a-zA-Z0-9]*' 1 106

fr/paris/lutece/plugins/plugin/modules/sample/business/ProjectDAO.java

Rule Violation Priority Line
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 230–232

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleChoiceFinder.java

Rule Violation Priority Line
ClassNamingConventions The utility class name 'SampleChoiceFinder' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 1 6–20
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 6–20
CommentRequired Header comments are required 3 6–20
CommentRequired Public method and constructor comments are required 3 8–19
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'topChoice' 3 18

fr/paris/lutece/plugins/plugin/modules/sample/service/SampleDateIntervals.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.HashMap' 4 3
UnusedImports Avoid unused imports such as 'java.util.Map' 4 5
UnusedImports Avoid unused imports such as 'java.util.TreeMap' 4 6
CommentRequired Header comments are required 3 8–64
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 8–64
ClassNamingConventions The utility class name 'SampleDateIntervals' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 1 8–64
CommentRequired Public method and constructor comments are required 3 10–63
CyclomaticComplexity The method 'intervalChoices(String)' has a cyclomatic complexity of 14. 3 10–63
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 16
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 17
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 17
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 18
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 18
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 19
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 19
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 20
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 20
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 21
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 21
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 22
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 22
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 23
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 41
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 55

fr/paris/lutece/plugins/plugin/modules/sample/web/AbstractManageSampleJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 50–110
DefaultPackage Use explicit scoping instead of the default package private level 3 109
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the getItemsFromIds method if you want a default access modifier 3 109

fr/paris/lutece/plugins/plugin/modules/sample/web/ProjectJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 62–298
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 120
DefaultPackage Use explicit scoping instead of the default package private level 3 137–146
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the getItemsFromIds method if you want a default access modifier 3 138–146
ConfusingTernary Avoid if (x != y) ..; else ..; 3 165

fr/paris/lutece/plugins/plugin/modules/sample/web/ProjectXPage.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 62–256
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 109
ConfusingTernary Avoid if (x != y) ..; else ..; 3 127