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/htmlpage/business/HtmlPageHome.java

Rule Violation Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 52–202

fr/paris/lutece/plugins/htmlpage/service/EnumStatus.java

Rule Violation Line
FieldNamingConventions The enum constant name 'disabled' doesn't match '[A-Z][A-Z_0-9]*' 45
FieldNamingConventions The enum constant name 'enabled' doesn't match '[A-Z][A-Z_0-9]*' 46
FieldNamingConventions The enum constant name 'conditioned' doesn't match '[A-Z][A-Z_0-9]*' 47

fr/paris/lutece/plugins/htmlpage/service/PublicHtmlPageCacheService.java

Rule Violation Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 46–134

Priority 3

fr/paris/lutece/plugins/htmlpage/business/HtmlPage.java

Rule Violation Line
UncommentedEmptyConstructor Document empty constructor 68–70
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 68–70
NonThreadSafeSingleton Singleton is not thread safe 78–82
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 220–223

fr/paris/lutece/plugins/htmlpage/business/HtmlPageDAO.java

Rule Violation Line
MissingOverride The method 'insert(HtmlPage, Plugin)' is missing an @Override annotation. 100–116
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 127–151
MissingOverride The method 'delete(HtmlPage, Plugin)' is missing an @Override annotation. 161–168
MissingOverride The method 'store(HtmlPage, Plugin)' is missing an @Override annotation. 178–196
MissingOverride The method 'selectAll(Plugin)' is missing an @Override annotation. 205–229
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 207
MissingOverride The method 'selectEnabledHtmlPage(int, Plugin)' is missing an @Override annotation. 240–264
MissingOverride The method 'selectEnabledHtmlPageList(Plugin)' is missing an @Override annotation. 273–296
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 275

fr/paris/lutece/plugins/htmlpage/service/EnumStatus.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'private' on constructor 'EnumStatus(int, String)': enum constructors are implicitly private 57–61

fr/paris/lutece/plugins/htmlpage/service/HtmlPagePlugin.java

Rule Violation Line
MissingOverride The method 'init()' is missing an @Override annotation. 60–63
CommentRequired Public method and constructor comments are required 65–68

fr/paris/lutece/plugins/htmlpage/service/HtmlPageService.java

Rule Violation Line
NonThreadSafeSingleton Singleton is not thread safe 67–70

fr/paris/lutece/plugins/htmlpage/service/HtmlPageWorkgroupRemovalListener.java

Rule Violation Line
UncommentedEmptyConstructor Document empty constructor 87–89
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 87–89
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 98–117
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 128–132

fr/paris/lutece/plugins/htmlpage/service/IHtmlPageService.java

Rule Violation Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getHtmlPageCache': the method is declared in an interface type 19
UnnecessaryModifier Unnecessary modifier 'public' on method 'getEnableHtmlPage': the method is declared in an interface type 26
UnnecessaryModifier Unnecessary modifier 'public' on method 'getHtmlPageListCache': the method is declared in an interface type 32
UnnecessaryModifier Unnecessary modifier 'public' on method 'getEnabledHtmlPageList': the method is declared in an interface type 38

fr/paris/lutece/plugins/htmlpage/service/PublicHtmlPageCacheService.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 54–57
NonThreadSafeSingleton Singleton is not thread safe 66–69
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 131

fr/paris/lutece/plugins/htmlpage/service/search/HtmlPageIndexer.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34–307
MissingOverride The method 'getDescription()' is missing an @Override annotation. 93–96
MissingOverride The method 'indexDocuments()' is missing an @Override annotation. 108–124
MissingOverride The method 'getDocuments(String)' is missing an @Override annotation. 133–162
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 135
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 151
MissingOverride The method 'getName()' is missing an @Override annotation. 167–170
MissingOverride The method 'getVersion()' is missing an @Override annotation. 175–178
MissingOverride The method 'isEnable()' is missing an @Override annotation. 183–195
UnusedFormalParameter Avoid unused method parameters such as 'plugin'. 215
ShortVariable Avoid variables with short names like ft 217
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 245
IdenticalCatchBranches 'catch' branch identical to 'SAXException' branch 247–250
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 249
ShortVariable Avoid variables with short names like sb 254
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 280
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 282
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 282
MissingOverride The method 'getListType()' is missing an @Override annotation. 292–298
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 294
MissingOverride The method 'getSpecificSearchAppUrl()' is missing an @Override annotation. 303–306

fr/paris/lutece/plugins/htmlpage/service/search/HtmlPageSearchEngine.java

Rule Violation Line
MissingOverride The method 'getSearchResults(String, HttpServletRequest)' is missing an @Override annotation. 80–120
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 82
ShortVariable Avoid variables with short names like ir 85
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 106–112
ShortVariable Avoid variables with short names like si 110
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 114
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 131

fr/paris/lutece/plugins/htmlpage/utils/HtmlPageIndexerUtils.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. 46–78

fr/paris/lutece/plugins/htmlpage/utils/HtmlPageUtil.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. 54–133
SimpleDateFormatNeedsLocale When instantiating a SimpleDateFormat object, specify a Locale 122

fr/paris/lutece/plugins/htmlpage/web/HtmlPageApp.java

Rule Violation Line
UncommentedEmptyConstructor Document empty constructor 103–105
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 103–105
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 120–151
UnusedFormalParameter Avoid unused method parameters such as 'strPluginName'. 153
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 158
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 171
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 199
ConfusingTernary Avoid if (x != y) ..; else ..; 204–219

fr/paris/lutece/plugins/htmlpage/web/HtmlPageInclude.java

Rule Violation Line
MissingOverride The method 'fillTemplate(Map, PageData, int, HttpServletRequest)' is missing an @Override annotation. 74–86

fr/paris/lutece/plugins/htmlpage/web/HtmlPageJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 68–381
SingularField Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 122
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 147
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 147
AddEmptyString Do not add empty strings 148
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 168
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 193
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 194
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 195
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 196
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 216
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 278
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 278
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 321

Priority 4

fr/paris/lutece/plugins/htmlpage/service/search/HtmlPageIndexer.java

Rule Violation Line
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.htmlpage.business.HtmlPageHome' 37
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 121
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 135
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 146
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 225
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 225

Files

fr/paris/lutece/plugins/htmlpage/business/HtmlPage.java

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 68–70
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 68–70
NonThreadSafeSingleton Singleton is not thread safe 3 78–82
MissingOverride The method 'getWorkgroup()' is missing an @Override annotation. 3 220–223

fr/paris/lutece/plugins/htmlpage/business/HtmlPageDAO.java

Rule Violation Priority Line
MissingOverride The method 'insert(HtmlPage, Plugin)' is missing an @Override annotation. 3 100–116
MissingOverride The method 'load(int, Plugin)' is missing an @Override annotation. 3 127–151
MissingOverride The method 'delete(HtmlPage, Plugin)' is missing an @Override annotation. 3 161–168
MissingOverride The method 'store(HtmlPage, Plugin)' is missing an @Override annotation. 3 178–196
MissingOverride The method 'selectAll(Plugin)' is missing an @Override annotation. 3 205–229
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 207
MissingOverride The method 'selectEnabledHtmlPage(int, Plugin)' is missing an @Override annotation. 3 240–264
MissingOverride The method 'selectEnabledHtmlPageList(Plugin)' is missing an @Override annotation. 3 273–296
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 275

fr/paris/lutece/plugins/htmlpage/business/HtmlPageHome.java

Rule Violation Priority Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 1 52–202

fr/paris/lutece/plugins/htmlpage/service/EnumStatus.java

Rule Violation Priority Line
FieldNamingConventions The enum constant name 'disabled' doesn't match '[A-Z][A-Z_0-9]*' 1 45
FieldNamingConventions The enum constant name 'enabled' doesn't match '[A-Z][A-Z_0-9]*' 1 46
FieldNamingConventions The enum constant name 'conditioned' doesn't match '[A-Z][A-Z_0-9]*' 1 47
UnnecessaryModifier Unnecessary modifier 'private' on constructor 'EnumStatus(int, String)': enum constructors are implicitly private 3 57–61

fr/paris/lutece/plugins/htmlpage/service/HtmlPagePlugin.java

Rule Violation Priority Line
MissingOverride The method 'init()' is missing an @Override annotation. 3 60–63
CommentRequired Public method and constructor comments are required 3 65–68

fr/paris/lutece/plugins/htmlpage/service/HtmlPageService.java

Rule Violation Priority Line
NonThreadSafeSingleton Singleton is not thread safe 3 67–70

fr/paris/lutece/plugins/htmlpage/service/HtmlPageWorkgroupRemovalListener.java

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 87–89
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 87–89
MissingOverride The method 'canBeRemoved(String)' is missing an @Override annotation. 3 98–117
MissingOverride The method 'getRemovalRefusedMessage(String, Locale)' is missing an @Override annotation. 3 128–132

fr/paris/lutece/plugins/htmlpage/service/IHtmlPageService.java

Rule Violation Priority Line
UnnecessaryModifier Unnecessary modifier 'public' on method 'getHtmlPageCache': the method is declared in an interface type 3 19
UnnecessaryModifier Unnecessary modifier 'public' on method 'getEnableHtmlPage': the method is declared in an interface type 3 26
UnnecessaryModifier Unnecessary modifier 'public' on method 'getHtmlPageListCache': the method is declared in an interface type 3 32
UnnecessaryModifier Unnecessary modifier 'public' on method 'getEnabledHtmlPageList': the method is declared in an interface type 3 38

fr/paris/lutece/plugins/htmlpage/service/PublicHtmlPageCacheService.java

Rule Violation Priority Line
ClassWithOnlyPrivateConstructorsShouldBeFinal A class which only has private constructors should be final 1 46–134
CallSuperInConstructor It is a good practice to call super() in a constructor 3 54–57
NonThreadSafeSingleton Singleton is not thread safe 3 66–69
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 131

fr/paris/lutece/plugins/htmlpage/service/search/HtmlPageIndexer.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34–307
UnusedImports Avoid unused imports such as 'fr.paris.lutece.plugins.htmlpage.business.HtmlPageHome' 4 37
MissingOverride The method 'getDescription()' is missing an @Override annotation. 3 93–96
MissingOverride The method 'indexDocuments()' is missing an @Override annotation. 3 108–124
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 4 121
MissingOverride The method 'getDocuments(String)' is missing an @Override annotation. 3 133–162
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 135
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 4 135
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 4 146
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 151
MissingOverride The method 'getName()' is missing an @Override annotation. 3 167–170
MissingOverride The method 'getVersion()' is missing an @Override annotation. 3 175–178
MissingOverride The method 'isEnable()' is missing an @Override annotation. 3 183–195
UnusedFormalParameter Avoid unused method parameters such as 'plugin'. 3 215
ShortVariable Avoid variables with short names like ft 3 217
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 4 225
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.lucene.document.Document' due to existing import 'org.apache.lucene.document.Document' 4 225
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 245
IdenticalCatchBranches 'catch' branch identical to 'SAXException' branch 3 247–250
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 249
ShortVariable Avoid variables with short names like sb 3 254
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 280
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 282
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 282
MissingOverride The method 'getListType()' is missing an @Override annotation. 3 292–298
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 294
MissingOverride The method 'getSpecificSearchAppUrl()' is missing an @Override annotation. 3 303–306

fr/paris/lutece/plugins/htmlpage/service/search/HtmlPageSearchEngine.java

Rule Violation Priority Line
MissingOverride The method 'getSearchResults(String, HttpServletRequest)' is missing an @Override annotation. 3 80–120
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 82
ShortVariable Avoid variables with short names like ir 3 85
ForLoopCanBeForeach This for loop can be replaced by a foreach loop 3 106–112
ShortVariable Avoid variables with short names like si 3 110
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 114
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 131

fr/paris/lutece/plugins/htmlpage/utils/HtmlPageIndexerUtils.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 46–78

fr/paris/lutece/plugins/htmlpage/utils/HtmlPageUtil.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 54–133
SimpleDateFormatNeedsLocale When instantiating a SimpleDateFormat object, specify a Locale 3 122

fr/paris/lutece/plugins/htmlpage/web/HtmlPageApp.java

Rule Violation Priority Line
UncommentedEmptyConstructor Document empty constructor 3 103–105
UnnecessaryConstructor Avoid unnecessary constructors - the compiler will generate these for you 3 103–105
MissingOverride The method 'getPage(HttpServletRequest, int, Plugin)' is missing an @Override annotation. 3 120–151
UnusedFormalParameter Avoid unused method parameters such as 'strPluginName'. 3 153
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 158
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 171
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 199
ConfusingTernary Avoid if (x != y) ..; else ..; 3 204–219

fr/paris/lutece/plugins/htmlpage/web/HtmlPageInclude.java

Rule Violation Priority Line
MissingOverride The method 'fillTemplate(Map, PageData, int, HttpServletRequest)' is missing an @Override annotation. 3 74–86

fr/paris/lutece/plugins/htmlpage/web/HtmlPageJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 68–381
SingularField Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 3 122
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 147
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 147
AddEmptyString Do not add empty strings 3 148
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 168
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 168
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 193
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 194
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 195
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 196
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 216
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 278
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 278
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 321