Fork me on GitHub

PMD Results

The following document contains the results of PMD 5.5.1.

Files

fr/paris/lutece/plugins/parisconnect/business/Category.java

Violation Line
Avoid unused imports such as 'javax.validation.constraints' 36
Avoid unused imports such as 'org.hibernate.validator.constraints' 37

fr/paris/lutece/plugins/parisconnect/business/Newsletter.java

Violation Line
A getX() method which returns a boolean should be named isX() 158161

fr/paris/lutece/plugins/parisconnect/business/NewsletterHome.java

Violation Line
Avoid unused imports such as 'fr.paris.lutece.util.sql.DAOUtil' 45
Avoid unused imports such as 'fr.paris.lutece.util.sql.DAOUtil' 45

fr/paris/lutece/plugins/parisconnect/business/portlet/ParisconnectPortlet.java

Violation Line
It is a good practice to call super() in a constructor 5255

fr/paris/lutece/plugins/parisconnect/business/portlet/ParisconnectPortletDAO.java

Violation Line
Avoid variables with short names like p 63
Avoid variables with short names like p 92

fr/paris/lutece/plugins/parisconnect/business/portlet/ParisconnectPortletHome.java

Violation Line
Possible unsafe assignment to a non-final static field in a constructor. 51
It is a good practice to call super() in a constructor 5662
Singleton is not thread safe 8487

fr/paris/lutece/plugins/parisconnect/rs/AlertRest.java

Violation Line
The Logger variable declaration does not contain the static and final modifiers 64
A switch with less than three branches is inefficient, use a if statement instead. 8288
Avoid empty catch blocks 112114
A switch with less than three branches is inefficient, use a if statement instead. 160166
Avoid empty catch blocks 190192

fr/paris/lutece/plugins/parisconnect/rs/Constants.java

Violation Line
Avoid variables with short names like ID 48

fr/paris/lutece/plugins/parisconnect/rs/MessageRest.java

Violation Line
The Logger variable declaration does not contain the static and final modifiers 66
This final field could be made static 67
A switch with less than three branches is inefficient, use a if statement instead. 8692
A switch with less than three branches is inefficient, use a if statement instead. 113119
Avoid declaring a variable if it is unreferenced before a possible exit point. 133
Avoid empty catch blocks 145147
Avoid empty catch blocks 203205

fr/paris/lutece/plugins/parisconnect/rs/NewsletterRest.java

Violation Line
The Logger variable declaration does not contain the static and final modifiers 64
A switch with less than three branches is inefficient, use a if statement instead. 8288
Avoid empty catch blocks 112114
A switch with less than three branches is inefficient, use a if statement instead. 158164
Avoid empty catch blocks 188190

fr/paris/lutece/plugins/parisconnect/service/AlertCacheService.java

Violation Line
It is a good practice to call super() in a constructor 4750

fr/paris/lutece/plugins/parisconnect/service/JsonUtil.java

Violation Line
Avoid unused imports such as 'org.apache.tika.metadata.Property.ValueType' 40
Avoid unused imports such as 'org.apache.tika.metadata.Property.ValueType' 40
Avoid unused imports such as 'org.codehaus.jackson.type.TypeReference' 45
Avoid unused imports such as 'org.codehaus.jackson.type.TypeReference' 45
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 47
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 47
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. 57136

fr/paris/lutece/plugins/parisconnect/service/NewsletterCacheService.java

Violation Line
It is a good practice to call super() in a constructor 4750

fr/paris/lutece/plugins/parisconnect/service/ParisConnectAPI.java

Violation Line
The Logger variable declaration does not contain the static and final modifiers 73
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 227
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 287
New exception is thrown in catch block, original stack trace may be lost 328

fr/paris/lutece/plugins/parisconnect/service/ParisConnectAPIService.java

Violation Line
Possible God class (WMC=59, ATFD=61, TCC=0.16205533596837945) 34820
The class 'ParisConnectAPIService' has a Cyclomatic Complexity of 3 (Highest = 10). 57820
The class 'ParisConnectAPIService' has a Standard Cyclomatic Complexity of 3 (Highest = 10). 57820
The class 'ParisConnectAPIService' has a Modified Cyclomatic Complexity of 3 (Highest = 10). 57820
Avoid unused private fields such as 'METHOD_CHECK_CONNECTION_COOKIE'. 108
Avoid unused private fields such as 'PARAMETER_CONNECTION_COOKIE'. 111
Avoid unused private fields such as 'KEY_SUCCESS'. 113
The Logger variable declaration does not contain the static and final modifiers 132
Unnecessary use of fully qualified name 'org.apache.log4j.Logger.getLogger' due to existing import 'org.apache.log4j.Logger' 132
Use explicit scoping instead of the default package private level 146162
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 148
Use explicit scoping instead of the default package private level 169186
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 171
Use explicit scoping instead of the default package private level 195211
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 197
Use explicit scoping instead of the default package private level 218235
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 220
Use explicit scoping instead of the default package private level 244262
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 246
Use explicit scoping instead of the default package private level 270288
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 272
Use explicit scoping instead of the default package private level 297315
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 299
Use explicit scoping instead of the default package private level 323341
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 325
Use explicit scoping instead of the default package private level 348373
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 350
Avoid variables with short names like jo 360
The String literal "Account Shadow API call : mail=" appears 4 times in this file; the first occurrence is on line 365 365
The String literal " - " appears 6 times in this file; the first occurrence is on line 365 365
Use explicit scoping instead of the default package private level 381408
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 383
Avoid variables with short names like jo 395
Rather than using a lot of String arguments, consider using a container object for those values. 417
Use explicit scoping instead of the default package private level 417445
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 419
Avoid unused local variables such as 'strResponse'. 426
Use explicit scoping instead of the default package private level 454490
Avoid reassigning parameters such as 'strMessage' 454
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 456
Use explicit scoping instead of the default package private level 498515
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 500
The method 'sendMessage' has a Modified Cyclomatic Complexity of 10. 522572
The method sendMessage() has an NPath complexity of 512 522572
Use explicit scoping instead of the default package private level 522572
The method 'sendMessage' has a Cyclomatic Complexity of 10. 522572
The method 'sendMessage' has a Standard Cyclomatic Complexity of 10. 522572
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 524
Use explicit scoping instead of the default package private level 580596
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 582
Use explicit scoping instead of the default package private level 604620
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 606
Use explicit scoping instead of the default package private level 630647
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 632
Use explicit scoping instead of the default package private level 654671
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 656
Use explicit scoping instead of the default package private level 679696
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 681
Use explicit scoping instead of the default package private level 705723
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 707
Use explicit scoping instead of the default package private level 736754
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 738
Use explicit scoping instead of the default package private level 762779
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 764
Use explicit scoping instead of the default package private level 788805
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 790

fr/paris/lutece/plugins/parisconnect/service/ParisConnectIncludeService.java

Violation Line
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. 22154
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 55
Assigning an Object to null is a code smell. Consider refactoring. 56
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 80
Assigning an Object to null is a code smell. Consider refactoring. 81
Assigning an Object to null is a code smell. Consider refactoring. 107
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 108
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 133
Assigning an Object to null is a code smell. Consider refactoring. 134

fr/paris/lutece/plugins/parisconnect/service/ParisConnectService.java

Violation Line
Possible God class (WMC=100, ATFD=64, TCC=0.002150537634408602) 34765
Avoid unused imports such as 'java.sql.Date' 36
Avoid unused imports such as 'java.sql.Date' 36
Avoid unused imports such as 'com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException' 46
Avoid unused imports such as 'com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException' 46
Avoid unused imports such as 'fr.paris.lutece.util.date.DateUtil' 58
Avoid unused imports such as 'fr.paris.lutece.util.date.DateUtil' 58
The Logger variable declaration does not contain the static and final modifiers 84
When instantiating a SimpleDateFormat object, specify a Locale 87
Singleton is not thread safe 106109
Avoid declaring a variable if it is unreferenced before a possible exit point. 126
Assigning an Object to null is a code smell. Consider refactoring. 130
Avoid declaring a variable if it is unreferenced before a possible exit point. 168
Assigning an Object to null is a code smell. Consider refactoring. 414
Assigning an Object to null is a code smell. Consider refactoring. 440
An empty statement (semicolon) not part of a loop 440
Rather than using a lot of String arguments, consider using a container object for those values. 501
When doing a String.toLowerCase()/toUpperCase() call, use a Locale 520
Using equalsIgnoreCase() is cleaner than using toUpperCase/toLowerCase().equals(). 520
Static DateFormatter objects should be accessed in a synchronized manner 700

fr/paris/lutece/plugins/parisconnect/service/UserCacheService.java

Violation Line
It is a good practice to call super() in a constructor 4750

fr/paris/lutece/plugins/parisconnect/service/UserNameCacheService.java

Violation Line
It is a good practice to call super() in a constructor 4750

fr/paris/lutece/plugins/parisconnect/web/AlertJspBean.java

Violation Line
Assigning an Object to null is a code smell. Consider refactoring. 109

fr/paris/lutece/plugins/parisconnect/web/AlertXPage.java

Violation Line
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.AlertHome' 37
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.AlertHome' 37
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 40
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 40
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceList' 47
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceList' 47
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 48
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 48
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageService' 49
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageService' 49
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessage' 50
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessage' 50
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageException' 51
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageException' 51
The class 'AlertXPage' has a Cyclomatic Complexity of 6 (Highest = 10). 68228
The method 'getManageAlerts' has a Cyclomatic Complexity of 10. 101171
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 133

fr/paris/lutece/plugins/parisconnect/web/CategoryJspBean.java

Violation Line
Assigning an Object to null is a code smell. Consider refactoring. 107

fr/paris/lutece/plugins/parisconnect/web/ManageParisconnectJspBean.java

Violation Line
Abstract classes should be named AbstractXXX 4998
Perhaps '_nDefaultItemsPerPage' could be replaced by a local variable. 65
Do not add empty strings 92

fr/paris/lutece/plugins/parisconnect/web/MessageXPage.java

Violation Line
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Alert' 36
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Alert' 36
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.AlertHome' 37
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.AlertHome' 37
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Category' 38
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Category' 38
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.CategoryHome' 39
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.CategoryHome' 39
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 41
Avoid unused imports such as 'fr.paris.lutece.plugins.parisconnect.business.Newsletter' 41
Avoid unused imports such as 'fr.paris.lutece.portal.util.mvc.commons.annotations.Action' 44
Avoid unused imports such as 'fr.paris.lutece.portal.util.mvc.commons.annotations.Action' 44
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceList' 49
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceList' 49
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 50
Avoid unused imports such as 'fr.paris.lutece.util.url.UrlItem' 50
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageService' 51
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageService' 51
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessage' 52
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessage' 52
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageException' 53
Avoid unused imports such as 'fr.paris.lutece.portal.service.message.SiteMessageException' 53
Avoid unused imports such as 'java.util.ArrayList' 58
Avoid unused imports such as 'java.util.ArrayList' 58
Avoid declaring a variable if it is unreferenced before a possible exit point. 106
Avoid declaring a variable if it is unreferenced before a possible exit point. 107
Avoid declaring a variable if it is unreferenced before a possible exit point. 109
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. 145
Avoid declaring a variable if it is unreferenced before a possible exit point. 147
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 204

fr/paris/lutece/plugins/parisconnect/web/NewsletterJspBean.java

Violation Line
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceItem' 55
Avoid unused imports such as 'fr.paris.lutece.util.ReferenceItem' 55
Avoid unused private fields such as 'ERROR_PICTURE_EMPTY'. 110
Assigning an Object to null is a code smell. Consider refactoring. 124
Avoid declaring a variable if it is unreferenced before a possible exit point. 162
Avoid declaring a variable if it is unreferenced before a possible exit point. 273

fr/paris/lutece/plugins/parisconnect/web/NewsletterXPage.java

Violation Line
Avoid unused private fields such as 'JSP_PAGE_PORTAL'. 65
Avoid unused private fields such as 'PARAM_ACTION'. 69
Avoid unused private fields such as 'PARAM_PAGE'. 70
Avoid unused private fields such as 'MARK_NEWSLETTER'. 76
Avoid unused private fields such as 'MESSAGE_CONFIRM_REMOVE_NEWSLETTER'. 79

fr/paris/lutece/plugins/parisconnect/web/ParisConnectXPage.java

Violation Line
Deeply nested if..then statements are hard to read 116124

fr/paris/lutece/plugins/parisconnect/web/mydashboard/MyDashboardAlerts.java

Violation Line
The class 'MyDashboardAlerts' has a Cyclomatic Complexity of 4 (Highest = 10). 23123
The method 'getDashboardData' has a Cyclomatic Complexity of 10. 37109
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 39
Substitute calls to size() == 0 (or size() != 0, size() > 0, size() < 1) with calls to isEmpty() 68

fr/paris/lutece/plugins/parisconnect/web/mydashboard/MyDashboardMessages.java

Violation Line
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 37

fr/paris/lutece/plugins/parisconnect/web/mydashboard/MyDashboardNewsletters.java

Violation Line
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 33

fr/paris/lutece/plugins/parisconnect/web/portlet/ParisconnectPortletJspBean.java

Violation Line
Avoid declaring a variable if it is unreferenced before a possible exit point. 97