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/example/service/ProjectExtendableResourceService.java

Rule Violation Line
FieldNamingConventions The field name 'MESSAGE_KEY_PROJECT_RESOURCE_TYPE_DESCRIPTION' doesn't match '_[a-z][a-zA-Z0-9]*' 48

Priority 3

fr/paris/lutece/plugins/example/business/ExtendedProject.java

Rule Violation Line
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the _hit field if you want a default access modifier 47
DefaultPackage Use explicit scoping instead of the default package private level 47

fr/paris/lutece/plugins/example/business/Project.java

Rule Violation Line
SingularField Perhaps '_locale' could be replaced by a local variable. 57
UnusedPrivateField Avoid unused private fields such as '_locale'. 57

fr/paris/lutece/plugins/example/business/ProjectDAO.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 164
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 192

fr/paris/lutece/plugins/example/service/ProjectCacheService.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 5457
MissingOverride The method 'getName()' is missing an @Override annotation. 7578
ShortVariable Avoid variables with short names like r 92
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 23 characters appended. 111
ConfusingTernary Avoid if (x != y) ..; else ..; 114121
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 122

fr/paris/lutece/plugins/example/service/ProjectExtendableResourceService.java

Rule Violation Line
CommentRequired Header comments are required 46108
ImmutableField Private field 'MESSAGE_KEY_PROJECT_RESOURCE_TYPE_DESCRIPTION' could be made final; it is only initialized in the declaration or constructor. 48
ShortVariable Avoid variables with short names like s 91
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 's' 92
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strUrl' 106

fr/paris/lutece/plugins/example/web/ManageProjectJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 49102
SingularField Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 65
AddEmptyString Do not add empty strings 96

fr/paris/lutece/plugins/example/web/ProjectJspBean.java

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

fr/paris/lutece/plugins/example/web/ProjectXPage.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 57260
CommentRequired Public method and constructor comments are required 101108
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 103
ConfusingTernary Avoid if (x != y) ..; else ..; 120

fr/paris/lutece/plugins/example/web/rs/ProjectRest.java

Rule Violation Line
CommentRequired Header comments are required 64166
ImmutableField Private field '_mapper' could be made final; it is only initialized in the declaration or constructor. 66
DefaultPackage Use explicit scoping instead of the default package private level 67
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the LOGGER field if you want a default access modifier 67
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 102
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 132
ShortVariable Avoid variables with short names like hs 148

Priority 4

fr/paris/lutece/plugins/example/business/Project.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.io.Serializable' 42

fr/paris/lutece/plugins/example/web/ProjectXPage.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.resource.ExtendableResourcePluginActionManager' 48

fr/paris/lutece/plugins/example/web/rs/ProjectRest.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.HashMap' 37
UnusedImports Avoid unused imports such as 'java.util.Map' 38

Files

fr/paris/lutece/plugins/example/business/ExtendedProject.java

Rule Violation Priority Line
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the _hit field if you want a default access modifier 3 47
DefaultPackage Use explicit scoping instead of the default package private level 3 47

fr/paris/lutece/plugins/example/business/Project.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.io.Serializable' 4 42
SingularField Perhaps '_locale' could be replaced by a local variable. 3 57
UnusedPrivateField Avoid unused private fields such as '_locale'. 3 57

fr/paris/lutece/plugins/example/business/ProjectDAO.java

Rule Violation Priority Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 164
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 192

fr/paris/lutece/plugins/example/service/ProjectCacheService.java

Rule Violation Priority Line
CallSuperInConstructor It is a good practice to call super() in a constructor 3 5457
MissingOverride The method 'getName()' is missing an @Override annotation. 3 7578
ShortVariable Avoid variables with short names like r 3 92
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 23 characters appended. 3 111
ConfusingTernary Avoid if (x != y) ..; else ..; 3 114121
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 122

fr/paris/lutece/plugins/example/service/ProjectExtendableResourceService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 46108
ImmutableField Private field 'MESSAGE_KEY_PROJECT_RESOURCE_TYPE_DESCRIPTION' could be made final; it is only initialized in the declaration or constructor. 3 48
FieldNamingConventions The field name 'MESSAGE_KEY_PROJECT_RESOURCE_TYPE_DESCRIPTION' doesn't match '_[a-z][a-zA-Z0-9]*' 1 48
ShortVariable Avoid variables with short names like s 3 91
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 's' 3 92
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strUrl' 3 106

fr/paris/lutece/plugins/example/web/ManageProjectJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 49102
SingularField Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 3 65
AddEmptyString Do not add empty strings 3 96

fr/paris/lutece/plugins/example/web/ProjectJspBean.java

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

fr/paris/lutece/plugins/example/web/ProjectXPage.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.resource.ExtendableResourcePluginActionManager' 4 48
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 57260
CommentRequired Public method and constructor comments are required 3 101108
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 103
ConfusingTernary Avoid if (x != y) ..; else ..; 3 120

fr/paris/lutece/plugins/example/web/rs/ProjectRest.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.HashMap' 4 37
UnusedImports Avoid unused imports such as 'java.util.Map' 4 38
CommentRequired Header comments are required 3 64166
ImmutableField Private field '_mapper' could be made final; it is only initialized in the declaration or constructor. 3 66
DefaultPackage Use explicit scoping instead of the default package private level 3 67
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the LOGGER field if you want a default access modifier 3 67
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 102
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 132
ShortVariable Avoid variables with short names like hs 3 148