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/searchstats/service/SearchStatsService.java

Rule Violation Line
FieldNamingConventions The static field name 'PROPERTY_MAIL_SENDER_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 65
FieldNamingConventions The static field name 'CONSTANT_MAIL_SENDER' doesn't match '_[a-z][a-zA-Z0-9]*' 66
FieldNamingConventions The static field name 'MESSAGE_MAIL_SUBJECT' doesn't match '_[a-z][a-zA-Z0-9]*' 67

Priority 3

fr/paris/lutece/plugins/searchstats/business/IQueryRecordDAO.java

Rule Violation Line
ImportFromSamePackage No need to import a type that lives in the same package 36
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordListByCriteria': the method is declared in an interface type 66
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordListFromDate': the method is declared in an interface type 77
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordDatesList': the method is declared in an interface type 87
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordList': the method is declared in an interface type 96

fr/paris/lutece/plugins/searchstats/business/QueryRecordDAO.java

Rule Violation Line
ImportFromSamePackage No need to import a type that lives in the same package 36
MissingOverride The method 'insert(QueryRecord, Plugin)' is missing an @Override annotation. 72–86
MissingOverride The method 'selectQueryRecordDatesList(Plugin, boolean)' is missing an @Override annotation. 95–116
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 97
MissingOverride The method 'selectQueryRecordListByCriteria(Plugin, RecordFilter)' is missing an @Override annotation. 127–175
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 129
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 131
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 132
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 146
ShortVariable Avoid variables with short names like i 151
MissingOverride The method 'selectQueryRecordListFromDate(Plugin, RecordFilter)' is missing an @Override annotation. 187–231
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 189
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 191
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 192
AddEmptyString Do not add empty strings 195
AddEmptyString Do not add empty strings 196
AddEmptyString Do not add empty strings 197
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 202
ShortVariable Avoid variables with short names like i 207
AddEmptyString Do not add empty strings 239
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 250
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 251
MissingOverride The method 'selectQueryRecordList(Plugin)' is missing an @Override annotation. 261–283
CommentRequired Public method and constructor comments are required 261–283
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 263

fr/paris/lutece/plugins/searchstats/business/QueryRecordHome.java

Rule Violation Line
ImportFromSamePackage No need to import a type that lives in the same package 36
CommentRequired Public method and constructor comments are required 113–116

fr/paris/lutece/plugins/searchstats/business/RecordFilter.java

Rule Violation Line
CallSuperInConstructor It is a good practice to call super() in a constructor 46–52

fr/paris/lutece/plugins/searchstats/daemon/StatsDaemon.java

Rule Violation Line
CommentRequired Header comments are required 9–18
UselessStringValueOf No need to call String.valueOf to append to a string. 16

fr/paris/lutece/plugins/searchstats/service/QueryListener.java

Rule Violation Line
CommentRequired Public method and constructor comments are required 52–65
MissingOverride The method 'processQueryEvent(QueryEvent)' is missing an @Override annotation. 52–65

fr/paris/lutece/plugins/searchstats/service/SearchStatsPlugin.java

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

fr/paris/lutece/plugins/searchstats/service/SearchStatsService.java

Rule Violation Line
CommentRequired Header comments are required 62–192
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 83
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'listTermRecords' 134
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 147
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 148
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 148
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 149
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 149
UseUnderscoresInNumericLiterals Number 86400 should separate every third digit with an underscore 149
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 150
UseUnderscoresInNumericLiterals Number 86400 should separate every third digit with an underscore 150
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 150

fr/paris/lutece/plugins/searchstats/service/TermRecordComparator.java

Rule Violation Line
MissingOverride The method 'compare(Object, Object)' is missing an @Override annotation. 44–47
CommentRequired Public method and constructor comments are required 44–47
ShortVariable Avoid variables with short names like o1 44
ShortVariable Avoid variables with short names like o2 44

fr/paris/lutece/plugins/searchstats/service/TermRecordService.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. 49–92
CommentRequired Public method and constructor comments are required 51–91
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 53
ShortVariable Avoid variables with short names like st 61
ShortVariable Avoid variables with short names like t 69
ShortVariable Avoid variables with short names like t 74
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 81
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 87

fr/paris/lutece/plugins/searchstats/web/SearchStatsDashboardComponent.java

Rule Violation Line
MissingOverride The method 'getDashboardData(AdminUser, HttpServletRequest)' is missing an @Override annotation. 80–95
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 87
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 87
ShortVariable Avoid variables with short names like t 92
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 114

fr/paris/lutece/plugins/searchstats/web/SearchStatsJspBean.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 63–214
CommentRequired Header comments are required 63–214
RedundantFieldInitializer Avoid using redundant field initializer for '_nItemPerPageDates' 97
CyclomaticComplexity The method 'manageSearchStats(HttpServletRequest)' has a cyclomatic complexity of 10. 101–170
CommentRequired Public method and constructor comments are required 101–170
ConfusingTernary Avoid if (x != y) ..; else ..; 130
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 144
AddEmptyString Do not add empty strings 160
ShortVariable Avoid variables with short names like c 176
ConfusingTernary Avoid if (x != y) ..; else ..; 183–200
ConfusingTernary Avoid if (x != y) ..; else ..; 187–195
ShortVariable Avoid variables with short names like c 208

Priority 4

fr/paris/lutece/plugins/searchstats/business/RecordFilter.java

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

Files

fr/paris/lutece/plugins/searchstats/business/IQueryRecordDAO.java

Rule Violation Priority Line
ImportFromSamePackage No need to import a type that lives in the same package 3 36
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordListByCriteria': the method is declared in an interface type 3 66
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordListFromDate': the method is declared in an interface type 3 77
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordDatesList': the method is declared in an interface type 3 87
UnnecessaryModifier Unnecessary modifier 'public' on method 'selectQueryRecordList': the method is declared in an interface type 3 96

fr/paris/lutece/plugins/searchstats/business/QueryRecordDAO.java

Rule Violation Priority Line
ImportFromSamePackage No need to import a type that lives in the same package 3 36
MissingOverride The method 'insert(QueryRecord, Plugin)' is missing an @Override annotation. 3 72–86
MissingOverride The method 'selectQueryRecordDatesList(Plugin, boolean)' is missing an @Override annotation. 3 95–116
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 97
MissingOverride The method 'selectQueryRecordListByCriteria(Plugin, RecordFilter)' is missing an @Override annotation. 3 127–175
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 129
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 131
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 132
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 146
ShortVariable Avoid variables with short names like i 3 151
MissingOverride The method 'selectQueryRecordListFromDate(Plugin, RecordFilter)' is missing an @Override annotation. 3 187–231
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 189
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 191
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 192
AddEmptyString Do not add empty strings 3 195
AddEmptyString Do not add empty strings 3 196
AddEmptyString Do not add empty strings 3 197
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 202
ShortVariable Avoid variables with short names like i 3 207
AddEmptyString Do not add empty strings 3 239
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 250
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 251
MissingOverride The method 'selectQueryRecordList(Plugin)' is missing an @Override annotation. 3 261–283
CommentRequired Public method and constructor comments are required 3 261–283
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 263

fr/paris/lutece/plugins/searchstats/business/QueryRecordHome.java

Rule Violation Priority Line
ImportFromSamePackage No need to import a type that lives in the same package 3 36
CommentRequired Public method and constructor comments are required 3 113–116

fr/paris/lutece/plugins/searchstats/business/RecordFilter.java

Rule Violation Priority Line
CallSuperInConstructor It is a good practice to call super() in a constructor 3 46–52
BooleanGetMethodName A getX() method which returns a boolean should be named isX() 4 59–62

fr/paris/lutece/plugins/searchstats/daemon/StatsDaemon.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 9–18
UselessStringValueOf No need to call String.valueOf to append to a string. 3 16

fr/paris/lutece/plugins/searchstats/service/QueryListener.java

Rule Violation Priority Line
CommentRequired Public method and constructor comments are required 3 52–65
MissingOverride The method 'processQueryEvent(QueryEvent)' is missing an @Override annotation. 3 52–65

fr/paris/lutece/plugins/searchstats/service/SearchStatsPlugin.java

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

fr/paris/lutece/plugins/searchstats/service/SearchStatsService.java

Rule Violation Priority Line
CommentRequired Header comments are required 3 62–192
FieldNamingConventions The static field name 'PROPERTY_MAIL_SENDER_NAME' doesn't match '_[a-z][a-zA-Z0-9]*' 1 65
FieldNamingConventions The static field name 'CONSTANT_MAIL_SENDER' doesn't match '_[a-z][a-zA-Z0-9]*' 1 66
FieldNamingConventions The static field name 'MESSAGE_MAIL_SUBJECT' doesn't match '_[a-z][a-zA-Z0-9]*' 1 67
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 83
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'listTermRecords' 3 134
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 3 147
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 3 148
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 3 148
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 3 149
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 3 149
UseUnderscoresInNumericLiterals Number 86400 should separate every third digit with an underscore 3 149
UseUnderscoresInNumericLiterals Number 2628000 should separate every third digit with an underscore 3 150
UseUnderscoresInNumericLiterals Number 86400 should separate every third digit with an underscore 3 150
UseUnderscoresInNumericLiterals Number 31536000 should separate every third digit with an underscore 3 150

fr/paris/lutece/plugins/searchstats/service/TermRecordComparator.java

Rule Violation Priority Line
MissingOverride The method 'compare(Object, Object)' is missing an @Override annotation. 3 44–47
CommentRequired Public method and constructor comments are required 3 44–47
ShortVariable Avoid variables with short names like o1 3 44
ShortVariable Avoid variables with short names like o2 3 44

fr/paris/lutece/plugins/searchstats/service/TermRecordService.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 49–92
CommentRequired Public method and constructor comments are required 3 51–91
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 53
ShortVariable Avoid variables with short names like st 3 61
ShortVariable Avoid variables with short names like t 3 69
ShortVariable Avoid variables with short names like t 3 74
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 81
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 87

fr/paris/lutece/plugins/searchstats/web/SearchStatsDashboardComponent.java

Rule Violation Priority Line
MissingOverride The method 'getDashboardData(AdminUser, HttpServletRequest)' is missing an @Override annotation. 3 80–95
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 87
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 87
ShortVariable Avoid variables with short names like t 3 92
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 114

fr/paris/lutece/plugins/searchstats/web/SearchStatsJspBean.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 63–214
CommentRequired Header comments are required 3 63–214
RedundantFieldInitializer Avoid using redundant field initializer for '_nItemPerPageDates' 3 97
CyclomaticComplexity The method 'manageSearchStats(HttpServletRequest)' has a cyclomatic complexity of 10. 3 101–170
CommentRequired Public method and constructor comments are required 3 101–170
ConfusingTernary Avoid if (x != y) ..; else ..; 3 130
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 144
AddEmptyString Do not add empty strings 3 160
ShortVariable Avoid variables with short names like c 3 176
ConfusingTernary Avoid if (x != y) ..; else ..; 3 183–200
ConfusingTernary Avoid if (x != y) ..; else ..; 3 187–195
ShortVariable Avoid variables with short names like c 3 208