PMD Results

The following document contains the results of PMD 5.6.1.

Files

fr/cnes/doi/client/BaseClient.java

Violation Line
Use of modifier volatile is not recommended. 62

fr/cnes/doi/client/ClientLandingPage.java

Violation Line
Avoid instantiating new objects inside loops 95

fr/cnes/doi/client/ClientMDS.java

Violation Line
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 162
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 166
Assigning an Object to null is a code smell. Consider refactoring. 200
publicMethodCommentRequirement Required 439441

fr/cnes/doi/db/MyMemoryRealm.java

Violation Line
Avoid instantiating new objects inside loops 132

fr/cnes/doi/exception/AuthenticationAccessException.java

Violation Line
Avoid variables with short names like ex 34

fr/cnes/doi/exception/DOIDbException.java

Violation Line
Avoid variables with short names like ex 36

fr/cnes/doi/exception/DoiServerException.java

Violation Line
Avoid variables with short names like ex 54
Avoid variables with short names like ex 111

fr/cnes/doi/logging/api/MonitoringLogFilter.java

Violation Line
Do not add empty strings 119

fr/cnes/doi/logging/security/DoiSecurityLogFilter.java

Violation Line
Avoid unnecessary constructors - the compiler will generate these for you 5153

fr/cnes/doi/plugin/AbstractAuthenticationPluginHelper.java

Violation Line
Document empty constructor 3536

fr/cnes/doi/plugin/impl/db/DefaultLDAPImpl.java

Violation Line
Consider replacing this Hashtable with the newer java.util.Map 234
The String literal "com.sun.jndi.ldap.LdapCtxFactory" appears 4 times in this file; the first occurrence is on line 239 239
The String literal "simple" appears 4 times in this file; the first occurrence is on line 241 241
Consider replacing this Hashtable with the newer java.util.Map 263
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 290
There is log block not surrounded by if 325
There is log block not surrounded by if 325
Avoid instantiating new objects inside loops 407

fr/cnes/doi/plugin/impl/db/DefaultProjectSuffixImpl.java

Violation Line
publicMethodCommentRequirement Required 131135
Avoid empty catch blocks 360361
publicMethodCommentRequirement Required 366368

fr/cnes/doi/plugin/impl/db/DefaultTokenImpl.java

Violation Line
Avoid empty catch blocks 277278

fr/cnes/doi/plugin/impl/db/DefaultUserRoleImpl.java

Violation Line
Avoid empty catch blocks 451452

fr/cnes/doi/plugin/impl/db/impl/DOIDbDataAccessServiceImpl.java

Violation Line
The String literal "%s WHERE %s=?" appears 4 times in this file; the first occurrence is on line 130 130
The String literal "Parameter\n\t statement: {}" appears 5 times in this file; the first occurrence is on line 335 335
Avoid variables with short names like rs 338
Avoid instantiating new objects inside loops 340
Avoid variables with short names like rs 361
Avoid instantiating new objects inside loops 363
Avoid variables with short names like rs 385
Avoid variables with short names like rs 418
The String literal "OBL_UNSATISFIED_OBLIGATION" appears 19 times in this file; the first occurrence is on line 473 473
The String literal "Cleans up with closeAndRelease method" appears 19 times in this file; the first occurrence is on line 474 474
Ensure that resources like this Connection object are closed after use 478
Ensure that resources like this Connection object are closed after use 504
Ensure that resources like this Connection object are closed after use 530
Ensure that resources like this Connection object are closed after use 559
Ensure that resources like this Connection object are closed after use 586
Ensure that resources like this Connection object are closed after use 613
Ensure that resources like this Connection object are closed after use 641
Ensure that resources like this Connection object are closed after use 688
The String literal "Parameters:\n\tusername:{}" appears 6 times in this file; the first occurrence is on line 715 715
Ensure that resources like this Connection object are closed after use 716
Ensure that resources like this Connection object are closed after use 754
Ensure that resources like this Connection object are closed after use 781
Ensure that resources like this Connection object are closed after use 808
Assigning an Object to null is a code smell. Consider refactoring. 824
Ensure that resources like this Connection object are closed after use 835
Ensure that resources like this Connection object are closed after use 861
Ensure that resources like this Connection object are closed after use 888
Ensure that resources like this Connection object are closed after use 913
Ensure that resources like this Connection object are closed after use 947
Ensure that resources like this Connection object are closed after use 975
Ensure that resources like this Connection object are closed after use 1024
Assigning an Object to null is a code smell. Consider refactoring. 1040
Assigning an Object to null is a code smell. Consider refactoring. 1060

fr/cnes/doi/plugin/impl/db/impl/JDBCConnector.java

Violation Line
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 146

fr/cnes/doi/resource/AbstractResource.java

Violation Line
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 53
Use of modifier volatile is not recommended. 53
The field name indicates a constant but its modifiers do not 53
The Logger variable declaration does not contain the static and final modifiers 53

fr/cnes/doi/resource/admin/AuthenticateResource.java

Violation Line
publicMethodCommentRequirement Required 3436

fr/cnes/doi/resource/admin/ConfigIhmResource.java

Violation Line
Use of modifier volatile is not recommended. 49
The field name indicates a constant but its modifiers do not 49
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 49
The Logger variable declaration does not contain the static and final modifiers 49

fr/cnes/doi/resource/admin/FooterIhmResource.java

Violation Line
The field name indicates a constant but its modifiers do not 49
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 49
Use of modifier volatile is not recommended. 49
The Logger variable declaration does not contain the static and final modifiers 49
protectedMethodCommentRequirement Required 5259
protectedMethodCommentRequirement Required 9097

fr/cnes/doi/resource/admin/ManageProjectsResource.java

Violation Line
The field name indicates a constant but its modifiers do not 56
Use of modifier volatile is not recommended. 56
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 56
The Logger variable declaration does not contain the static and final modifiers 56
Use of modifier volatile is not recommended. 61
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 118
There is log block not surrounded by if 119
Avoid if (x != y) ..; else ..; 127135

fr/cnes/doi/resource/admin/ManageSuperUserResource.java

Violation Line
Use of modifier volatile is not recommended. 47
The field name indicates a constant but its modifiers do not 47
The Logger variable declaration does not contain the static and final modifiers 47
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 47
Use of modifier volatile is not recommended. 52
protectedMethodCommentRequirement Required 111127
protectedMethodCommentRequirement Required 130146

fr/cnes/doi/resource/admin/ManageSuperUsersResource.java

Violation Line
Use of modifier volatile is not recommended. 54
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 54
The field name indicates a constant but its modifiers do not 54
The Logger variable declaration does not contain the static and final modifiers 54
Avoid if (x != y) ..; else ..; 8795
New exception is thrown in catch block, original stack trace may be lost 120

fr/cnes/doi/resource/admin/ManageUsersResource.java

Violation Line
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 55
Use of modifier volatile is not recommended. 55
The field name indicates a constant but its modifiers do not 55
The Logger variable declaration does not contain the static and final modifiers 55
Use of modifier volatile is not recommended. 60
Use of modifier volatile is not recommended. 65
New exception is thrown in catch block, original stack trace may be lost 107

fr/cnes/doi/resource/admin/RedirectingResource.java

Violation Line
publicMethodCommentRequirement Required 3641

fr/cnes/doi/resource/admin/SuffixProjectsDoisResource.java

Violation Line
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 49
The field name indicates a constant but its modifiers do not 49
The Logger variable declaration does not contain the static and final modifiers 49
Use of modifier volatile is not recommended. 49
Use of modifier volatile is not recommended. 54
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 96

fr/cnes/doi/resource/admin/SuffixProjectsResource.java

Violation Line
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 75
The Logger variable declaration does not contain the static and final modifiers 75
Use of modifier volatile is not recommended. 75
The field name indicates a constant but its modifiers do not 75
Use of modifier volatile is not recommended. 80
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 96
There is log block not surrounded by if 96
New exception is thrown in catch block, original stack trace may be lost 121122
New exception is thrown in catch block, original stack trace may be lost 146147

fr/cnes/doi/resource/admin/TokenResource.java

Violation Line
Use of modifier volatile is not recommended. 88
Use of modifier volatile is not recommended. 93
Use of modifier volatile is not recommended. 98
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 98
The Logger variable declaration does not contain the static and final modifiers 98
The field name indicates a constant but its modifiers do not 98

fr/cnes/doi/resource/citation/BaseCitationResource.java

Violation Line
The field name indicates a constant but its modifiers do not 55
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 55
The Logger variable declaration does not contain the static and final modifiers 55
Use of modifier volatile is not recommended. 55
Use of modifier volatile is not recommended. 60

fr/cnes/doi/resource/citation/FormatCitationResource.java

Violation Line
Use of modifier volatile is not recommended. 51
Use of modifier volatile is not recommended. 56
Use of modifier volatile is not recommended. 61
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 76
There is log block not surrounded by if 76
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 77
There is log block not surrounded by if 77
There is log block not surrounded by if 78
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 78

fr/cnes/doi/resource/mds/BaseMdsResource.java

Violation Line
Use of modifier volatile is not recommended. 59
The Logger variable declaration does not contain the static and final modifiers 59
The field name indicates a constant but its modifiers do not 59
Variables should start with a lowercase character, 'LOG' starts with uppercase character. 59
Use of modifier volatile is not recommended. 64
The String literal "Parameter : {}" appears 5 times in this file; the first occurrence is on line 87 87
There is log block not surrounded by if 220
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 220
The String literal "explainRepresentationID" appears 8 times in this file; the first occurrence is on line 251 251

fr/cnes/doi/resource/mds/DoiResource.java

Violation Line
Use of modifier volatile is not recommended. 58
The String literal "explainRepresentationID" appears 4 times in this file; the first occurrence is on line 208 208

fr/cnes/doi/resource/mds/MediaResource.java

Violation Line
Use of modifier volatile is not recommended. 57
The String literal "explainRepresentationID" appears 5 times in this file; the first occurrence is on line 241 241

fr/cnes/doi/resource/mds/MetadataResource.java

Violation Line
Use of modifier volatile is not recommended. 61
There is log block not surrounded by if 74
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 74
The String literal "explainRepresentationID" appears 5 times in this file; the first occurrence is on line 246 246

fr/cnes/doi/resource/mds/MetadatasResource.java

Violation Line
The String literal "explainRepresentationID" appears 4 times in this file; the first occurrence is on line 209 209

fr/cnes/doi/security/AllowerIP.java

Violation Line
There is log block not surrounded by if 101
There is log block not surrounded by if 101

fr/cnes/doi/security/LoginBasedVerifier.java

Violation Line
Avoid declaring a variable if it is unreferenced before a possible exit point. 93
There is log block not surrounded by if 95
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 95
A method should have only one exit point, and that should be the last statement in the method 98

fr/cnes/doi/security/RoleAuthorizer.java

Violation Line
Avoid instantiating new objects inside loops 113
Avoid instantiating new objects inside loops 159160
Avoid instantiating new objects inside loops 167
Avoid instantiating new objects inside loops 169

fr/cnes/doi/security/TokenSecurity.java

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

fr/cnes/doi/server/DoiServer.java

Violation Line
There is log block not surrounded by if 357

fr/cnes/doi/services/LandingPageMonitoring.java

Violation Line
publicMethodCommentRequirement Required 6062
Avoid instantiating new objects inside loops 100
Avoid instantiating new objects inside loops 106
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 116

fr/cnes/doi/settings/DoiSettings.java

Violation Line
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 87
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 92
Avoid reassigning parameters such as 'level' 109
Assigning an Object to null is a code smell. Consider refactoring. 111
debug logging that involves string concatenation should be guarded with isDebugEnabled() checks 166
There is log block not surrounded by if 166
The String literal "Parameter\n\tkey : {}" appears 6 times in this file; the first occurrence is on line 287 287

fr/cnes/doi/settings/EmailSettings.java

Violation Line
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 198
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 202
Avoid variables with short names like to 272
Avoid variables with short names like to 301

org/restlet/ext/httpclient4/HttpDOIClientHelper.java

Violation Line
Use of modifier volatile is not recommended. 54
Assigning an Object to null is a code smell. Consider refactoring. 65
If you run in Java5 or newer and have concurrent access, you should use the ConcurrentHashMap implementation 228
Avoid variables with short names like v 236
Avoid variables with short names like v 237
Avoid variables with short names like v 238
Avoid variables with short names like v 239
Avoid variables with short names like v 240
Avoid variables with short names like v 241
Assigning an Object to null is a code smell. Consider refactoring. 268

org/restlet/ext/httpclient4/HttpMethodCall.java

Violation Line
The class 'HttpMethodCall' has a Modified Cyclomatic Complexity of 4 (Highest = 13). 60428
Use of modifier volatile is not recommended. 65
Use of modifier volatile is not recommended. 70
Use of modifier volatile is not recommended. 75
Use of modifier volatile is not recommended. 80
The constructor 'HttpMethodCall' has a Modified Cyclomatic Complexity of 13. 92156
Parameter 'hasEntity' is not assigned and could be declared final 93
Assigning an Object to null is a code smell. Consider refactoring. 142
Avoid if (x != y) ..; else ..; 182187
Assigning an Object to null is a code smell. Consider refactoring. 242
Assigning an Object to null is a code smell. Consider refactoring. 243
publicMethodCommentRequirement Required 248251
Local variable 'header' could be declared final 275
Avoid if (x != y) ..; else ..; 300305
Avoid really long methods. 313408
The method 'sendRequest' has a Modified Cyclomatic Complexity of 12. 313408
Avoid if (x != y) ..; else ..; 356358
Assigning an Object to null is a code smell. Consider refactoring. 358