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/openam/authentication/OpenamUser.java

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

fr/paris/lutece/plugins/mylutece/modules/openam/service/Constants.java

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

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPIService.java

Rule Violation Line
FieldNamingConventions The constant name '_authenticateAPI' doesn't match '[A-Z][A-Z_0-9]*' 69
FieldNamingConventions The constant name '_sessionAPI' doesn't match '[A-Z][A-Z_0-9]*' 70
FieldNamingConventions The constant name '_usersAPI' doesn't match '[A-Z][A-Z_0-9]*' 71

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamLuteceUserSession.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_strIdSession' doesn't match '[a-z][a-zA-Z0-9]*' 54
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 64
FormalParameterNamingConventions The method parameter name '_bUpToDate' doesn't match '[a-z][a-zA-Z0-9]*' 74

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamService.java

Rule Violation Line
FieldNamingConventions The static field name 'COOKIE_OPENAM_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 75
FieldNamingConventions The static field name 'COOKIE_OPENAM_DOMAIN' doesn't match '_[a-z][a-zA-Z0-9]*' 76
FieldNamingConventions The static field name 'COOKIE_OPENAM_PATH' doesn't match '_[a-z][a-zA-Z0-9]*' 77
FieldNamingConventions The static field name 'COOKIE_OPENAM_MAX_AGE' doesn't match '_[a-z][a-zA-Z0-9]*' 78
FieldNamingConventions The static field name 'COOKIE_OPENAM_SECURE' doesn't match '_[a-z][a-zA-Z0-9]*' 79
FieldNamingConventions The static field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 81
FieldNamingConventions The static field name 'ATTRIBUTE_USER_KEY_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 82

fr/paris/lutece/plugins/mylutece/modules/openam/web/OpenamErrorJsonResponse.java

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

Priority 2

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPI.java

Rule Violation Line
LoggerIsNotStaticFinal The Logger variable declaration does not contain the static and final modifiers 53
GuardLogStatement Logger calls should be surrounded by log level guards. 210

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPIService.java

Rule Violation Line
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 126

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamService.java

Rule Violation Line
GuardLogStatement Logger calls should be surrounded by log level guards. 315
GuardLogStatement Logger calls should be surrounded by log level guards. 469
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 480

Priority 3

fr/paris/lutece/plugins/mylutece/modules/openam/authentication/OpenamAuthentication.java

Rule Violation Line
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 82–84
UncommentedEmptyConstructor Document empty constructor 82–84
CallSuperInConstructor It is a good practice to call super() in a constructor 82–84
CyclomaticComplexity The method 'login(String, String, HttpServletRequest)' has a cyclomatic complexity of 11. 124–176
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 155
ShortVariable Avoid variables with short names like ex 158
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 159

fr/paris/lutece/plugins/mylutece/modules/openam/listener/OpenamLuteceUserSessionListener.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 52–53

fr/paris/lutece/plugins/mylutece/modules/openam/service/IIdentityProviderService.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getIdentityInformations': the method is declared in an interface type 54

fr/paris/lutece/plugins/mylutece/modules/openam/service/IOpenamLuteceUserSessionService.java

Rule Violation Line
CommentRequired Header comments are required 36–45
CommentRequired Public method and constructor comments are required 38
CommentRequired Public method and constructor comments are required 40
CommentRequired Public method and constructor comments are required 42
CommentRequired Public method and constructor comments are required 44

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPI.java

Rule Violation Line
UnusedPrivateField Avoid unused private fields such as 'KEY_ERROR_MSG'. 52
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 223

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPIService.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 91
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 91
ShortVariable Avoid variables with short names like jo 99
LinguisticNaming Linguistics Antipattern - The method 'isValidate' indicates linguistically it returns a boolean, but it returns 'String' 116–132
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 118
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 118
ShortVariable Avoid variables with short names like jo 122
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 143
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 143
ShortVariable Avoid variables with short names like jo 151
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 168–169
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 171
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 171
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 174
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 174
ShortVariable Avoid variables with short names like jo 178

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAuthenticationAgentException.java

Rule Violation Line
CommentRequired Public method and constructor comments are required 45–48
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 45–48

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamLuteceUserSession.java

Rule Violation Line
CommentRequired Header comments are required 36–78
CommentRequired Public method and constructor comments are required 42–47
CommentRequired Public method and constructor comments are required 49–52
CommentRequired Public method and constructor comments are required 54–57
CommentRequired Public method and constructor comments are required 59–62
CommentRequired Public method and constructor comments are required 64–67
CommentRequired Public method and constructor comments are required 69–72
CommentRequired Public method and constructor comments are required 74–77

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamLuteceUserSessionService.java

Rule Violation Line
CommentRequired Header comments are required 43–119
CommentRequired Public method and constructor comments are required 50–60
NonThreadSafeSingleton Singleton is not thread safe 52–57
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 55
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 56
MissingOverride The method 'isLuteceUserUpToDate(String)' is missing an @Override annotation. 62–72
CommentRequired Public method and constructor comments are required 62–72
CommentRequired Public method and constructor comments are required 74–83
MissingOverride The method 'addLuteceUserSession(String, String)' is missing an @Override annotation. 74–83
CommentRequired Public method and constructor comments are required 85–102
MissingOverride The method 'removeLuteceUserSession(String)' is missing an @Override annotation. 85–102
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 96–99
CommentRequired Public method and constructor comments are required 104–118
MissingOverride The method 'notifyLuteceUserUpdating(String)' is missing an @Override annotation. 104–118

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamService.java

Rule Violation Line
NonThreadSafeSingleton Singleton is not thread safe 99–133
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 111
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 118–131
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 122–130
ConfusingTernary Avoid if (x != y) ..; else ..; 147–154
CyclomaticComplexity The method 'doLogin(HttpServletRequest, String, String, OpenamAuthentication)' has a cyclomatic complexity of 10. 170–219
CyclomaticComplexity The method 'getHttpAuthenticatedUser(HttpServletRequest, OpenamAuthentication)' has a cyclomatic complexity of 10. 248–294
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 446
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 446
CommentRequired Public method and constructor comments are required 476–484

fr/paris/lutece/plugins/mylutece/modules/openam/web/MyLuteceOpenamXPage.java

Rule Violation Line
ImmutableField Private field '_openAmAuthentication' could be made final; it is only initialized in the declaration or constructor. 79
LinguisticNaming Linguistics Antipattern - The method 'isUserAuthenticated' indicates linguistically it returns a boolean, but it returns 'String' 88–113
ConfusingTernary Avoid if (x != y) ..; else ..; 98–105
IdenticalCatchBranches 'catch' branch identical to 'LoginException' branch 152–156

fr/paris/lutece/plugins/mylutece/modules/openam/web/OpenamErrorJsonResponse.java

Rule Violation Line
CommentRequired Public method and constructor comments are required 48–51
CommentRequired Public method and constructor comments are required 53–57

fr/paris/lutece/plugins/mylutece/modules/openam/web/OpenamLuteceFilter.java

Rule Violation Line
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 10. 78–130
ConfusingTernary Avoid if (x != y) ..; else ..; 88–102
ConfusingTernary Avoid if (x != y) ..; else ..; 109–126

Priority 4

fr/paris/lutece/plugins/mylutece/modules/openam/authentication/OpenamAuthentication.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.lang.UnsupportedOperationException' due to existing implicit import 'java.lang.*' 198

fr/paris/lutece/plugins/mylutece/modules/openam/listener/OpenamLuteceUserSessionListener.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.security.LuteceUser' 37

Files

fr/paris/lutece/plugins/mylutece/modules/openam/authentication/OpenamAuthentication.java

Rule Violation Priority Line
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 82–84
UncommentedEmptyConstructor Document empty constructor 3 82–84
CallSuperInConstructor It is a good practice to call super() in a constructor 3 82–84
CyclomaticComplexity The method 'login(String, String, HttpServletRequest)' has a cyclomatic complexity of 11. 3 124–176
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 155
ShortVariable Avoid variables with short names like ex 3 158
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 159
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.lang.UnsupportedOperationException' due to existing implicit import 'java.lang.*' 4 198

fr/paris/lutece/plugins/mylutece/modules/openam/authentication/OpenamUser.java

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

fr/paris/lutece/plugins/mylutece/modules/openam/listener/OpenamLuteceUserSessionListener.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.security.LuteceUser' 4 37
UncommentedEmptyMethodBody Document empty method body 3 52–53

fr/paris/lutece/plugins/mylutece/modules/openam/service/Constants.java

Rule Violation Priority Line
ClassNamingConventions The utility class name 'Constants' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 1 39–47

fr/paris/lutece/plugins/mylutece/modules/openam/service/IIdentityProviderService.java

Rule Violation Priority Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getIdentityInformations': the method is declared in an interface type 3 54

fr/paris/lutece/plugins/mylutece/modules/openam/service/IOpenamLuteceUserSessionService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 36–45
CommentRequired Public method and constructor comments are required 3 38
CommentRequired Public method and constructor comments are required 3 40
CommentRequired Public method and constructor comments are required 3 42
CommentRequired Public method and constructor comments are required 3 44

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPI.java

Rule Violation Priority Line
UnusedPrivateField Avoid unused private fields such as 'KEY_ERROR_MSG'. 3 52
LoggerIsNotStaticFinal The Logger variable declaration does not contain the static and final modifiers 2 53
GuardLogStatement Logger calls should be surrounded by log level guards. 2 210
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 223

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAPIService.java

Rule Violation Priority Line
FieldNamingConventions The constant name '_authenticateAPI' doesn't match '[A-Z][A-Z_0-9]*' 1 69
FieldNamingConventions The constant name '_sessionAPI' doesn't match '[A-Z][A-Z_0-9]*' 1 70
FieldNamingConventions The constant name '_usersAPI' doesn't match '[A-Z][A-Z_0-9]*' 1 71
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 91
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 91
ShortVariable Avoid variables with short names like jo 3 99
LinguisticNaming Linguistics Antipattern - The method 'isValidate' indicates linguistically it returns a boolean, but it returns 'String' 3 116–132
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 118
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 118
ShortVariable Avoid variables with short names like jo 3 122
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 2 126
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 143
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 143
ShortVariable Avoid variables with short names like jo 3 151
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 168–169
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 171
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 171
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 174
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 174
ShortVariable Avoid variables with short names like jo 3 178

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamAuthenticationAgentException.java

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 45–48
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 45–48

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamLuteceUserSession.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 36–78
CommentRequired Public method and constructor comments are required 3 42–47
CommentRequired Public method and constructor comments are required 3 49–52
FormalParameterNamingConventions The method parameter name '_strIdSession' doesn't match '[a-z][a-zA-Z0-9]*' 1 54
CommentRequired Public method and constructor comments are required 3 54–57
CommentRequired Public method and constructor comments are required 3 59–62
CommentRequired Public method and constructor comments are required 3 64–67
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 1 64
CommentRequired Public method and constructor comments are required 3 69–72
FormalParameterNamingConventions The method parameter name '_bUpToDate' doesn't match '[a-z][a-zA-Z0-9]*' 1 74
CommentRequired Public method and constructor comments are required 3 74–77

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamLuteceUserSessionService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 43–119
CommentRequired Public method and constructor comments are required 3 50–60
NonThreadSafeSingleton Singleton is not thread safe 3 52–57
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 55
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 56
MissingOverride The method 'isLuteceUserUpToDate(String)' is missing an @Override annotation. 3 62–72
CommentRequired Public method and constructor comments are required 3 62–72
CommentRequired Public method and constructor comments are required 3 74–83
MissingOverride The method 'addLuteceUserSession(String, String)' is missing an @Override annotation. 3 74–83
CommentRequired Public method and constructor comments are required 3 85–102
MissingOverride The method 'removeLuteceUserSession(String)' is missing an @Override annotation. 3 85–102
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 96–99
CommentRequired Public method and constructor comments are required 3 104–118
MissingOverride The method 'notifyLuteceUserUpdating(String)' is missing an @Override annotation. 3 104–118

fr/paris/lutece/plugins/mylutece/modules/openam/service/OpenamService.java

Rule Violation Priority Line
FieldNamingConventions The static field name 'COOKIE_OPENAM_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 1 75
FieldNamingConventions The static field name 'COOKIE_OPENAM_DOMAIN' doesn't match '_[a-z][a-zA-Z0-9]*' 1 76
FieldNamingConventions The static field name 'COOKIE_OPENAM_PATH' doesn't match '_[a-z][a-zA-Z0-9]*' 1 77
FieldNamingConventions The static field name 'COOKIE_OPENAM_MAX_AGE' doesn't match '_[a-z][a-zA-Z0-9]*' 1 78
FieldNamingConventions The static field name 'COOKIE_OPENAM_SECURE' doesn't match '_[a-z][a-zA-Z0-9]*' 1 79
FieldNamingConventions The static field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 1 81
FieldNamingConventions The static field name 'ATTRIBUTE_USER_KEY_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 1 82
NonThreadSafeSingleton Singleton is not thread safe 3 99–133
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 111
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 118–131
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 122–130
ConfusingTernary Avoid if (x != y) ..; else ..; 3 147–154
CyclomaticComplexity The method 'doLogin(HttpServletRequest, String, String, OpenamAuthentication)' has a cyclomatic complexity of 10. 3 170–219
CyclomaticComplexity The method 'getHttpAuthenticatedUser(HttpServletRequest, OpenamAuthentication)' has a cyclomatic complexity of 10. 3 248–294
GuardLogStatement Logger calls should be surrounded by log level guards. 2 315
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 446
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 446
GuardLogStatement Logger calls should be surrounded by log level guards. 2 469
CommentRequired Public method and constructor comments are required 3 476–484
AvoidBranchingStatementAsLastInLoop Avoid using a branching statement as the last in a loop. 2 480

fr/paris/lutece/plugins/mylutece/modules/openam/web/MyLuteceOpenamXPage.java

Rule Violation Priority Line
ImmutableField Private field '_openAmAuthentication' could be made final; it is only initialized in the declaration or constructor. 3 79
LinguisticNaming Linguistics Antipattern - The method 'isUserAuthenticated' indicates linguistically it returns a boolean, but it returns 'String' 3 88–113
ConfusingTernary Avoid if (x != y) ..; else ..; 3 98–105
IdenticalCatchBranches 'catch' branch identical to 'LoginException' branch 3 152–156

fr/paris/lutece/plugins/mylutece/modules/openam/web/OpenamErrorJsonResponse.java

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 48–51
CommentRequired Public method and constructor comments are required 3 53–57
FormalParameterNamingConventions The method parameter name '_strToken' doesn't match '[a-z][a-zA-Z0-9]*' 1 74

fr/paris/lutece/plugins/mylutece/modules/openam/web/OpenamLuteceFilter.java

Rule Violation Priority Line
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 10. 3 78–130
ConfusingTernary Avoid if (x != y) ..; else ..; 3 88–102
ConfusingTernary Avoid if (x != y) ..; else ..; 3 109–126