Fork me on GitHub

Résultats PMD

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

Fichiers

fr/paris/lutece/plugins/htmldocs/business/DocContent.java

Violation Ligne
The user-supplied array 'bytes' is stored directly. 71
Returning '_bytes' may expose an internal array. 82

fr/paris/lutece/plugins/htmldocs/business/DocumentPageTemplateDAO.java

Violation Ligne
Use explicit scoping instead of the default package private level 6381
Use block level rather than method level synchronization 87100

fr/paris/lutece/plugins/htmldocs/business/HtmlDoc.java

Violation Ligne
Possible God class (WMC=50, ATFD=12, TCC=0.04358974358974359) 34528
Avoid unused imports such as 'javax.validation.constraints' 36
Avoid unused imports such as 'org.hibernate.validator.constraints' 38
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 45
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 45
A getX() method which returns a boolean should be named isX() 354357

fr/paris/lutece/plugins/htmldocs/business/HtmlDocDAO.java

Violation Ligne
Possible God class (WMC=51, ATFD=147, TCC=0.008333333333333333) 35629
Avoid unused imports such as 'java.sql.Timestamp' 42
Avoid unused imports such as 'java.sql.Timestamp' 42
Avoid unused imports such as 'java.util.Collection' 44
Avoid unused imports such as 'java.util.Collection' 44
Avoid unused imports such as 'java.util.Date' 45
Avoid unused imports such as 'java.util.Date' 45
The class 'HtmlDocDAO' has a Cyclomatic Complexity of 3 (Highest = 25). 54629
The class 'HtmlDocDAO' has a Standard Cyclomatic Complexity of 3 (Highest = 24). 54629
The class 'HtmlDocDAO' has a Modified Cyclomatic Complexity of 3 (Highest = 24). 54629
Avoid unused private fields such as 'CONSTANT_QUESTION_MARK'. 87
Avoid unused private fields such as 'CONSTANT_COMMA'. 88
The method 'getDaoFromFilter' has a Modified Cyclomatic Complexity of 24. 512626
The method getDaoFromFilter() has an NPath complexity of 1018368 512626
The method 'getDaoFromFilter' has a Cyclomatic Complexity of 25. 512626
Avoid really long methods. 512626
The method 'getDaoFromFilter' has a Standard Cyclomatic Complexity of 24. 512626
Avoid variables with short names like i 521
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 574
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 575
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 580
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 585
Prefer StringBuffer over += for concatenating strings 592
Prefer StringBuffer over += for concatenating strings 595
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 596
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 609
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 620

fr/paris/lutece/plugins/htmldocs/business/HtmlDocFilter.java

Violation Ligne
Returning '_arrayTagsId' may expose an internal array. 61
Consider using varargs for methods or constructors which take an array the last parameter. 67
The user-supplied array 'arrayTagsId' is stored directly. 67
Returning '_arrayId' may expose an internal array. 96
Consider using varargs for methods or constructors which take an array the last parameter. 102
The user-supplied array 'arrayId' is stored directly. 102
A getX() method which returns a boolean should be named isX() 112115

fr/paris/lutece/plugins/htmldocs/business/HtmlDocHome.java

Violation Ligne
Avoid unused imports such as 'fr.paris.lutece.portal.service.i18n.I18nService' 36
Avoid unused imports such as 'fr.paris.lutece.portal.service.i18n.I18nService' 36
Avoid unused imports such as 'java.util.Date' 42
Avoid unused imports such as 'java.util.Date' 42

fr/paris/lutece/plugins/htmldocs/business/IHtmlDocDAO.java

Violation Ligne
Avoid unused imports such as 'java.sql.Timestamp' 40
Avoid unused imports such as 'java.sql.Timestamp' 40
Avoid unused imports such as 'java.util.Collection' 41
Avoid unused imports such as 'java.util.Collection' 41
Avoid unused imports such as 'java.util.Date' 42
Avoid unused imports such as 'java.util.Date' 42

fr/paris/lutece/plugins/htmldocs/business/IndexerActionDAO.java

Violation Ligne
Use block level rather than method level synchronization 88100

fr/paris/lutece/plugins/htmldocs/business/IndexerActionHome.java

Violation Ligne
Use block level rather than method level synchronization 3379
Use block level rather than method level synchronization 8588

fr/paris/lutece/plugins/htmldocs/business/Tag.java

Violation Ligne
Avoid short class names like Tag 377
Document empty constructor 1114

fr/paris/lutece/plugins/htmldocs/business/TagDAO.java

Violation Ligne
Avoid unused imports such as 'java.util.HashMap' 39
Avoid unused imports such as 'java.util.HashMap' 39
Avoid unused imports such as 'java.util.Map' 41
Avoid unused imports such as 'java.util.Map' 41

fr/paris/lutece/plugins/htmldocs/business/TagHome.java

Violation Ligne
Avoid unused imports such as 'java.util.Map' 42
Avoid unused imports such as 'java.util.Map' 42

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocPublicationHome.java

Violation Ligne
A class which only has private constructors should be final 13137

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocsListPortlet.java

Violation Ligne
It is a good practice to call super() in a constructor 7881
Unnecessary use of fully qualified name 'java.util.GregorianCalendar' due to existing import 'java.util.GregorianCalendar' 89
Avoid using if statements without curly braces 203

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmlDocsListPortletHome.java

Violation Ligne
Possible unsafe assignment to a non-final static field in a constructor. 58
Avoid using redundant field initializer for '_singleton' 58
It is a good practice to call super() in a constructor 6369
Singleton is not thread safe 7881

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsListPortletDAO.java

Violation Ligne
The class 'HtmldocsListPortletDAO' has a Modified Cyclomatic Complexity of 3 (Highest = 10). 52347
The class 'HtmldocsListPortletDAO' has a Standard Cyclomatic Complexity of 3 (Highest = 10). 52347
The class 'HtmldocsListPortletDAO' has a Cyclomatic Complexity of 3 (Highest = 10). 52347
Avoid variables with short names like p 84
Avoid variables with short names like p 102
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 182
Avoid variables with short names like p 232
The method 'selectPortletByType' has a Cyclomatic Complexity of 10. 292345
The method 'selectPortletByType' has a Modified Cyclomatic Complexity of 10. 292345
The method 'selectPortletByType' has a Standard Cyclomatic Complexity of 10. 292345
Assigning an Object to null is a code smell. Consider refactoring. 297

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsPortlet.java

Violation Ligne
It is a good practice to call super() in a constructor 5760
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 62
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 64
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 66
Unnecessary use of fully qualified name 'java.util.GregorianCalendar' due to existing import 'java.util.GregorianCalendar' 79

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsPortletDAO.java

Violation Ligne
Avoid unused imports such as 'java.sql.Date' 36
Avoid unused imports such as 'java.sql.Date' 36
The class 'HtmldocsPortletDAO' has a Modified Cyclomatic Complexity of 3 (Highest = 10). 48248
The class 'HtmldocsPortletDAO' has a Standard Cyclomatic Complexity of 3 (Highest = 10). 48248
The class 'HtmldocsPortletDAO' has a Cyclomatic Complexity of 3 (Highest = 10). 48248
Avoid variables with short names like p 73
Avoid variables with short names like p 110
Avoid variables with short names like p 157
The method 'selectPortletByType' has a Modified Cyclomatic Complexity of 10. 195246
The method 'selectPortletByType' has a Cyclomatic Complexity of 10. 195246
The method 'selectPortletByType' has a Standard Cyclomatic Complexity of 10. 195246
Assigning an Object to null is a code smell. Consider refactoring. 200

fr/paris/lutece/plugins/htmldocs/business/portlet/HtmldocsPortletHome.java

Violation Ligne
Possible unsafe assignment to a non-final static field in a constructor. 53
It is a good practice to call super() in a constructor 5864
Singleton is not thread safe 8689

fr/paris/lutece/plugins/htmldocs/business/portlet/PortletFilter.java

Violation Ligne
The class 'PortletFilter' has a Cyclomatic Complexity of 2 (Highest = 13). 44225
The user-supplied array 'strPageTitle' is stored directly. 67
Consider using varargs for methods or constructors which take an array the last parameter. 67
Returning '_tabPageName' may expose an internal array. 78
Consider using varargs for methods or constructors which take an array the last parameter. 85
The user-supplied array 'strPortletTitle' is stored directly. 85
Returning '_tabPortletName' may expose an internal array. 96
The method 'getSQLFilter' has a Cyclomatic Complexity of 13. 159206

fr/paris/lutece/plugins/htmldocs/business/rss/HtmlDocResourceRss.java

Violation Ligne
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletHome' 43
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletHome' 43
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletType' 44
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletType' 44
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletTypeHome' 45
Avoid unused imports such as 'fr.paris.lutece.portal.business.portlet.PortletTypeHome' 45
Avoid unused imports such as 'com.mysql.fabric.xmlrpc.base.Array' 67
Avoid unused imports such as 'com.mysql.fabric.xmlrpc.base.Array' 67
Avoid unnecessary if..then..else statements when returning booleans 116119
Avoid declaring a variable if it is unreferenced before a possible exit point. 168
Avoid unused local variables such as 'stridPortlet'. 168
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 303
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 344

fr/paris/lutece/plugins/htmldocs/business/rss/HtmlDocResourceRssConfigDAO.java

Violation Ligne
Use block level rather than method level synchronization 5971

fr/paris/lutece/plugins/htmldocs/service/HtmlDocService.java

Violation Ligne
Avoid unused imports such as 'java.util.Map' 39
Avoid unused imports such as 'java.util.Map' 39
Avoid unused imports such as 'java.util.Map.Entry' 40
Avoid unused imports such as 'java.util.Map.Entry' 40
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 103
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 129
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 168

fr/paris/lutece/plugins/htmldocs/service/PublishingService.java

Violation Ligne
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 149
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 268
Avoid variables with short names like i 274

fr/paris/lutece/plugins/htmldocs/service/docsearch/DefaultHtmldocIndexer.java

Violation Ligne
A high number of imports can indicate a high degree of coupling within an object. 1347
Avoid variables with short names like it 73
Use block level rather than method level synchronization 87162
Unnecessary use of fully qualified name 'fr.paris.lutece.plugins.htmldocs.business.IndexerAction' due to existing import 'fr.paris.lutece.plugins.htmldocs.business.IndexerAction' 97
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 149
New exception is thrown in catch block, original stack trace may be lost 209
New exception is thrown in catch block, original stack trace may be lost 213
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 242
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 243
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 244
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 245

fr/paris/lutece/plugins/htmldocs/service/docsearch/HtmlDocSearchService.java

Violation Ligne
A high number of imports can indicate a high degree of coupling within an object. 2335
Use of modifier volatile is not recommended. 58
Use of modifier volatile is not recommended. 59
Private field '_indexer' could be made final; it is only initialized in the declaration or constructor. 61
Private field '_nWriterMergeFactor' could be made final; it is only initialized in the declaration or constructor. 62
Private field '_nWriterMaxSectorLength' could be made final; it is only initialized in the declaration or constructor. 63
Avoid unused private fields such as '_nWriterMaxSectorLength'. 63
Perhaps '_nWriterMaxSectorLength' could be replaced by a local variable. 63
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 96
Singleton is not thread safe 108111
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 144
Avoid variables with short names like ir 166
StringBuffer constructor is initialized with size 16, but has at least 147 characters appended. 197
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 203
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 243
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 246

fr/paris/lutece/plugins/htmldocs/service/docsearch/HtmlDocsSearchItem.java

Violation Ligne
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 53
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 58
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 63
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 69

fr/paris/lutece/plugins/htmldocs/service/docsearch/HtmldocLuceneSearchEngine.java

Violation Ligne
Avoid variables with short names like si 102
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 106

fr/paris/lutece/plugins/htmldocs/service/search/HtmlDocsSearchIndexer.java

Violation Ligne
Avoid unused imports such as 'fr.paris.lutece.plugins.htmldocs.service.HtmldocsPlugin' 7
Avoid unused imports such as 'fr.paris.lutece.plugins.htmldocs.service.HtmldocsPlugin' 7
Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 12
Avoid unused imports such as 'fr.paris.lutece.portal.service.plugin.Plugin' 12
Avoid unused private fields such as 'ROLE_NONE'. 37
Position literals first in String comparisons for EqualsIgnoreCase 74
This statement may have some unnecessary parentheses 74

fr/paris/lutece/plugins/htmldocs/utils/HtmldocUtils.java

Violation Ligne
Avoid using Literals in Conditional Statements 58

fr/paris/lutece/plugins/htmldocs/web/HtmlDocFileServlet.java

Violation Ligne
Avoid unused private fields such as 'LOG_UNAUTHENTICATED_REQUEST'. 69
Avoid variables with short names like os 116

fr/paris/lutece/plugins/htmldocs/web/HtmlDocJspBean.java

Violation Ligne
Possible God class (WMC=66, ATFD=110, TCC=0.3161764705882353) 34810
A high number of imports can indicate a high degree of coupling within an object. 34810
The class 'HtmlDocJspBean' has a Cyclomatic Complexity of 4 (Highest = 14). 99810
The class 'HtmlDocJspBean' has a Modified Cyclomatic Complexity of 3 (Highest = 11). 99810
The class 'HtmlDocJspBean' has a Standard Cyclomatic Complexity of 3 (Highest = 11). 99810
Avoid unused private fields such as 'PROPERTY_RESOURCE_TYPE'. 141
Avoid unused private fields such as 'VIEW_PREVIOUS_VERSION_HTMLDOC'. 175
Avoid using redundant field initializer for '_bIsChecked' 207
Avoid using redundant field initializer for '_bIsSorted' 212
The method 'getManageHtmlDocs' has a Cyclomatic Complexity of 14. 226315
The method 'getManageHtmlDocs' has a Standard Cyclomatic Complexity of 11. 226315
The method 'getManageHtmlDocs' has a Modified Cyclomatic Complexity of 11. 226315
The method getManageHtmlDocs() has an NPath complexity of 396 226315
Assigning an Object to null is a code smell. Consider refactoring. 228
Avoid using if statements without curly braces 252
Avoid using if statements without curly braces 253
Avoid using if statements without curly braces 254
Avoid unnecessary comparisons in boolean expressions 280
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 303
Do not add empty strings 311
Assigning an Object to null is a code smell. Consider refactoring. 320
This statement may have some unnecessary parentheses 366
Avoid variables with short names like tg 434
Position literals first in String comparisons 450
Position literals first in String comparisons 455
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 506
Avoid declaring a variable if it is unreferenced before a possible exit point. 580
Assigning an Object to null is a code smell. Consider refactoring. 610
Avoid variables with short names like tf 714
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 734

fr/paris/lutece/plugins/htmldocs/web/HtmlDocPublicationJspBean.java

Violation Ligne
A high number of imports can indicate a high degree of coupling within an object. 34474
The class 'HtmlDocPublicationJspBean' has a Cyclomatic Complexity of 6 (Highest = 13). 80474
The method 'getManageHtmlDocsPublication' has a Cyclomatic Complexity of 13. 156226
The method getManageHtmlDocsPublication() has an NPath complexity of 28125 156226
Assigning an Object to null is a code smell. Consider refactoring. 210
Assigning an Object to null is a code smell. Consider refactoring. 211
When instantiating a SimpleDateFormat object, specify a Locale 243
Unnecessary use of fully qualified name 'java.sql.Date' due to existing import 'java.sql.Date' 288
Unnecessary use of fully qualified name 'java.sql.Date' due to existing import 'java.sql.Date' 289
When instantiating a SimpleDateFormat object, specify a Locale 291
Unnecessary use of fully qualified name 'java.sql.Date' due to existing import 'java.sql.Date' 296
Unnecessary use of fully qualified name 'java.sql.Date' due to existing import 'java.sql.Date' 300
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 414

fr/paris/lutece/plugins/htmldocs/web/ManageHtmldocsJspBean.java

Violation Ligne
Abstract classes should be named AbstractXXX 51135
Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 69
Avoid using redundant field initializer for '_bIsSorted' 72
Avoid unnecessary comparisons in boolean expressions 102
Do not add empty strings 129

fr/paris/lutece/plugins/htmldocs/web/TagJspBean.java

Violation Ligne
Assigning an Object to null is a code smell. Consider refactoring. 119
Avoid declaring a variable if it is unreferenced before a possible exit point. 205
Avoid unused local variables such as 'tag'. 205

fr/paris/lutece/plugins/htmldocs/web/portlet/HtmldocsListPortletJspBean.java

Violation Ligne
Avoid unused local variables such as 'bool'. 96
Avoid declaring a variable if it is unreferenced before a possible exit point. 129
Avoid declaring a variable if it is unreferenced before a possible exit point. 131
Avoid declaring a variable if it is unreferenced before a possible exit point. 134
Avoid declaring a variable if it is unreferenced before a possible exit point. 171
Avoid declaring a variable if it is unreferenced before a possible exit point. 174
Method names should not start with capital letters 199

fr/paris/lutece/plugins/htmldocs/web/portlet/HtmldocsPortletJspBean.java

Violation Ligne
This statement may have some unnecessary parentheses 124
Avoid declaring a variable if it is unreferenced before a possible exit point. 142
Avoid declaring a variable if it is unreferenced before a possible exit point. 161
Avoid declaring a variable if it is unreferenced before a possible exit point. 198