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 78–80
UncommentedEmptyConstructor Document empty constructor 78–80
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 321–325
CommentRequired Public method and constructor comments are required 330–337

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

Rule Violation Line
CommentRequired Public method and constructor comments are required 166–178

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

Rule Violation Line
ConfusingTernary Avoid if (x != y) ..; else ..; 75–83
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. 48–153

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 51–640
TooManyMethods This class has too many methods, consider refactoring it. 52–640
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 140
ConfusingTernary Avoid if (x != y) ..; else ..; 160–179
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 218–261
DefaultPackage Use explicit scoping instead of the default package private level 218–261
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. 49–210

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

Rule Violation Line
CommentRequired Public method and constructor comments are required 156–159
CommentRequired Public method and constructor comments are required 161–164

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

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

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 46–248
MissingOverride The method 'insert(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 71–96
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 104–112
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 121–153
ConfusingTernary Avoid if (x != y) ..; else ..; 130–148
MissingOverride The method 'store(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 161–186
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 194–213
DefaultPackage Use explicit scoping instead of the default package private level 194–213
MissingOverride The method 'findAll(Plugin)' is missing an @Override annotation. 220–247
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. 56–291

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

Rule Violation Line
CommentRequired Header comments are required 41–108

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

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 50–156
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. 76–154
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 165–168

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. 83–165
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. 34–559
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 76–559
UnusedPrivateField Avoid unused private fields such as 'MARK_FORMAT'. 83
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 148–150
UncommentedEmptyConstructor Document empty constructor 148–150
CallSuperInConstructor It is a good practice to call super() in a constructor 148–150
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 161–256
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 20. 161–256
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 315–392
CyclomaticComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has a cyclomatic complexity of 10. 315–392
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. 403–537
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a cyclomatic complexity of 13. 403–537
NcssCount The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a NCSS line count of 87. 403–537
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 505–532
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. 34–2144
ExcessiveClassLength Avoid really long classes. 113–2144
CyclomaticComplexity The class 'GreetingsCardJspBean' has a total cyclomatic complexity of 191 (highest 22). 113–2144
TooManyMethods This class has too many methods, consider refactoring it. 114–2144
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 301–303
CallSuperInConstructor It is a good practice to call super() in a constructor 301–303
UncommentedEmptyConstructor Document empty constructor 301–303
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 ..; 363–374
ConfusingTernary Avoid if (x != y) ..; else ..; 367–374
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. 412–520
ExcessiveMethodLength Avoid really long methods. 412–520
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. 577–709
NPathComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has an NPath complexity of 6482 577–709
CyclomaticComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 20. 577–709
NcssCount The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a NCSS line count of 62. 577–709
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 711–739
NPathComplexity The method 'getStatistics(HttpServletRequest)' has an NPath complexity of 864 811–975
CyclomaticComplexity The method 'getStatistics(HttpServletRequest)' has a cyclomatic complexity of 13. 811–975
NcssCount The method 'getStatistics(HttpServletRequest)' has a NCSS line count of 105. 811–975
ExcessiveMethodLength Avoid really long methods. 811–975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 851
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 912–914
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 927–929
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. 983–1185
ExcessiveMethodLength Avoid really long methods. 983–1185
NPathComplexity The method 'getGlobalStatistics(HttpServletRequest)' has an NPath complexity of 16320 983–1185
NcssCount The method 'getGlobalStatistics(HttpServletRequest)' has a NCSS line count of 128. 983–1185
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 1130–1132
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 1146–1148
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. 1196–1393
NPathComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has an NPath complexity of 3200 1196–1393
CyclomaticComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a cyclomatic complexity of 15. 1196–1393
NcssCount The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a NCSS line count of 111. 1196–1393
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. 1492–1671
NcssCount The method 'doSendGreetingsCard(HttpServletRequest)' has a NCSS line count of 102. 1492–1671
NPathComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has an NPath complexity of 57024 1492–1671
ExcessiveMethodLength Avoid really long methods. 1492–1671
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. 1535–1536
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 1563–1564
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 1572–1582
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 1591–1666
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1635
CollapsibleIfStatements These nested if statements could be combined 1654–1663
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 1690
CyclomaticComplexity The method 'doExportGreetingsCard(HttpServletRequest, HttpServletResponse)' has a cyclomatic complexity of 12. 1715–1791
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 ..; 1966–1973
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 2049–2052
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() 295–298

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 78–80
UncommentedEmptyConstructor Document empty constructor 3 78–80
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 295–298
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 3 321–325
CommentRequired Public method and constructor comments are required 3 330–337

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

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 166–178

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

Rule Violation Priority Line
ConfusingTernary Avoid if (x != y) ..; else ..; 3 75–83
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 48–153

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 51–640
TooManyMethods This class has too many methods, consider refactoring it. 3 52–640
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 140
ConfusingTernary Avoid if (x != y) ..; else ..; 3 160–179
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 218–261
DefaultPackage Use explicit scoping instead of the default package private level 3 218–261
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 49–210

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

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 156–159
CommentRequired Public method and constructor comments are required 3 161–164

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

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

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 46–248
MissingOverride The method 'insert(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 3 71–96
MissingOverride The method 'delete(int, Plugin)' is missing an @Override annotation. 3 104–112
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 3 121–153
ConfusingTernary Avoid if (x != y) ..; else ..; 3 130–148
MissingOverride The method 'store(GreetingsCardTemplate, Plugin)' is missing an @Override annotation. 3 161–186
CommentDefaultAccessModifier To avoid mistakes add a comment at the beginning of the newPrimaryKey method if you want a default access modifier 3 194–213
DefaultPackage Use explicit scoping instead of the default package private level 3 194–213
MissingOverride The method 'findAll(Plugin)' is missing an @Override annotation. 3 220–247
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 56–291
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 41–108

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

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 50–156
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 76–154
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 165–168

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 83–165
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 34–559
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 76–559
UnusedPrivateField Avoid unused private fields such as 'MARK_FORMAT'. 3 83
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 148–150
UncommentedEmptyConstructor Document empty constructor 3 148–150
CallSuperInConstructor It is a good practice to call super() in a constructor 3 148–150
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 3 161–256
CyclomaticComplexity The method 'getPage(HttpServletRequest, int, Plugin)' has a cyclomatic complexity of 20. 3 161–256
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 315–392
CyclomaticComplexity The method 'getCreateHTMLGreetingsCard(HttpServletRequest, Plugin)' has a cyclomatic complexity of 10. 3 315–392
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 403–537
CyclomaticComplexity The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a cyclomatic complexity of 13. 3 403–537
NcssCount The method 'doSendGreetingsCard(HttpServletRequest, Plugin, String)' has a NCSS line count of 87. 3 403–537
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 505–532
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 34–2144
ExcessiveClassLength Avoid really long classes. 3 113–2144
CyclomaticComplexity The class 'GreetingsCardJspBean' has a total cyclomatic complexity of 191 (highest 22). 3 113–2144
TooManyMethods This class has too many methods, consider refactoring it. 3 114–2144
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 301–303
CallSuperInConstructor It is a good practice to call super() in a constructor 3 301–303
UncommentedEmptyConstructor Document empty constructor 3 301–303
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 363–374
ConfusingTernary Avoid if (x != y) ..; else ..; 3 367–374
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 412–520
ExcessiveMethodLength Avoid really long methods. 3 412–520
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 577–709
NPathComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has an NPath complexity of 6482 3 577–709
CyclomaticComplexity The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a cyclomatic complexity of 20. 3 577–709
NcssCount The method 'doModifyGreetingsCardTemplate(HttpServletRequest)' has a NCSS line count of 62. 3 577–709
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 711–739
NPathComplexity The method 'getStatistics(HttpServletRequest)' has an NPath complexity of 864 3 811–975
CyclomaticComplexity The method 'getStatistics(HttpServletRequest)' has a cyclomatic complexity of 13. 3 811–975
NcssCount The method 'getStatistics(HttpServletRequest)' has a NCSS line count of 105. 3 811–975
ExcessiveMethodLength Avoid really long methods. 3 811–975
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 851
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 912–914
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 927–929
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 983–1185
ExcessiveMethodLength Avoid really long methods. 3 983–1185
NPathComplexity The method 'getGlobalStatistics(HttpServletRequest)' has an NPath complexity of 16320 3 983–1185
NcssCount The method 'getGlobalStatistics(HttpServletRequest)' has a NCSS line count of 128. 3 983–1185
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 1130–1132
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 1146–1148
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 1196–1393
NPathComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has an NPath complexity of 3200 3 1196–1393
CyclomaticComplexity The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a cyclomatic complexity of 15. 3 1196–1393
NcssCount The method 'getArchiveStatistics(HttpServletRequest, String, int)' has a NCSS line count of 111. 3 1196–1393
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 1492–1671
NcssCount The method 'doSendGreetingsCard(HttpServletRequest)' has a NCSS line count of 102. 3 1492–1671
NPathComplexity The method 'doSendGreetingsCard(HttpServletRequest)' has an NPath complexity of 57024 3 1492–1671
ExcessiveMethodLength Avoid really long methods. 3 1492–1671
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 1535–1536
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 1563–1564
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 1572–1582
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 1591–1666
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 1635
CollapsibleIfStatements These nested if statements could be combined 3 1654–1663
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 1715–1791
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 1966–1973
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 2049–2052
UseArraysAsList Use asList instead of tight loops 3 2051