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/mylutece/modules/cas/authentication/CASAuthentication.java

Rule Violation Line
FieldNamingConventions The field name 'cASUserKeyService' doesn't match '_[a-z][a-zA-Z0-9]*' 107
FieldNamingConventions The field name 'ATTRIBUTE_ROLES' doesn't match '_[a-z][a-zA-Z0-9]*' 110
FieldNamingConventions The field name 'USER_MANDATORY_ATTRIBUTES' doesn't match '_[a-z][a-zA-Z0-9]*' 111
FieldNamingConventions The field name 'ROLES_ASSOCIATIONS' doesn't match '_[a-z][a-zA-Z0-9]*' 112
FieldNamingConventions The field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 113

fr/paris/lutece/plugins/mylutece/modules/cas/service/CASService.java

Rule Violation Line
FieldNamingConventions The constant name '_singleton' doesn't match '[A-Z][A-Z_0-9]*' 49

fr/paris/lutece/plugins/mylutece/modules/cas/web/LuteceCASFilter.java

Rule Violation Line
FieldNamingConventions The field name 'noCookieMessageKey' doesn't match '_[a-z][a-zA-Z0-9]*' 77
FieldNamingConventions The field name 'redirectAfterGateway' doesn't match '_[a-z][a-zA-Z0-9]*' 90

Priority 2

fr/paris/lutece/plugins/mylutece/modules/cas/authentication/CASAuthentication.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 319

Priority 3

fr/paris/lutece/plugins/mylutece/modules/cas/authentication/CASAuthentication.java

Rule Violation Line
GodClass Possible God Class (WMC=64, ATFD=30, TCC=1.429%) 74598
ImmutableField Private field 'USER_MANDATORY_ATTRIBUTES' could be made final; it is only initialized in the declaration or constructor. 111
ImmutableField Private field 'ROLES_ASSOCIATIONS' could be made final; it is only initialized in the declaration or constructor. 112
ImmutableField Private field 'ATTRIBUTE_USER_MAPPING' could be made final; it is only initialized in the declaration or constructor. 113
CyclomaticComplexity The constructor 'CASAuthentication()' has a cyclomatic complexity of 10. 118189
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 141150
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 161166
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 177187
MissingOverride The method 'getAuthServiceName()' is missing an @Override annotation. 196204
MissingOverride The method 'getAuthType(HttpServletRequest)' is missing an @Override annotation. 213216
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 248
ShortVariable Avoid variables with short names like ex 251
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 252
MissingOverride The method 'getHttpAuthenticatedUser(HttpServletRequest)' is missing an @Override annotation. 267281
ConfusingTernary Avoid if (x != y) ..; else ..; 302330
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 384
MissingOverride The method 'logout(LuteceUser)' is missing an @Override annotation. 415417
UncommentedEmptyMethodBody Document empty method body 416417
CommentRequired Public method and constructor comments are required 419422
MissingOverride The method 'getRolesByUser(LuteceUser)' is missing an @Override annotation. 419422
MissingOverride The method 'getAnonymousUser()' is missing an @Override annotation. 429432
MissingOverride The method 'isUserInRole(LuteceUser, HttpServletRequest, String)' is missing an @Override annotation. 446467
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 457463
MissingOverride The method 'isExternalAuthentication()' is missing an @Override annotation. 474477
MissingOverride The method 'getName()' is missing an @Override annotation. 483486
MissingOverride The method 'getPluginName()' is missing an @Override annotation. 492495

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASAuthenticationException.java

Rule Violation Line
CommentRequired Header comments are required 3642

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASUserKeyEmptyException.java

Rule Violation Line
CommentRequired Header comments are required 3642

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASUserNotAuthorizedException.java

Rule Violation Line
CommentRequired Header comments are required 3642

fr/paris/lutece/plugins/mylutece/modules/cas/service/CASService.java

Rule Violation Line
ConfusingTernary Avoid if (x != y) ..; else ..; 7683

fr/paris/lutece/plugins/mylutece/modules/cas/service/DefaultCASUserKeyService.java

Rule Violation Line
CommentRequired Header comments are required 3646
CommentRequired Public method and constructor comments are required 4245
MissingOverride The method 'getKey(String, Object)' is missing an @Override annotation. 4245

fr/paris/lutece/plugins/mylutece/modules/cas/service/ICASUserKeyService.java

Rule Violation Line
CommentRequired Header comments are required 3645

fr/paris/lutece/plugins/mylutece/modules/cas/web/LuteceCASFilter.java

Rule Violation Line
RedundantFieldInitializer Avoid using redundant field initializer for 'noCookieMessageKey' 77
RedundantFieldInitializer Avoid using redundant field initializer for 'redirectAfterGateway' 90
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 10. 107161
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 178
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 181
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 183

fr/paris/lutece/plugins/mylutece/modules/cas/web/ParameterGatewayResolver.java

Rule Violation Line
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 91
ConfusingTernary Avoid if (x != y) ..; else ..; 91

Files

fr/paris/lutece/plugins/mylutece/modules/cas/authentication/CASAuthentication.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=64, ATFD=30, TCC=1.429%) 3 74598
FieldNamingConventions The field name 'cASUserKeyService' doesn't match '_[a-z][a-zA-Z0-9]*' 1 107
FieldNamingConventions The field name 'ATTRIBUTE_ROLES' doesn't match '_[a-z][a-zA-Z0-9]*' 1 110
FieldNamingConventions The field name 'USER_MANDATORY_ATTRIBUTES' doesn't match '_[a-z][a-zA-Z0-9]*' 1 111
ImmutableField Private field 'USER_MANDATORY_ATTRIBUTES' could be made final; it is only initialized in the declaration or constructor. 3 111
FieldNamingConventions The field name 'ROLES_ASSOCIATIONS' doesn't match '_[a-z][a-zA-Z0-9]*' 1 112
ImmutableField Private field 'ROLES_ASSOCIATIONS' could be made final; it is only initialized in the declaration or constructor. 3 112
ImmutableField Private field 'ATTRIBUTE_USER_MAPPING' could be made final; it is only initialized in the declaration or constructor. 3 113
FieldNamingConventions The field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 1 113
CyclomaticComplexity The constructor 'CASAuthentication()' has a cyclomatic complexity of 10. 3 118189
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 141150
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 161166
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 177187
MissingOverride The method 'getAuthServiceName()' is missing an @Override annotation. 3 196204
MissingOverride The method 'getAuthType(HttpServletRequest)' is missing an @Override annotation. 3 213216
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 248
ShortVariable Avoid variables with short names like ex 3 251
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 252
MissingOverride The method 'getHttpAuthenticatedUser(HttpServletRequest)' is missing an @Override annotation. 3 267281
ConfusingTernary Avoid if (x != y) ..; else ..; 3 302330
GuardLogStatement Logger calls should be surrounded by log level guards. 2 319
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 384
MissingOverride The method 'logout(LuteceUser)' is missing an @Override annotation. 3 415417
UncommentedEmptyMethodBody Document empty method body 3 416417
CommentRequired Public method and constructor comments are required 3 419422
MissingOverride The method 'getRolesByUser(LuteceUser)' is missing an @Override annotation. 3 419422
MissingOverride The method 'getAnonymousUser()' is missing an @Override annotation. 3 429432
MissingOverride The method 'isUserInRole(LuteceUser, HttpServletRequest, String)' is missing an @Override annotation. 3 446467
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 457463
MissingOverride The method 'isExternalAuthentication()' is missing an @Override annotation. 3 474477
MissingOverride The method 'getName()' is missing an @Override annotation. 3 483486
MissingOverride The method 'getPluginName()' is missing an @Override annotation. 3 492495

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASAuthenticationException.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3642

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASUserKeyEmptyException.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3642

fr/paris/lutece/plugins/mylutece/modules/cas/exception/CASUserNotAuthorizedException.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3642

fr/paris/lutece/plugins/mylutece/modules/cas/service/CASService.java

Rule Violation Priority Line
FieldNamingConventions The constant name '_singleton' doesn't match '[A-Z][A-Z_0-9]*' 1 49
ConfusingTernary Avoid if (x != y) ..; else ..; 3 7683

fr/paris/lutece/plugins/mylutece/modules/cas/service/DefaultCASUserKeyService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3646
CommentRequired Public method and constructor comments are required 3 4245
MissingOverride The method 'getKey(String, Object)' is missing an @Override annotation. 3 4245

fr/paris/lutece/plugins/mylutece/modules/cas/service/ICASUserKeyService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3645

fr/paris/lutece/plugins/mylutece/modules/cas/web/LuteceCASFilter.java

Rule Violation Priority Line
RedundantFieldInitializer Avoid using redundant field initializer for 'noCookieMessageKey' 3 77
FieldNamingConventions The field name 'noCookieMessageKey' doesn't match '_[a-z][a-zA-Z0-9]*' 1 77
RedundantFieldInitializer Avoid using redundant field initializer for 'redirectAfterGateway' 3 90
FieldNamingConventions The field name 'redirectAfterGateway' doesn't match '_[a-z][a-zA-Z0-9]*' 1 90
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 10. 3 107161
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 178
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 181
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 183

fr/paris/lutece/plugins/mylutece/modules/cas/web/ParameterGatewayResolver.java

Rule Violation Priority Line
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 91
ConfusingTernary Avoid if (x != y) ..; else ..; 3 91