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/oauth2/authentication/Oauth2Authentication.java

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

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2LuteceUserSession.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/oauth2/service/Oauth2Service.java

Rule Violation Line
FieldNamingConventions The static field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 96
FieldNamingConventions The static field name 'ATTRIBUTE_USER_KEY_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 99

fr/paris/lutece/plugins/mylutece/modules/oauth2/web/Constants.java

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

Priority 2

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2Service.java

Rule Violation Line
LoggerIsNotStaticFinal The Logger variable declaration does not contain the static and final modifiers 75

Priority 3

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/AuthDataClient.java

Rule Violation Line
DefaultPackage Use explicit scoping instead of the default package private level 106113
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the parse method if you want a default access modifier 106113
CyclomaticComplexity The method 'handleError(HttpServletRequest, HttpServletResponse, String)' has a cyclomatic complexity of 11. 116186
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 146
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 150
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 153

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/AuthDataClientJson.java

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

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/Oauth2Authentication.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 132133
SimplifyConditional No need to check for null before an instanceof 199

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/Oauth2User.java

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

fr/paris/lutece/plugins/mylutece/modules/oauth2/listener/Oauth2LuteceUserSessionListener.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 5152

fr/paris/lutece/plugins/mylutece/modules/oauth2/listener/SessionTrackingModeSetter.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 6061

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/IOauth2LuteceUserSessionService.java

Rule Violation Line
CommentRequired Header comments are required 3645
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/oauth2/service/MyluteceOauth2Plugin.java

Rule Violation Line
UnusedPrivateField Avoid unused private fields such as 'AUTHENTICATION_BEAN_NAME'. 47

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2LuteceUserSession.java

Rule Violation Line
CommentRequired Header comments are required 3678
CommentRequired Public method and constructor comments are required 4247
CommentRequired Public method and constructor comments are required 4952
CommentRequired Public method and constructor comments are required 5457
CommentRequired Public method and constructor comments are required 5962
CommentRequired Public method and constructor comments are required 6467
CommentRequired Public method and constructor comments are required 6972
CommentRequired Public method and constructor comments are required 7477

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2LuteceUserSessionService.java

Rule Violation Line
CommentRequired Header comments are required 43119
CommentRequired Public method and constructor comments are required 5060
NonThreadSafeSingleton Singleton is not thread safe 5257
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 55
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 56
CommentRequired Public method and constructor comments are required 6272
MissingOverride The method 'isLuteceUserUpToDate(String)' is missing an @Override annotation. 6272
CommentRequired Public method and constructor comments are required 7483
MissingOverride The method 'addLuteceUserSession(String, String)' is missing an @Override annotation. 7483
CommentRequired Public method and constructor comments are required 85102
MissingOverride The method 'removeLuteceUserSession(String)' is missing an @Override annotation. 85102
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 9699
MissingOverride The method 'notifyLuteceUserUpdating(String)' is missing an @Override annotation. 104118
CommentRequired Public method and constructor comments are required 104118

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2Service.java

Rule Violation Line
CyclomaticComplexity The method 'getInstance()' has a cyclomatic complexity of 10. 119176
NonThreadSafeSingleton Singleton is not thread safe 121173
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 131
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 146168
NPathComplexity The method 'processAuthentication(HttpServletRequest, Map, Token)' has an NPath complexity of 603 189278
CyclomaticComplexity The method 'processAuthentication(HttpServletRequest, Map, Token)' has a cyclomatic complexity of 16. 189278
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 199206
ConfusingTernary Avoid if (x != y) ..; else ..; 244254
ConfusingTernary Avoid if (x != y) ..; else ..; 289296
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 307
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 311
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 317321

fr/paris/lutece/plugins/mylutece/modules/oauth2/web/MyluteceOauth2Filter.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34320
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 16. 115183
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 119
ConfusingTernary Avoid if (x != y) ..; else ..; 149165
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 203
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 216
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 223
ConfusingTernary Avoid if (x != y) ..; else ..; 297304

Priority 4

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/Oauth2Authentication.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.ArrayList' 38
UnusedImports Avoid unused imports such as 'java.util.stream.Collectors' 42
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.business.LuteceUserRoleDescription' 49
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.business.attribute.AttributeHome' 50
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyLutecePlugin' 52
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.business.role.RoleHome' 56
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 57
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.PluginService' 58

fr/paris/lutece/plugins/mylutece/modules/oauth2/web/MyluteceOauth2Filter.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.HashSet' 40
UnusedImports Avoid unused imports such as 'org.apache.commons.collections.map.HashedMap' 54

Files

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/AuthDataClient.java

Rule Violation Priority Line
DefaultPackage Use explicit scoping instead of the default package private level 3 106113
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the parse method if you want a default access modifier 3 106113
CyclomaticComplexity The method 'handleError(HttpServletRequest, HttpServletResponse, String)' has a cyclomatic complexity of 11. 3 116186
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 146
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 150
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 153

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/AuthDataClientJson.java

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

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/Oauth2Authentication.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.ArrayList' 4 38
UnusedImports Avoid unused imports such as 'java.util.stream.Collectors' 4 42
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.business.LuteceUserRoleDescription' 4 49
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.business.attribute.AttributeHome' 4 50
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyLutecePlugin' 4 52
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.business.role.RoleHome' 4 56
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 4 57
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.PluginService' 4 58
FieldNamingConventions The constant name 'authDataClientName' doesn't match '[A-Z][A-Z_0-9]*' 1 76
UncommentedEmptyMethodBody Document empty method body 3 132133
SimplifyConditional No need to check for null before an instanceof 3 199

fr/paris/lutece/plugins/mylutece/modules/oauth2/authentication/Oauth2User.java

Rule Violation Priority Line
ConfusingTernary Avoid if (x != y) ..; else ..; 3 86

fr/paris/lutece/plugins/mylutece/modules/oauth2/listener/Oauth2LuteceUserSessionListener.java

Rule Violation Priority Line
UncommentedEmptyMethodBody Document empty method body 3 5152

fr/paris/lutece/plugins/mylutece/modules/oauth2/listener/SessionTrackingModeSetter.java

Rule Violation Priority Line
UncommentedEmptyMethodBody Document empty method body 3 6061

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/IOauth2LuteceUserSessionService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3645
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/oauth2/service/MyluteceOauth2Plugin.java

Rule Violation Priority Line
UnusedPrivateField Avoid unused private fields such as 'AUTHENTICATION_BEAN_NAME'. 3 47

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2LuteceUserSession.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3678
CommentRequired Public method and constructor comments are required 3 4247
CommentRequired Public method and constructor comments are required 3 4952
CommentRequired Public method and constructor comments are required 3 5457
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 5962
CommentRequired Public method and constructor comments are required 3 6467
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 6972
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 7477

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2LuteceUserSessionService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 43119
CommentRequired Public method and constructor comments are required 3 5060
NonThreadSafeSingleton Singleton is not thread safe 3 5257
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 55
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 56
CommentRequired Public method and constructor comments are required 3 6272
MissingOverride The method 'isLuteceUserUpToDate(String)' is missing an @Override annotation. 3 6272
CommentRequired Public method and constructor comments are required 3 7483
MissingOverride The method 'addLuteceUserSession(String, String)' is missing an @Override annotation. 3 7483
CommentRequired Public method and constructor comments are required 3 85102
MissingOverride The method 'removeLuteceUserSession(String)' is missing an @Override annotation. 3 85102
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 9699
MissingOverride The method 'notifyLuteceUserUpdating(String)' is missing an @Override annotation. 3 104118
CommentRequired Public method and constructor comments are required 3 104118

fr/paris/lutece/plugins/mylutece/modules/oauth2/service/Oauth2Service.java

Rule Violation Priority Line
LoggerIsNotStaticFinal The Logger variable declaration does not contain the static and final modifiers 2 75
FieldNamingConventions The static field name 'ATTRIBUTE_USER_MAPPING' doesn't match '_[a-z][a-zA-Z0-9]*' 1 96
FieldNamingConventions The static field name 'ATTRIBUTE_USER_KEY_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 1 99
CyclomaticComplexity The method 'getInstance()' has a cyclomatic complexity of 10. 3 119176
NonThreadSafeSingleton Singleton is not thread safe 3 121173
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 131
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 146168
NPathComplexity The method 'processAuthentication(HttpServletRequest, Map, Token)' has an NPath complexity of 603 3 189278
CyclomaticComplexity The method 'processAuthentication(HttpServletRequest, Map, Token)' has a cyclomatic complexity of 16. 3 189278
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 199206
ConfusingTernary Avoid if (x != y) ..; else ..; 3 244254
ConfusingTernary Avoid if (x != y) ..; else ..; 3 289296
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 307
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 311
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 317321

fr/paris/lutece/plugins/mylutece/modules/oauth2/web/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 3965

fr/paris/lutece/plugins/mylutece/modules/oauth2/web/MyluteceOauth2Filter.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34320
UnusedImports Avoid unused imports such as 'java.util.HashSet' 4 40
UnusedImports Avoid unused imports such as 'org.apache.commons.collections.map.HashedMap' 4 54
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 16. 3 115183
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 119
ConfusingTernary Avoid if (x != y) ..; else ..; 3 149165
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 203
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 216
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 223
ConfusingTernary Avoid if (x != y) ..; else ..; 3 297304