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/newsletter/modules/document/service/NewsletterDocumentService.java

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

Priority 3

fr/paris/lutece/plugins/newsletter/modules/document/business/INewsletterDocumentDAO.java

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

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentDAO.java

Rule Violation Line
TooManyMethods This class has too many methods, consider refactoring it. 53390
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 150
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 169
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 247
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 306
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 334

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentHome.java

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

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentTemplateRemovalListener.java

Rule Violation Line
ShortVariable Avoid variables with short names like id 65

fr/paris/lutece/plugins/newsletter/modules/document/service/NewsletterDocumentService.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34303
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 91
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 128154
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 133136
CollapsibleIfStatements These nested if statements could be combined 133136
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 147
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 147150
CyclomaticComplexity The method 'generateDocumentsList(NewsletterDocument, int, Timestamp, String, AdminUser, Locale)' has a cyclomatic complexity of 12. 174236
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 178
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 206
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 254
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 257
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 257

fr/paris/lutece/plugins/newsletter/modules/document/service/NewsletterDocumentTopicService.java

Rule Violation Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 137
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 137
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 201206
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 215220
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 250
ConfusingTernary Avoid if (x != y) ..; else ..; 353357

fr/paris/lutece/plugins/newsletter/modules/document/util/HtmlDomDocNewsletterDocument.java

Rule Violation Line
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 123128

fr/paris/lutece/plugins/newsletter/modules/document/util/NewsletterDocumentUtils.java

Rule Violation Line
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 6869
ShortVariable Avoid variables with short names like i 99

fr/paris/lutece/plugins/newsletter/modules/document/web/NewsletterDocumentServiceJspBean.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34256
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 117
ConfusingTernary Avoid if (x != y) ..; else ..; 134
ConfusingTernary Avoid if (x != y) ..; else ..; 140
ConfusingTernary Avoid if (x != y) ..; else ..; 143
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 146
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 146
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 201
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 203
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 204
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 205
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 205
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 205
ConfusingTernary Avoid if (x != y) ..; else ..; 207
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 215
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 224
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 229236

Priority 4

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocument.java

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

Files

fr/paris/lutece/plugins/newsletter/modules/document/business/INewsletterDocumentDAO.java

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

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocument.java

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

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentDAO.java

Rule Violation Priority Line
TooManyMethods This class has too many methods, consider refactoring it. 3 53390
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 150
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 169
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 247
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 306
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 334

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentHome.java

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

fr/paris/lutece/plugins/newsletter/modules/document/business/NewsletterDocumentTemplateRemovalListener.java

Rule Violation Priority Line
ShortVariable Avoid variables with short names like id 3 65

fr/paris/lutece/plugins/newsletter/modules/document/service/NewsletterDocumentService.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34303
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 3 91
UseTryWithResources Consider using a try-with-resources statement instead of explicitly closing the resource 3 128154
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 133136
CollapsibleIfStatements These nested if statements could be combined 3 133136
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 140
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 147
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 3 147150
CyclomaticComplexity The method 'generateDocumentsList(NewsletterDocument, int, Timestamp, String, AdminUser, Locale)' has a cyclomatic complexity of 12. 3 174236
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 178
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 206
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 254
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 257
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 257

fr/paris/lutece/plugins/newsletter/modules/document/service/NewsletterDocumentTopicService.java

Rule Violation Priority Line
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 137
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 137
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 201206
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 215220
UseCollectionIsEmpty Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 3 250
ConfusingTernary Avoid if (x != y) ..; else ..; 3 353357

fr/paris/lutece/plugins/newsletter/modules/document/util/HtmlDomDocNewsletterDocument.java

Rule Violation Priority Line
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 123128

fr/paris/lutece/plugins/newsletter/modules/document/util/NewsletterDocumentUtils.java

Rule Violation Priority Line
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 6869
ShortVariable Avoid variables with short names like i 3 99

fr/paris/lutece/plugins/newsletter/modules/document/web/NewsletterDocumentServiceJspBean.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34256
ImmutableField Private field '_newsletterService' could be made final; it is only initialized in the declaration or constructor. 3 117
ConfusingTernary Avoid if (x != y) ..; else ..; 3 134
ConfusingTernary Avoid if (x != y) ..; else ..; 3 140
ConfusingTernary Avoid if (x != y) ..; else ..; 3 143
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 146
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 146
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 201
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 203
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 204
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 205
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 205
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 205
ConfusingTernary Avoid if (x != y) ..; else ..; 3 207
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 215
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 224
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 229236