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/extend/modules/comment/business/AddCommentPosition.java

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

fr/paris/lutece/plugins/extend/modules/comment/business/Comment.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 456
FormalParameterNamingConventions The method parameter name '_nCommentOrder' doesn't match '[a-z][a-zA-Z0-9]*' 495
FormalParameterNamingConventions The method parameter name '_bIsImportant' doesn't match '[a-z][a-zA-Z0-9]*' 514

fr/paris/lutece/plugins/extend/modules/comment/business/CommentFilter.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_strSortedAttributeName' doesn't match '[a-z][a-zA-Z0-9]*' 86
FormalParameterNamingConventions The method parameter name '_bAscSort' doesn't match '[a-z][a-zA-Z0-9]*' 105
FormalParameterNamingConventions The method parameter name '_bPinned' doesn't match '[a-z][a-zA-Z0-9]*' 125
FormalParameterNamingConventions The method parameter name '_bImportant' doesn't match '[a-z][a-zA-Z0-9]*' 144
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 164

fr/paris/lutece/plugins/extend/modules/comment/dashboard/PublicDashboardComment.java

Rule Violation Line
FieldNamingConventions The field name 'strIdComponent' doesn't match '_[a-z][a-zA-Z0-9]*' 55
FormalParameterNamingConventions The method parameter name 'user_id' doesn't match '[a-z][a-zA-Z0-9]*' 76
FormalParameterNamingConventions The method parameter name 'user_id' doesn't match '[a-z][a-zA-Z0-9]*' 90

fr/paris/lutece/plugins/extend/modules/comment/service/CommentListenerService.java

Rule Violation Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 52406

fr/paris/lutece/plugins/extend/modules/comment/util/constants/CommentConstants.java

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

fr/paris/lutece/plugins/extend/modules/comment/web/CommentApp.java

Rule Violation Line
FieldNamingConventions The final field name '_bIsCaptchaEnabled' doesn't match '[a-z][a-zA-Z0-9]*' 147

Priority 2

fr/paris/lutece/plugins/extend/modules/comment/service/CommentListenerService.java

Rule Violation Line
AvoidUsingVolatile Use of modifier volatile is not recommended. 62

fr/paris/lutece/plugins/extend/modules/comment/service/CommentService.java

Rule Violation Line
AvoidReassigningParameters Avoid reassigning parameters such as 'nNbComments' 256

fr/paris/lutece/plugins/extend/modules/comment/web/CommentJspBean.java

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

fr/paris/lutece/plugins/extend/modules/comment/web/component/CommentResourceExtenderComponent.java

Rule Violation Line
AvoidUsingVolatile Use of modifier volatile is not recommended. 116
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 394
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 398

Priority 3

fr/paris/lutece/plugins/extend/modules/comment/business/AddCommentPosition.java

Rule Violation Line
CommentRequired Header comments are required 3972
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 4072
NonThreadSafeSingleton Singleton is not thread safe 6068
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 62

fr/paris/lutece/plugins/extend/modules/comment/business/Comment.java

Rule Violation Line
TooManyFields Too many fields 58559
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 240
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 407

fr/paris/lutece/plugins/extend/modules/comment/business/CommentDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 58748
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 112141
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 296
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 346
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 379
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 383
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 451
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 511
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 547
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 551
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 555
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 727

fr/paris/lutece/plugins/extend/modules/comment/business/ICommentDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 45255

fr/paris/lutece/plugins/extend/modules/comment/business/config/CommentExtenderConfigDAO.java

Rule Violation Line
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 5678

fr/paris/lutece/plugins/extend/modules/comment/dashboard/PublicDashboardComment.java

Rule Violation Line
ImmutableField Private field 'strIdComponent' could be made final; it is only initialized in the declaration or constructor. 55
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 78
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 78
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'lstComment' 97

fr/paris/lutece/plugins/extend/modules/comment/service/CommentAddOnService.java

Rule Violation Line
UnnecessaryReturn Avoid unnecessary return statements 73

fr/paris/lutece/plugins/extend/modules/comment/service/CommentAvatarService.java

Rule Violation Line
NonThreadSafeSingleton Singleton is not thread safe 8792

fr/paris/lutece/plugins/extend/modules/comment/service/CommentListenerService.java

Rule Violation Line
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 59
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 59
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 8191
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 86
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 175
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 243
CyclomaticComplexity The method 'checkComment(String, String, String)' has a cyclomatic complexity of 10. 255291
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 286
CyclomaticComplexity The method 'checkComment(String, String, String, String)' has a cyclomatic complexity of 10. 299334
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 299
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 329
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 376
NonThreadSafeSingleton Singleton is not thread safe 390403
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 397400
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 397

fr/paris/lutece/plugins/extend/modules/comment/service/CommentService.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 70544
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 88102
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 109123
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 283286
UseUnderscoresInNumericLiterals Number 10000 should separate every third digit with an underscore 483
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 487490
MissingOverride The method 'getResourceType(String)' is missing an @Override annotation. 522531
CommentRequired Public method and constructor comments are required 522531
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 526
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 527
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 527

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentListener.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'checkComment': the method is declared in an interface type 98
UnnecessaryModifier Unnecessary modifier 'public' on method 'checkComment': the method is declared in an interface type 109
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 109
UnnecessaryModifier Unnecessary modifier 'public' on method 'canComment': the method is declared in an interface type 122

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentService.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 53389

fr/paris/lutece/plugins/extend/modules/comment/service/extender/CommentResourceExtender.java

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

fr/paris/lutece/plugins/extend/modules/comment/util/annotation/Email.java

Rule Violation Line
UnnecessaryAnnotationValueElement Avoid the use of value in annotations when its the only element 5052
UnnecessaryAnnotationValueElement Avoid the use of value in annotations when its the only element 53

fr/paris/lutece/plugins/extend/modules/comment/util/validator/EmailValidator.java

Rule Violation Line
ImmutableField Private field '_pattern' could be made final; it is only initialized in the declaration or constructor. 54
UncommentedEmptyMethodBody Document empty method body 6162
ShortVariable Avoid variables with short names like m 74

fr/paris/lutece/plugins/extend/modules/comment/web/CommentApp.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34889
GodClass Possible God Class (WMC=88, ATFD=245, TCC=13.187%) 109889
CyclomaticComplexity The class 'CommentApp' has a total cyclomatic complexity of 88 (highest 29). 109889
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 109889
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 10. 154213
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 189
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 189
NPathComplexity The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has an NPath complexity of 4096 228346
ExcessiveMethodLength Avoid really long methods. 228346
NcssCount The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has a NCSS line count of 75. 228346
CyclomaticComplexity The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has a cyclomatic complexity of 13. 228346
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 315316
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 318
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 318
CyclomaticComplexity The method 'getAddCommentPage(HttpServletRequest, String, String)' has a cyclomatic complexity of 11. 380458
ConfusingTernary Avoid if (x != y) ..; else ..; 406456
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 408
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 408
NPathComplexity The method 'doAddComment(HttpServletRequest, String, String)' has an NPath complexity of 734112 473643
NcssCount The method 'doAddComment(HttpServletRequest, String, String)' has a NCSS line count of 78. 473643
CyclomaticComplexity The method 'doAddComment(HttpServletRequest, String, String)' has a cyclomatic complexity of 29. 473643
ExcessiveMethodLength Avoid really long methods. 473643
IdenticalCatchBranches 'catch' branch identical to 'IllegalAccessException' branch 487490
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 518
CollapsibleIfStatements These nested if statements could be combined 551555
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 575
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 620
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 620
EmptyCatchBlock Avoid empty catch blocks 655658
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 704
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 704
NonThreadSafeSingleton Singleton is not thread safe 755758
NonThreadSafeSingleton Singleton is not thread safe 769772
NonThreadSafeSingleton Singleton is not thread safe 783786
NonThreadSafeSingleton Singleton is not thread safe 797800
CyclomaticComplexity The method 'doRemoveComment(HttpServletRequest, String, String)' has a cyclomatic complexity of 16. 814888
NPathComplexity The method 'doRemoveComment(HttpServletRequest, String, String)' has an NPath complexity of 369 814888
EmptyCatchBlock Avoid empty catch blocks 879882

fr/paris/lutece/plugins/extend/modules/comment/web/CommentJspBean.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34591
GodClass Possible God Class (WMC=53, ATFD=202, TCC=32.967%) 80591
ImmutableField Private field '_commentService' could be made final; it is only initialized in the declaration or constructor. 106
ImmutableField Private field '_resourceHistoryService' could be made final; it is only initialized in the declaration or constructor. 107
ImmutableField Private field '_resourceExtenderService' could be made final; it is only initialized in the declaration or constructor. 109
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 133
AvoidDuplicateLiterals The String literal " when updating a comment" appears 4 times in this file; the first occurrence is on line 136 136
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 173
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 212
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 267
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 300
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 300
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 305
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 324
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 325
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 326
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 344347
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 454
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 474
ConfusingTernary Avoid if (x != y) ..; else ..; 521529

fr/paris/lutece/plugins/extend/modules/comment/web/action/ManageCommentsPluginAction.java

Rule Violation Line
UncommentedEmptyMethodBody Document empty method body 8788

fr/paris/lutece/plugins/extend/modules/comment/web/component/CommentResourceExtenderComponent.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34555
UnusedPrivateField Avoid unused private fields such as 'JSP_URL_MANAGE_COMMENTS'. 103
ImmutableField Private field '_nDefaultItemsPerPage' could be made final; it is only initialized in the declaration or constructor. 114
ExcessiveMethodLength Avoid really long methods. 131243
NPathComplexity The method 'getPageAddOn(String, String, String, HttpServletRequest)' has an NPath complexity of 584 131243
NcssCount The method 'getPageAddOn(String, String, String, HttpServletRequest)' has a NCSS line count of 63. 131243
CyclomaticComplexity The method 'getPageAddOn(String, String, String, HttpServletRequest)' has a cyclomatic complexity of 13. 131243
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 158
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 158
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 188191
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 255
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 255
NcssCount The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has a NCSS line count of 121. 286499
ExcessiveMethodLength Avoid really long methods. 286499
NPathComplexity The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has an NPath complexity of 3145730 286499
CyclomaticComplexity The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has a cyclomatic complexity of 27. 286499
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 414415
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 417
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 417
ConfusingTernary Avoid if (x != y) ..; else ..; 430452
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 517
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 517

Priority 4

fr/paris/lutece/plugins/extend/modules/comment/business/Comment.java

Rule Violation Line
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 383386
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 504507

fr/paris/lutece/plugins/extend/modules/comment/business/CommentDAO.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.sql.ResultSet' 50
UnusedImports Avoid unused imports such as 'java.sql.SQLException' 51

fr/paris/lutece/plugins/extend/modules/comment/business/ICommentDAO.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 38

fr/paris/lutece/plugins/extend/modules/comment/business/config/CommentExtenderConfig.java

Rule Violation Line
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 119122
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 140143
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 259262

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentListener.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.Set' 37
UnusedImports Avoid unused imports such as 'javax.validation.ConstraintViolation' 40
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.extend.modules.comment.business.Comment' 42

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentService.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 36
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 46

fr/paris/lutece/plugins/extend/modules/comment/web/CommentApp.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.message.AdminMessage' 74
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.message.AdminMessageService' 75
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.util.mvc.commons.annotations.Action' 90

fr/paris/lutece/plugins/extend/modules/comment/web/CommentJspBean.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.extend.service.extender.config.IResourceExtenderConfigService' 56

Files

fr/paris/lutece/plugins/extend/modules/comment/business/AddCommentPosition.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 3972
ClassNamingConventions The utility class name 'AddCommentPosition' doesn't match '[A-Z][a-zA-Z0-9]+(Utils?|Helper|Home|Service)' 1 3972
UseUtilityClass All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 3 4072
NonThreadSafeSingleton Singleton is not thread safe 3 6068
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 62

fr/paris/lutece/plugins/extend/modules/comment/business/Comment.java

Rule Violation Priority Line
TooManyFields Too many fields 3 58559
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 240
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 383386
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 407
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 1 456
FormalParameterNamingConventions The method parameter name '_nCommentOrder' doesn't match '[a-z][a-zA-Z0-9]*' 1 495
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 504507
FormalParameterNamingConventions The method parameter name '_bIsImportant' doesn't match '[a-z][a-zA-Z0-9]*' 1 514

fr/paris/lutece/plugins/extend/modules/comment/business/CommentDAO.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.sql.ResultSet' 4 50
UnusedImports Avoid unused imports such as 'java.sql.SQLException' 4 51
TooManyMethods This class has too many methods, consider refactoring it. 3 58748
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 112141
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 296
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 346
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 379
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 383
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 451
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 511
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 547
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 551
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 555
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 727

fr/paris/lutece/plugins/extend/modules/comment/business/CommentFilter.java

Rule Violation Priority Line
FormalParameterNamingConventions The method parameter name '_strSortedAttributeName' doesn't match '[a-z][a-zA-Z0-9]*' 1 86
FormalParameterNamingConventions The method parameter name '_bAscSort' doesn't match '[a-z][a-zA-Z0-9]*' 1 105
FormalParameterNamingConventions The method parameter name '_bPinned' doesn't match '[a-z][a-zA-Z0-9]*' 1 125
FormalParameterNamingConventions The method parameter name '_bImportant' doesn't match '[a-z][a-zA-Z0-9]*' 1 144
FormalParameterNamingConventions The method parameter name '_strLuteceUserName' doesn't match '[a-z][a-zA-Z0-9]*' 1 164

fr/paris/lutece/plugins/extend/modules/comment/business/ICommentDAO.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 4 38
TooManyMethods This class has too many methods, consider refactoring it. 3 45255

fr/paris/lutece/plugins/extend/modules/comment/business/config/CommentExtenderConfig.java

Rule Violation Priority Line
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 119122
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 140143
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 259262

fr/paris/lutece/plugins/extend/modules/comment/business/config/CommentExtenderConfigDAO.java

Rule Violation Priority Line
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 5678

fr/paris/lutece/plugins/extend/modules/comment/dashboard/PublicDashboardComment.java

Rule Violation Priority Line
ImmutableField Private field 'strIdComponent' could be made final; it is only initialized in the declaration or constructor. 3 55
FieldNamingConventions The field name 'strIdComponent' doesn't match '_[a-z][a-zA-Z0-9]*' 1 55
FormalParameterNamingConventions The method parameter name 'user_id' doesn't match '[a-z][a-zA-Z0-9]*' 1 76
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 78
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 78
FormalParameterNamingConventions The method parameter name 'user_id' doesn't match '[a-z][a-zA-Z0-9]*' 1 90
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'lstComment' 3 97

fr/paris/lutece/plugins/extend/modules/comment/service/CommentAddOnService.java

Rule Violation Priority Line
UnnecessaryReturn Avoid unnecessary return statements 3 73

fr/paris/lutece/plugins/extend/modules/comment/service/CommentAvatarService.java

Rule Violation Priority Line
NonThreadSafeSingleton Singleton is not thread safe 3 8792

fr/paris/lutece/plugins/extend/modules/comment/service/CommentListenerService.java

Rule Violation Priority Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 1 52406
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 59
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 59
AvoidUsingVolatile Use of modifier volatile is not recommended. 2 62
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 8191
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 86
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 175
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 243
CyclomaticComplexity The method 'checkComment(String, String, String)' has a cyclomatic complexity of 10. 3 255291
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 286
CyclomaticComplexity The method 'checkComment(String, String, String, String)' has a cyclomatic complexity of 10. 3 299334
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 299
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 329
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 376
NonThreadSafeSingleton Singleton is not thread safe 3 390403
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 397400
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 397

fr/paris/lutece/plugins/extend/modules/comment/service/CommentService.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 70544
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 88102
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 109123
AvoidReassigningParameters Avoid reassigning parameters such as 'nNbComments' 2 256
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 283286
UseUnderscoresInNumericLiterals Number 10000 should separate every third digit with an underscore 3 483
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 487490
MissingOverride The method 'getResourceType(String)' is missing an @Override annotation. 3 522531
CommentRequired Public method and constructor comments are required 3 522531
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 526
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 527
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 527

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentListener.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.Set' 4 37
UnusedImports Avoid unused imports such as 'javax.validation.ConstraintViolation' 4 40
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.extend.modules.comment.business.Comment' 4 42
UnnecessaryModifier Unnecessary modifier 'public' on method 'checkComment': the method is declared in an interface type 3 98
UnnecessaryModifier Unnecessary modifier 'public' on method 'checkComment': the method is declared in an interface type 3 109
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 109
UnnecessaryModifier Unnecessary modifier 'public' on method 'canComment': the method is declared in an interface type 3 122

fr/paris/lutece/plugins/extend/modules/comment/service/ICommentService.java

Rule Violation Priority Line
UnusedImports Avoid unused imports such as 'java.util.Collection' 4 36
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 4 46
TooManyMethods This class has too many methods, consider refactoring it. 3 53389

fr/paris/lutece/plugins/extend/modules/comment/service/extender/CommentResourceExtender.java

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

fr/paris/lutece/plugins/extend/modules/comment/util/annotation/Email.java

Rule Violation Priority Line
UnnecessaryAnnotationValueElement Avoid the use of value in annotations when its the only element 3 5052
UnnecessaryAnnotationValueElement Avoid the use of value in annotations when its the only element 3 53

fr/paris/lutece/plugins/extend/modules/comment/util/constants/CommentConstants.java

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

fr/paris/lutece/plugins/extend/modules/comment/util/validator/EmailValidator.java

Rule Violation Priority Line
ImmutableField Private field '_pattern' could be made final; it is only initialized in the declaration or constructor. 3 54
UncommentedEmptyMethodBody Document empty method body 3 6162
ShortVariable Avoid variables with short names like m 3 74

fr/paris/lutece/plugins/extend/modules/comment/web/CommentApp.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34889
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.message.AdminMessage' 4 74
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.service.message.AdminMessageService' 4 75
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.util.mvc.commons.annotations.Action' 4 90
GodClass Possible God Class (WMC=88, ATFD=245, TCC=13.187%) 3 109889
CyclomaticComplexity The class 'CommentApp' has a total cyclomatic complexity of 88 (highest 29). 3 109889
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 109889
FieldNamingConventions The final field name '_bIsCaptchaEnabled' doesn't match '[a-z][a-zA-Z0-9]*' 1 147
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 10. 3 154213
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 189
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 189
NPathComplexity The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has an NPath complexity of 4096 3 228346
ExcessiveMethodLength Avoid really long methods. 3 228346
NcssCount The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has a NCSS line count of 75. 3 228346
CyclomaticComplexity The method 'getViewCommentPageContent(HttpServletRequest, String, String, String)' has a cyclomatic complexity of 13. 3 228346
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 315316
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 318
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 318
CyclomaticComplexity The method 'getAddCommentPage(HttpServletRequest, String, String)' has a cyclomatic complexity of 11. 3 380458
ConfusingTernary Avoid if (x != y) ..; else ..; 3 406456
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 408
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 408
NPathComplexity The method 'doAddComment(HttpServletRequest, String, String)' has an NPath complexity of 734112 3 473643
NcssCount The method 'doAddComment(HttpServletRequest, String, String)' has a NCSS line count of 78. 3 473643
CyclomaticComplexity The method 'doAddComment(HttpServletRequest, String, String)' has a cyclomatic complexity of 29. 3 473643
ExcessiveMethodLength Avoid really long methods. 3 473643
IdenticalCatchBranches 'catch' branch identical to 'IllegalAccessException' branch 3 487490
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 518
CollapsibleIfStatements These nested if statements could be combined 3 551555
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 575
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 620
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 620
EmptyCatchBlock Avoid empty catch blocks 3 655658
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 704
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 704
NonThreadSafeSingleton Singleton is not thread safe 3 755758
NonThreadSafeSingleton Singleton is not thread safe 3 769772
NonThreadSafeSingleton Singleton is not thread safe 3 783786
NonThreadSafeSingleton Singleton is not thread safe 3 797800
CyclomaticComplexity The method 'doRemoveComment(HttpServletRequest, String, String)' has a cyclomatic complexity of 16. 3 814888
NPathComplexity The method 'doRemoveComment(HttpServletRequest, String, String)' has an NPath complexity of 369 3 814888
EmptyCatchBlock Avoid empty catch blocks 3 879882

fr/paris/lutece/plugins/extend/modules/comment/web/CommentJspBean.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34591
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.extend.service.extender.config.IResourceExtenderConfigService' 4 56
GodClass Possible God Class (WMC=53, ATFD=202, TCC=32.967%) 3 80591
ImmutableField Private field '_commentService' could be made final; it is only initialized in the declaration or constructor. 3 106
ImmutableField Private field '_resourceHistoryService' could be made final; it is only initialized in the declaration or constructor. 3 107
ImmutableField Private field '_resourceExtenderService' could be made final; it is only initialized in the declaration or constructor. 3 109
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 133
AvoidDuplicateLiterals The String literal " when updating a comment" appears 4 times in this file; the first occurrence is on line 136 3 136
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 173
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 212
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 267
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 300
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 300
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 2 301
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 305
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 324
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 325
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 326
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 344347
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 2 394
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 454
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 474
ConfusingTernary Avoid if (x != y) ..; else ..; 3 521529

fr/paris/lutece/plugins/extend/modules/comment/web/action/ManageCommentsPluginAction.java

Rule Violation Priority Line
UncommentedEmptyMethodBody Document empty method body 3 8788

fr/paris/lutece/plugins/extend/modules/comment/web/component/CommentResourceExtenderComponent.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34555
UnusedPrivateField Avoid unused private fields such as 'JSP_URL_MANAGE_COMMENTS'. 3 103
ImmutableField Private field '_nDefaultItemsPerPage' could be made final; it is only initialized in the declaration or constructor. 3 114
AvoidUsingVolatile Use of modifier volatile is not recommended. 2 116
ExcessiveMethodLength Avoid really long methods. 3 131243
NPathComplexity The method 'getPageAddOn(String, String, String, HttpServletRequest)' has an NPath complexity of 584 3 131243
NcssCount The method 'getPageAddOn(String, String, String, HttpServletRequest)' has a NCSS line count of 63. 3 131243
CyclomaticComplexity The method 'getPageAddOn(String, String, String, HttpServletRequest)' has a cyclomatic complexity of 13. 3 131243
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 158
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 158
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 188191
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 255
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 255
NcssCount The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has a NCSS line count of 121. 3 286499
ExcessiveMethodLength Avoid really long methods. 3 286499
NPathComplexity The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has an NPath complexity of 3145730 3 286499
CyclomaticComplexity The method 'getInfoHtml(ResourceExtenderDTO, Locale, HttpServletRequest)' has a cyclomatic complexity of 27. 3 286499
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 2 394
BooleanInstantiation Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE or call Boolean.valueOf() instead. 2 398
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 414415
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 417
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 417
ConfusingTernary Avoid if (x != y) ..; else ..; 3 430452
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 517
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 517