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/greetingscard/business/GreetingsCardTemplateHome.java

Rule Violation Line
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 148

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardService.java

Rule Violation Line
FieldNamingConventions The public constant name 'beanName' doesn't match '[A-Z][A-Z_0-9]*' 57

Priority 3

fr/paris/lutece/plugins/greetingscard/business/GreetingsCard.java

Rule Violation Line
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 7880
UncommentedEmptyConstructor Document empty constructor 7880
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 321325
CommentRequired Public method and constructor comments are required 330337

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchive.java

Rule Violation Line
CommentRequired Public method and constructor comments are required 166178

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveDAO.java

Rule Violation Line
ConfusingTernary Avoid if (x != y) ..; else ..; 7583
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 131
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 157
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 259

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveHome.java

Rule Violation Line
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. 48153

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java

Rule Violation Line
MissingStaticMethodInNonInstantiatableClass Class cannot be instantiated and does not provide any static methods or fields 51640
TooManyMethods This class has too many methods, consider refactoring it. 52640
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 140
ConfusingTernary Avoid if (x != y) ..; else ..; 160179
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 218261
DefaultPackage Use explicit scoping instead of the default package private level 218261
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 273
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 307
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 336
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 367
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 393
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 407
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 424
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 443
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 469
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 485
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 502
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 525
AssignmentInOperand Avoid assignments in operands 563
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 563
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 617

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardHome.java

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

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardStatistic.java

Rule Violation Line
CommentRequired Public method and constructor comments are required 156159
CommentRequired Public method and constructor comments are required 161164

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplate.java

Rule Violation Line
UncommentedEmptyConstructor Document empty constructor 5658
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 5658
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 147
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 195198

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateDAO.java

Rule Violation Line
MissingStaticMethodInNonInstantiatableClass Class cannot be instantiated and does not provide any static methods or fields 46248
MissingOverride The method 'insert(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 7196
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 104112
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 121153
ConfusingTernary Avoid if (x != y) ..; else ..; 130148
MissingOverride The method 'store(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 161186
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 194213
DefaultPackage Use explicit scoping instead of the default package private level 194213
MissingOverride The method 'findAll(Plugin)' is missing an @Override annotation. 220247
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 224

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateHome.java

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

fr/paris/lutece/plugins/greetingscard/business/IGreetingsCardArchiveDAO.java

Rule Violation Line
CommentRequired Header comments are required 41108

fr/paris/lutece/plugins/greetingscard/business/IGreetingsCardDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 50156
UnnecessaryModifier Unnecessary modifier 'public' on method 'findByTemplateAndDate': the method is declared in an interface type 154

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardResourceIdService.java

Rule Violation Line
ConfusingTernary Avoid if (x != y) ..; else ..; 94
ShortVariable Avoid variables with short names like rt 103
ShortVariable Avoid variables with short names like p 109

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardService.java

Rule Violation Line
CyclomaticComplexity The method 'archiveGreetingsCards(int, int, Date, Date, Plugin)' has a cyclomatic complexity of 11. 76154
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 83
AssignmentInOperand Avoid assignments in operands 99
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 165168

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardStatusUpdaterDaemon.java

Rule Violation Line
ImmutableField Private field '_greetingsCardService' could be made final; it is only initialized in the declaration or constructor. 77
CyclomaticComplexity The method 'run()' has a cyclomatic complexity of 10. 83165
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 74 characters appended. 86
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 103
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 169

fr/paris/lutece/plugins/greetingscard/web/GreetingsCardApp.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34559
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 76559
UnusedPrivateField Avoid unused private fields such as 'MARK_FORMAT'. 83
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 148150
UncommentedEmptyConstructor Document empty constructor 148150
CallSuperInConstructor It is a good practice to call super() in a constructor 148150
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 161256
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 20. 161256
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 282
ShortVariable Avoid variables with short names like t 301
NPathComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has an NPath complexity of 384 315392
CyclomaticComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has a cyclomatic complexity of 10. 315392
ConfusingTernary Avoid if (x != y) ..; else ..; 319
ConfusingTernary Avoid if (x != y) ..; else ..; 320
ConfusingTernary Avoid if (x != y) ..; else ..; 321
ConfusingTernary Avoid if (x != y) ..; else ..; 322
ConfusingTernary Avoid if (x != y) ..; else ..; 323
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 345
ShortVariable Avoid variables with short names like t 386
ExcessiveMethodLength Avoid really long methods. 403537
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a cyclomatic complexity of 13. 403537
NcssCount The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a NCSS line count of 87. 403537
AvoidReassigningLoopVariables Avoid reassigning the loop control variable 'strRecipient' 444
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 486
CollapsibleIfStatements These nested if statements could be combined 505532
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 511
ShortVariable Avoid variables with short names like i 512
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 515
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 518
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 522

fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 342144
ExcessiveClassLength Avoid really long classes. 1132144
CyclomaticComplexity The class 'GreetingsCardJspBean' has a total cyclomatic complexity of 191 (highest 22). 1132144
TooManyMethods This class has too many methods, consider refactoring it. 1142144
ImmutableField Private field '_greetingsCardService' could be made final; it is only initialized in the declaration or constructor. 296
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 301303
CallSuperInConstructor It is a good practice to call super() in a constructor 301303
UncommentedEmptyConstructor Document empty constructor 301303
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 341
ShortVariable Avoid variables with short names like t 349
ConfusingTernary Avoid if (x != y) ..; else ..; 363374
ConfusingTernary Avoid if (x != y) ..; else ..; 367374
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 395
ShortVariable Avoid variables with short names like t 400
CyclomaticComplexity The method 'doCreateGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 18. 412520
ExcessiveMethodLength Avoid really long methods. 412520
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 415
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 544
ShortVariable Avoid variables with short names like t 563
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 577
ExcessiveMethodLength Avoid really long methods. 577709
NPathComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has an NPath complexity of 6482 577709
CyclomaticComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 20. 577709
NcssCount The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a NCSS line count of 62. 577709
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 580
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 594
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 595
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 596
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 597
CommentRequired Public method and constructor comments are required 711739
NPathComplexity The method 'getStatistics(HttpServletRequest)' has an NPath complexity of 864 811975
CyclomaticComplexity The method 'getStatistics(HttpServletRequest)' has a cyclomatic complexity of 13. 811975
NcssCount The method 'getStatistics(HttpServletRequest)' has a NCSS line count of 105. 811975
ExcessiveMethodLength Avoid really long methods. 811975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 851
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 912914
AvoidDuplicateLiterals The String literal "statsTableManager1" appears 4 times in this file; the first occurrence is on line 924 924
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 927929
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 955
ShortVariable Avoid variables with short names like t 968
CyclomaticComplexity The method 'getGlobalStatistics(HttpServletRequest)' has a cyclomatic complexity of 19. 9831185
ExcessiveMethodLength Avoid really long methods. 9831185
NPathComplexity The method 'getGlobalStatistics(HttpServletRequest)' has an NPath complexity of 16320 9831185
NcssCount The method 'getGlobalStatistics(HttpServletRequest)' has a NCSS line count of 128. 9831185
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1021
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1023
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1024
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1024
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1025
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1025
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 11301132
AvoidDuplicateLiterals The String literal "globalStatsTableManager1" appears 4 times in this file; the first occurrence is on line 1,143 1143
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 11461148
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1167
ShortVariable Avoid variables with short names like t 1178
ExcessiveMethodLength Avoid really long methods. 11961393
NPathComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has an NPath complexity of 3200 11961393
CyclomaticComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a cyclomatic complexity of 15. 11961393
NcssCount The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a NCSS line count of 111. 11961393
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1212
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1220
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1221
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1223
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1223
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 1224
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1224
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1360
ShortVariable Avoid variables with short names like t 1379
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1403
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1466
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1474
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has a cyclomatic complexity of 22. 14921671
NcssCount The method 'doSendGreetingsCard(HttpServletRequest)' has a NCSS line count of 102. 14921671
NPathComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has an NPath complexity of 57024 14921671
ExcessiveMethodLength Avoid really long methods. 14921671
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1497
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1498
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 1509
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1522
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1529
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1533
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1534
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 15351536
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 15631564
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1566
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1567
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1568
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1568
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 15721582
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 15911666
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1635
CollapsibleIfStatements These nested if statements could be combined 16541663
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1690
CyclomaticComplexity The method 'doExportGreetingsCard(HttpServletRequest, HttpServletResponse)' has a cyclomatic complexity of 12. 17151791
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 1739
ShortVariable Avoid variables with short names like sb 1741
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 1758
ShortVariable Avoid variables with short names like sb 1760
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1807
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1835
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1836
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1911
ConfusingTernary Avoid if (x != y) ..; else ..; 19661973
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 2037
AssignmentInOperand Avoid assignments in operands 2047
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 20492052
UseArraysAsList Use asList instead of tight loops 2051

Priority 4

fr/paris/lutece/plugins/greetingscard/business/GreetingsCard.java

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

fr/paris/lutece/plugins/greetingscard/web/GreetingsCardApp.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.l10n.LocaleService' 56
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.xpages.XPageApplication' 58

Files

fr/paris/lutece/plugins/greetingscard/business/GreetingsCard.java

Rule Violation Priority Line
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 7880
UncommentedEmptyConstructor Document empty constructor 3 7880
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 295298
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 3 321325
CommentRequired Public method and constructor comments are required 3 330337

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchive.java

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 166178

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveDAO.java

Rule Violation Priority Line
ConfusingTernary Avoid if (x != y) ..; else ..; 3 7583
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 131
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 157
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 259

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveHome.java

Rule Violation Priority Line
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 48153

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java

Rule Violation Priority Line
MissingStaticMethodInNonInstantiatableClass Class cannot be instantiated and does not provide any static methods or fields 3 51640
TooManyMethods This class has too many methods, consider refactoring it. 3 52640
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 140
ConfusingTernary Avoid if (x != y) ..; else ..; 3 160179
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 218261
DefaultPackage Use explicit scoping instead of the default package private level 3 218261
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 273
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 307
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 336
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 367
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 393
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 407
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 424
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 443
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 469
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 485
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 502
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 525
AssignmentInOperand Avoid assignments in operands 3 563
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 563
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 617

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardHome.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 49210

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardStatistic.java

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 156159
CommentRequired Public method and constructor comments are required 3 161164

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplate.java

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 5658
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 5658
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 147
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 3 195198

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateDAO.java

Rule Violation Priority Line
MissingStaticMethodInNonInstantiatableClass Class cannot be instantiated and does not provide any static methods or fields 3 46248
MissingOverride The method 'insert(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 3 7196
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 3 104112
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 3 121153
ConfusingTernary Avoid if (x != y) ..; else ..; 3 130148
MissingOverride The method 'store(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 3 161186
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 194213
DefaultPackage Use explicit scoping instead of the default package private level 3 194213
MissingOverride The method 'findAll(Plugin)' is missing an @Override annotation. 3 220247
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 224

fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateHome.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 56291
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 148

fr/paris/lutece/plugins/greetingscard/business/IGreetingsCardArchiveDAO.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 41108

fr/paris/lutece/plugins/greetingscard/business/IGreetingsCardDAO.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 50156
UnnecessaryModifier Unnecessary modifier 'public' on method 'findByTemplateAndDate': the method is declared in an interface type 3 154

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardResourceIdService.java

Rule Violation Priority Line
ConfusingTernary Avoid if (x != y) ..; else ..; 3 94
ShortVariable Avoid variables with short names like rt 3 103
ShortVariable Avoid variables with short names like p 3 109

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardService.java

Rule Violation Priority Line
FieldNamingConventions The public constant name 'beanName' doesn't match '[A-Z][A-Z_0-9]*' 1 57
CyclomaticComplexity The method 'archiveGreetingsCards(int, int, Date, Date, Plugin)' has a cyclomatic complexity of 11. 3 76154
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 83
AssignmentInOperand Avoid assignments in operands 3 99
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 3 165168

fr/paris/lutece/plugins/greetingscard/service/GreetingsCardStatusUpdaterDaemon.java

Rule Violation Priority Line
ImmutableField Private field '_greetingsCardService' could be made final; it is only initialized in the declaration or constructor. 3 77
CyclomaticComplexity The method 'run()' has a cyclomatic complexity of 10. 3 83165
InsufficientStringBufferDeclaration StringBuffer constructor is initialized with size 16, but has at least 74 characters appended. 3 86
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 103
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 169

fr/paris/lutece/plugins/greetingscard/web/GreetingsCardApp.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34559
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.l10n.LocaleService' 4 56
UnusedImports Avoid unused imports such as 'fr.paris.lutece.portal.web.xpages.XPageApplication' 4 58
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 76559
UnusedPrivateField Avoid unused private fields such as 'MARK_FORMAT'. 3 83
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 148150
UncommentedEmptyConstructor Document empty constructor 3 148150
CallSuperInConstructor It is a good practice to call super() in a constructor 3 148150
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 3 161256
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 20. 3 161256
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 282
ShortVariable Avoid variables with short names like t 3 301
NPathComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has an NPath complexity of 384 3 315392
CyclomaticComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has a cyclomatic complexity of 10. 3 315392
ConfusingTernary Avoid if (x != y) ..; else ..; 3 319
ConfusingTernary Avoid if (x != y) ..; else ..; 3 320
ConfusingTernary Avoid if (x != y) ..; else ..; 3 321
ConfusingTernary Avoid if (x != y) ..; else ..; 3 322
ConfusingTernary Avoid if (x != y) ..; else ..; 3 323
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 345
ShortVariable Avoid variables with short names like t 3 386
ExcessiveMethodLength Avoid really long methods. 3 403537
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a cyclomatic complexity of 13. 3 403537
NcssCount The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a NCSS line count of 87. 3 403537
AvoidReassigningLoopVariables Avoid reassigning the loop control variable 'strRecipient' 3 444
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 486
CollapsibleIfStatements These nested if statements could be combined 3 505532
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 511
ShortVariable Avoid variables with short names like i 3 512
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 515
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 518
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 522

fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 342144
ExcessiveClassLength Avoid really long classes. 3 1132144
CyclomaticComplexity The class 'GreetingsCardJspBean' has a total cyclomatic complexity of 191 (highest 22). 3 1132144
TooManyMethods This class has too many methods, consider refactoring it. 3 1142144
ImmutableField Private field '_greetingsCardService' could be made final; it is only initialized in the declaration or constructor. 3 296
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 301303
CallSuperInConstructor It is a good practice to call super() in a constructor 3 301303
UncommentedEmptyConstructor Document empty constructor 3 301303
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 341
ShortVariable Avoid variables with short names like t 3 349
ConfusingTernary Avoid if (x != y) ..; else ..; 3 363374
ConfusingTernary Avoid if (x != y) ..; else ..; 3 367374
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 395
ShortVariable Avoid variables with short names like t 3 400
CyclomaticComplexity The method 'doCreateGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 18. 3 412520
ExcessiveMethodLength Avoid really long methods. 3 412520
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 415
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 544
ShortVariable Avoid variables with short names like t 3 563
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 577
ExcessiveMethodLength Avoid really long methods. 3 577709
NPathComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has an NPath complexity of 6482 3 577709
CyclomaticComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 20. 3 577709
NcssCount The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a NCSS line count of 62. 3 577709
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 580
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 594
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 595
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 596
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 597
CommentRequired Public method and constructor comments are required 3 711739
NPathComplexity The method 'getStatistics(HttpServletRequest)' has an NPath complexity of 864 3 811975
CyclomaticComplexity The method 'getStatistics(HttpServletRequest)' has a cyclomatic complexity of 13. 3 811975
NcssCount The method 'getStatistics(HttpServletRequest)' has a NCSS line count of 105. 3 811975
ExcessiveMethodLength Avoid really long methods. 3 811975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 851
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 912914
AvoidDuplicateLiterals The String literal "statsTableManager1" appears 4 times in this file; the first occurrence is on line 924 3 924
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 927929
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 955
ShortVariable Avoid variables with short names like t 3 968
CyclomaticComplexity The method 'getGlobalStatistics(HttpServletRequest)' has a cyclomatic complexity of 19. 3 9831185
ExcessiveMethodLength Avoid really long methods. 3 9831185
NPathComplexity The method 'getGlobalStatistics(HttpServletRequest)' has an NPath complexity of 16320 3 9831185
NcssCount The method 'getGlobalStatistics(HttpServletRequest)' has a NCSS line count of 128. 3 9831185
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1021
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1023
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1024
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1024
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1025
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1025
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 11301132
AvoidDuplicateLiterals The String literal "globalStatsTableManager1" appears 4 times in this file; the first occurrence is on line 1,143 3 1143
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 11461148
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1167
ShortVariable Avoid variables with short names like t 3 1178
ExcessiveMethodLength Avoid really long methods. 3 11961393
NPathComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has an NPath complexity of 3200 3 11961393
CyclomaticComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a cyclomatic complexity of 15. 3 11961393
NcssCount The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a NCSS line count of 111. 3 11961393
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1212
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1220
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1221
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1223
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1223
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 1224
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1224
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1360
ShortVariable Avoid variables with short names like t 3 1379
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1403
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1466
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1474
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has a cyclomatic complexity of 22. 3 14921671
NcssCount The method 'doSendGreetingsCard(HttpServletRequest)' has a NCSS line count of 102. 3 14921671
NPathComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has an NPath complexity of 57024 3 14921671
ExcessiveMethodLength Avoid really long methods. 3 14921671
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1497
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1498
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 1509
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1522
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1529
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1533
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1534
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 15351536
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 15631564
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1566
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1567
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1568
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1568
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 15721582
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 15911666
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1635
CollapsibleIfStatements These nested if statements could be combined 3 16541663
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1690
CyclomaticComplexity The method 'doExportGreetingsCard(HttpServletRequest, HttpServletResponse)' has a cyclomatic complexity of 12. 3 17151791
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 1739
ShortVariable Avoid variables with short names like sb 3 1741
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 1758
ShortVariable Avoid variables with short names like sb 3 1760
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1807
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1835
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1836
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1911
ConfusingTernary Avoid if (x != y) ..; else ..; 3 19661973
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 2037
AssignmentInOperand Avoid assignments in operands 3 2047
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 20492052
UseArraysAsList Use asList instead of tight loops 3 2051