Fork me on GitHub

Résultats PMD

Le document suivant contient les résultats de PMD 6.13.0.

Violations By Priority

Priority 1

fr/paris/lutece/plugins/document/modules/solr/indexer/SolrDocIndexer.java

Rule Violation Ligne
LocalVariableNamingConventions The local variable name '_factoryIndexer' doesn't match '[a-z][a-zA-Z0-9]*' 399
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 606

Priority 2

fr/paris/lutece/plugins/document/modules/solr/business/SolrDocumentContentService.java

Rule Violation Ligne
AvoidReassigningParameters Avoid reassigning parameters such as 'strPortletId' 243

Priority 3

fr/paris/lutece/plugins/document/modules/solr/business/SolrDocumentContentService.java

Rule Violation Ligne
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34592
GodClass Possible God Class (WMC=54, ATFD=80, TCC=15.556%) 91592
UnusedPrivateField Avoid unused private fields such as 'ACCEPT_SITE_COMMENTS'. 97
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_COMMENT_DOCUMENT'. 103
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_MANDATORY_FIELD'. 104
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_XSS_ERROR'. 105
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_CHECK_EMAIL'. 106
UnusedPrivateField Avoid unused private fields such as 'MARK_ACCEPT_COMMENT'. 114
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENTS'. 120
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENT_FORM'. 121
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENTS_LIST'. 122
UnusedPrivateField Avoid unused private fields such as 'TEMPLATE_DOCUMENT_COMMENTS'. 135
MissingOverride The method 'getPage(HttpServletRequest, int)' is missing an @Override annotation. 161191
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 183186
PositionLiteralsFirstInCaseInsensitiveComparisons Position literals first in String comparisons for EqualsIgnoreCase 202
NPathComplexity The method 'buildPage(HttpServletRequest, String, String, String, int)' has an NPath complexity of 1020 243365
CyclomaticComplexity The method 'buildPage(HttpServletRequest, String, String, String, int)' has a cyclomatic complexity of 16. 243365
NcssCount The method 'buildPage(HttpServletRequest, String, String, String, int)' has a NCSS line count of 62. 243365
ExcessiveMethodLength Avoid really long methods. 243365
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 248
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 249
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 249
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 271
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 271
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 314
MissingOverride The method 'isInvoked(HttpServletRequest)' is missing an @Override annotation. 374387
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 380384
MissingOverride The method 'getName()' is missing an @Override annotation. 394397
ConfusingTernary Avoid if (x != y) ..; else ..; 401410
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPageTemplateDocument' 405
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 426488
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 433
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 448
ConfusingTernary Avoid if (x != y) ..; else ..; 471479
CyclomaticComplexity The method 'getRelatedDocumentsPortlet(HttpServletRequest, Document, int, int)' has a cyclomatic complexity of 10. 503543
UnusedFormalParameter Avoid unused method parameters such as 'nPortletId'. 503
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 503543
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 507
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 507
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 510
UnusedPrivateMethod Avoid unused private methods such as 'getAddCommentForm(HttpServletRequest,String,String,String,String,String,String)'. 554555
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 554555
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 557
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 557
EmptyCatchBlock Avoid empty catch blocks 574579

fr/paris/lutece/plugins/document/modules/solr/indexer/SolrDocIndexer.java

Rule Violation Ligne
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 34632
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 104
UseUnderscoresInNumericLiterals Number 1000000 should separate every third digit with an underscore 113
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 145
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 146
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 159
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 180
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 192
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 209
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 234
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 255
UnnecessaryWrapperObjectCreation Unnecessary wrapper object creation 259
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 286
CyclomaticComplexity The method 'getContentToIndex(Document, SolrItem)' has a cyclomatic complexity of 18. 326437
ExcessiveMethodLength Avoid really long methods. 326437
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 329
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 330
ConfusingTernary Avoid if (x != y) ..; else ..; 336426
UnusedLocalVariable Avoid unused local variables such as 'address'. 341
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 361
ShortVariable Avoid variables with short names like nI 367
SimpleDateFormatNeedsLocale When instantiating a SimpleDateFormat object, specify a Locale 381
ControlStatementBraces This statement should have braces 393
ConfusingTernary Avoid if (x != y) ..; else ..; 402425
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 408
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 478
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 552
IdenticalCatchBranches 'catch' branch identical to 'SAXException' branch 554557
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 556
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 583
ShortVariable Avoid variables with short names like it 587
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 604
ShortVariable Avoid variables with short names like sb 627

fr/paris/lutece/plugins/document/modules/solr/service/DocumentSolrPlugin.java

Rule Violation Ligne
CommentRequired Header comments are required 3841

Priority 4

fr/paris/lutece/plugins/document/modules/solr/business/SolrDocumentContentService.java

Rule Violation Ligne
UnusedImports Avoid unused imports such as 'java.util.Hashtable' 78

fr/paris/lutece/plugins/document/modules/solr/indexer/SolrDocIndexer.java

Rule Violation Ligne
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.tika.parser.html.HtmlParser' due to existing import 'org.apache.tika.parser.html.HtmlParser' 547

Fichiers

fr/paris/lutece/plugins/document/modules/solr/business/SolrDocumentContentService.java

Rule Violation Priority Ligne
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34592
UnusedImports Avoid unused imports such as 'java.util.Hashtable' 4 78
GodClass Possible God Class (WMC=54, ATFD=80, TCC=15.556%) 3 91592
UnusedPrivateField Avoid unused private fields such as 'ACCEPT_SITE_COMMENTS'. 3 97
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_COMMENT_DOCUMENT'. 3 103
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_MANDATORY_FIELD'. 3 104
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_XSS_ERROR'. 3 105
UnusedPrivateField Avoid unused private fields such as 'PARAMETER_CHECK_EMAIL'. 3 106
UnusedPrivateField Avoid unused private fields such as 'MARK_ACCEPT_COMMENT'. 3 114
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENTS'. 3 120
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENT_FORM'. 3 121
UnusedPrivateField Avoid unused private fields such as 'MARK_DOCUMENT_COMMENTS_LIST'. 3 122
UnusedPrivateField Avoid unused private fields such as 'TEMPLATE_DOCUMENT_COMMENTS'. 3 135
MissingOverride The method 'getPage(HttpServletRequest, int)' is missing an @Override annotation. 3 161191
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 183186
PositionLiteralsFirstInCaseInsensitiveComparisons Position literals first in String comparisons for EqualsIgnoreCase 3 202
NPathComplexity The method 'buildPage(HttpServletRequest, String, String, String, int)' has an NPath complexity of 1020 3 243365
CyclomaticComplexity The method 'buildPage(HttpServletRequest, String, String, String, int)' has a cyclomatic complexity of 16. 3 243365
NcssCount The method 'buildPage(HttpServletRequest, String, String, String, int)' has a NCSS line count of 62. 3 243365
ExcessiveMethodLength Avoid really long methods. 3 243365
AvoidReassigningParameters Avoid reassigning parameters such as 'strPortletId' 2 243
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 248
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 249
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 249
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 271
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 271
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 314
MissingOverride The method 'isInvoked(HttpServletRequest)' is missing an @Override annotation. 3 374387
SimplifyBooleanReturns Avoid unnecessary if..then..else statements when returning booleans 3 380384
MissingOverride The method 'getName()' is missing an @Override annotation. 3 394397
ConfusingTernary Avoid if (x != y) ..; else ..; 3 401410
UnnecessaryLocalBeforeReturn Consider simply returning the value vs storing it in local variable 'strPageTemplateDocument' 3 405
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 426488
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 433
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 448
ConfusingTernary Avoid if (x != y) ..; else ..; 3 471479
CyclomaticComplexity The method 'getRelatedDocumentsPortlet(HttpServletRequest, Document, int, int)' has a cyclomatic complexity of 10. 3 503543
UnusedFormalParameter Avoid unused method parameters such as 'nPortletId'. 3 503
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 503543
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 507
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 507
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 510
UnusedPrivateMethod Avoid unused private methods such as 'getAddCommentForm(HttpServletRequest,String,String,String,String,String,String)'. 3 554555
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 554555
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 557
UseConcurrentHashMap If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 3 557
EmptyCatchBlock Avoid empty catch blocks 3 574579

fr/paris/lutece/plugins/document/modules/solr/indexer/SolrDocIndexer.java

Rule Violation Priority Ligne
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 34632
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 104
UseUnderscoresInNumericLiterals Number 1000000 should separate every third digit with an underscore 3 113
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 145
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 146
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 159
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 180
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 192
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 209
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 234
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 255
UnnecessaryWrapperObjectCreation Unnecessary wrapper object creation 3 259
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 286
CyclomaticComplexity The method 'getContentToIndex(Document, SolrItem)' has a cyclomatic complexity of 18. 3 326437
ExcessiveMethodLength Avoid really long methods. 3 326437
ConsecutiveAppendsShouldReuse StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 3 329
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 330
ConfusingTernary Avoid if (x != y) ..; else ..; 3 336426
UnusedLocalVariable Avoid unused local variables such as 'address'. 3 341
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 361
ShortVariable Avoid variables with short names like nI 3 367
SimpleDateFormatNeedsLocale When instantiating a SimpleDateFormat object, specify a Locale 3 381
ControlStatementBraces This statement should have braces 3 393
LocalVariableNamingConventions The local variable name '_factoryIndexer' doesn't match '[a-z][a-zA-Z0-9]*' 1 399
ConfusingTernary Avoid if (x != y) ..; else ..; 3 402425
AppendCharacterWithChar Avoid appending characters as strings in StringBuffer.append. 3 408
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 478
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'org.apache.tika.parser.html.HtmlParser' due to existing import 'org.apache.tika.parser.html.HtmlParser' 4 547
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 552
IdenticalCatchBranches 'catch' branch identical to 'SAXException' branch 3 554557
PreserveStackTrace New exception is thrown in catch block, original stack trace may be lost 3 556
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 583
ShortVariable Avoid variables with short names like it 3 587
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 604
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 1 606
ShortVariable Avoid variables with short names like sb 3 627

fr/paris/lutece/plugins/document/modules/solr/service/DocumentSolrPlugin.java

Rule Violation Priority Ligne
CommentRequired Header comments are required 3 3841