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/myluteceaccessrules/business/Rule.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_strBackUrlParameter' doesn't match '[a-z][a-zA-Z0-9]*' 334
FormalParameterNamingConventions The method parameter name '_nPriorityOrder' doesn't match '[a-z][a-zA-Z0-9]*' 372
FormalParameterNamingConventions The method parameter name '_bEncodeBackUrl' doesn't match '[a-z][a-zA-Z0-9]*' 390

Priority 3

fr/paris/lutece/plugins/myluteceaccessrules/service/AccessRulesCacheService.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 1417

fr/paris/lutece/plugins/myluteceaccessrules/service/AccessRulesService.java

Rule Violation Line
UnusedPrivateField Avoid unused private fields such as 'MARK_LOCALE'. 93
UnusedPrivateField Avoid unused private fields such as 'MARK_WEBAPP_URL'. 96
RedundantFieldInitializer Avoid using redundant field initializer for '_singleton' 126
NonThreadSafeSingleton Singleton is not thread safe 147154
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 169
SimplifiedTernary Ternary operators that can be simplified with || or && 249
ConfusingTernary Avoid if (x != y) ..; else ..; 249
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 281285
ConfusingTernary Avoid if (x != y) ..; else ..; 319326
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 361
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 365
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 366
ConfusingTernary Avoid if (x != y) ..; else ..; 373387
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 418
ConfusingTernary Avoid if (x != y) ..; else ..; 446

fr/paris/lutece/plugins/myluteceaccessrules/web/AbstractManageRulesJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 5098

fr/paris/lutece/plugins/myluteceaccessrules/web/AccessRulesFilter.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 7374
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 11. 89134
ConfusingTernary Avoid if (x != y) ..; else ..; 101
UnusedPrivateMethod Avoid unused private methods such as 'isInPublicUrlList(HttpServletRequest)'. 172

fr/paris/lutece/plugins/myluteceaccessrules/web/RuleJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 67680
TooManyMethods This class has too many methods, consider refactoring it. 68680
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 212
ConfusingTernary Avoid if (x != y) ..; else ..; 231
AvoidDuplicateLiterals The String literal "Invalid security token" appears 4 times in this file; the first occurrence is on line 261 261
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 539
CollapsibleIfStatements These nested if statements could be combined 554559
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 583

Priority 4

fr/paris/lutece/plugins/myluteceaccessrules/business/Rule.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.List' 37
UnusedImports Avoid unused imports such as 'javax.validation.constraints.Null' 40
ShortClassName Avoid short class names like Rule 51393
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 189192

fr/paris/lutece/plugins/myluteceaccessrules/service/AccessRulesService.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 40
UnusedImports Avoid unused imports such as 'javax.servlet.http.HttpSession' 46
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyLuteceUserService' 50
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyluteceExternalRoleService' 51

fr/paris/lutece/plugins/myluteceaccessrules/web/RuleJspBean.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.Arrays' 37
UnusedImports Avoid unused imports such as 'java.util.Comparator' 38
UnusedImports Avoid unused imports such as 'java.util.Optional' 41
UnusedImports Avoid unused imports such as 'java.util.stream.Collectors' 42
UnusedImports Avoid unused imports such as 'fr.paris.lutece.util.ReferenceItem' 58

Files

fr/paris/lutece/plugins/myluteceaccessrules/business/Rule.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.List' 4 37
UnusedImports Avoid unused imports such as 'javax.validation.constraints.Null' 4 40
ShortClassName Avoid short class names like Rule 4 51393
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 189192
FormalParameterNamingConventions The method parameter name '_strBackUrlParameter' doesn't match '[a-z][a-zA-Z0-9]*' 1 334
FormalParameterNamingConventions The method parameter name '_nPriorityOrder' doesn't match '[a-z][a-zA-Z0-9]*' 1 372
FormalParameterNamingConventions The method parameter name '_bEncodeBackUrl' doesn't match '[a-z][a-zA-Z0-9]*' 1 390

fr/paris/lutece/plugins/myluteceaccessrules/service/AccessRulesCacheService.java

Rule Violation Priority Line
CallSuperInConstructor It is a good practice to call super() in a constructor 3 1417

fr/paris/lutece/plugins/myluteceaccessrules/service/AccessRulesService.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 4 40
UnusedImports Avoid unused imports such as 'javax.servlet.http.HttpSession' 4 46
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyLuteceUserService' 4 50
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.mylutece.service.MyluteceExternalRoleService' 4 51
UnusedPrivateField Avoid unused private fields such as 'MARK_LOCALE'. 3 93
UnusedPrivateField Avoid unused private fields such as 'MARK_WEBAPP_URL'. 3 96
RedundantFieldInitializer Avoid using redundant field initializer for '_singleton' 3 126
NonThreadSafeSingleton Singleton is not thread safe 3 147154
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 169
SimplifiedTernary Ternary operators that can be simplified with || or && 3 249
ConfusingTernary Avoid if (x != y) ..; else ..; 3 249
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 281285
ConfusingTernary Avoid if (x != y) ..; else ..; 3 319326
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 3 361
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 3 365
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 366
ConfusingTernary Avoid if (x != y) ..; else ..; 3 373387
SimplifyStartsWith This call to String.startsWith can be rewritten using String.charAt(0) 3 418
ConfusingTernary Avoid if (x != y) ..; else ..; 3 446

fr/paris/lutece/plugins/myluteceaccessrules/web/AbstractManageRulesJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 5098

fr/paris/lutece/plugins/myluteceaccessrules/web/AccessRulesFilter.java

Rule Violation Priority Line
UncommentedEmptyMethodBody Document empty method body 3 7374
CyclomaticComplexity The method 'doFilter(ServletRequest, ServletResponse, FilterChain)' has a cyclomatic complexity of 11. 3 89134
ConfusingTernary Avoid if (x != y) ..; else ..; 3 101
UnusedPrivateMethod Avoid unused private methods such as 'isInPublicUrlList(HttpServletRequest)'. 3 172

fr/paris/lutece/plugins/myluteceaccessrules/web/RuleJspBean.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.Arrays' 4 37
UnusedImports Avoid unused imports such as 'java.util.Comparator' 4 38
UnusedImports Avoid unused imports such as 'java.util.Optional' 4 41
UnusedImports Avoid unused imports such as 'java.util.stream.Collectors' 4 42
UnusedImports Avoid unused imports such as 'fr.paris.lutece.util.ReferenceItem' 4 58
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 67680
TooManyMethods This class has too many methods, consider refactoring it. 3 68680
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 212
ConfusingTernary Avoid if (x != y) ..; else ..; 3 231
AvoidDuplicateLiterals The String literal "Invalid security token" appears 4 times in this file; the first occurrence is on line 261 3 261
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 539
CollapsibleIfStatements These nested if statements could be combined 3 554559
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 583