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/util/httpaccess/HttpAccess.java

Rule Violation Line
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 963
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 1295

fr/paris/lutece/util/httpaccess/HttpClientConfiguration.java

Rule Violation Line
FormalParameterNamingConventions The method parameter name '_strProxyHost' doesn't match '[a-z][a-zA-Z0-9]*' 69
FormalParameterNamingConventions The method parameter name '_strProxyPort' doesn't match '[a-z][a-zA-Z0-9]*' 87
FormalParameterNamingConventions The method parameter name '_strProxyUserName' doesn't match '[a-z][a-zA-Z0-9]*' 105
FormalParameterNamingConventions The method parameter name '_strProxyPassword' doesn't match '[a-z][a-zA-Z0-9]*' 123
FormalParameterNamingConventions The method parameter name '_strHostName' doesn't match '[a-z][a-zA-Z0-9]*' 141
FormalParameterNamingConventions The method parameter name '_strDomainName' doesn't match '[a-z][a-zA-Z0-9]*' 159
FormalParameterNamingConventions The method parameter name '_strRealm' doesn't match '[a-z][a-zA-Z0-9]*' 177
FormalParameterNamingConventions The method parameter name '_strNoProxyFor' doesn't match '[a-z][a-zA-Z0-9]*' 195
FormalParameterNamingConventions The method parameter name '_strContentCharset' doesn't match '[a-z][a-zA-Z0-9]*' 213
FormalParameterNamingConventions The method parameter name '_strElementCharset' doesn't match '[a-z][a-zA-Z0-9]*' 231
FormalParameterNamingConventions The method parameter name '_bConnectionPoolEnabled' doesn't match '[a-z][a-zA-Z0-9]*' 285

fr/paris/lutece/util/httpaccess/SimpleResponseValidator.java

Rule Violation Line
FieldNamingConventions The final field name '_aAuthorizedStatus' doesn't match '[a-z][a-zA-Z0-9]*' 46

Priority 3

fr/paris/lutece/util/httpaccess/HttpAccess.java

Rule Violation Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 341352
GodClass Possible God Class (WMC=115, ATFD=87, TCC=12.656%) 831352
CyclomaticComplexity The class 'HttpAccess' has a total cyclomatic complexity of 115 (highest 24). 831352
ExcessiveClassLength Avoid really long classes. 831352
TooManyMethods This class has too many methods, consider refactoring it. 841352
ImmutableField Private field '_responseValidator' could be made final; it is only initialized in the declaration or constructor. 123
ImmutableField Private field '_accessService' could be made final; it is only initialized in the declaration or constructor. 126
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 378379
ConfusingTernary Avoid if (x != y) ..; else ..; 440
ConfusingTernary Avoid if (x != y) ..; else ..; 462
ConfusingTernary Avoid if (x != y) ..; else ..; 488
ConfusingTernary Avoid if (x != y) ..; else ..; 509
ConfusingTernary Avoid if (x != y) ..; else ..; 616
ExcessiveMethodLength Avoid really long methods. 710812
NPathComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has an NPath complexity of 1616 710812
CyclomaticComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has a cyclomatic complexity of 24. 710812
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 713
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 720
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 738757
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 745
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 749
ConfusingTernary Avoid if (x != y) ..; else ..; 762
ConfusingTernary Avoid if (x != y) ..; else ..; 762
ConfusingTernary Avoid if (x != y) ..; else ..; 774
ConfusingTernary Avoid if (x != y) ..; else ..; 774
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 784
ConfusingTernary Avoid if (x != y) ..; else ..; 796
ConfusingTernary Avoid if (x != y) ..; else ..; 803
ConfusingTernary Avoid if (x != y) ..; else ..; 872
ConfusingTernary Avoid if (x != y) ..; else ..; 943
ConfusingTernary Avoid if (x != y) ..; else ..; 10741089
ShortVariable Avoid variables with short names like p 1077
ConfusingTernary Avoid if (x != y) ..; else ..; 11321147
ShortVariable Avoid variables with short names like p 1135
ConfusingTernary Avoid if (x != y) ..; else ..; 1223
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 1230
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 1259
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 1259
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 1259
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 1261
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 1261
ConfusingTernary Avoid if (x != y) ..; else ..; 1338

fr/paris/lutece/util/httpaccess/HttpAccessException.java

Rule Violation Line
ShortVariable Avoid variables with short names like e 56
ShortVariable Avoid variables with short names like e 71

fr/paris/lutece/util/httpaccess/HttpAccessService.java

Rule Violation Line
UnusedPrivateField Avoid unused private fields such as 'PROPERTY_HTTP_PROTOCOLE_CONTENT_CHARSET'. 108
UnusedPrivateField Avoid unused private fields such as 'PROPERTY_HTTP_PROTOCOLE_ELEMENT_CHARSET'. 111
SingularField Perhaps '_httpClient' could be replaced by a local variable. 121
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 131
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 133
NonThreadSafeSingleton Singleton is not thread safe 142148
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 176248
CyclomaticComplexity The method 'getHttpClient(String)' has a cyclomatic complexity of 13. 176248
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 203208
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 210213
CyclomaticComplexity The method 'matches(String, String)' has a cyclomatic complexity of 13. 286336
NPathComplexity The method 'matches(String, String)' has an NPath complexity of 245 286336
ShortVariable Avoid variables with short names like c 299
ShortVariable Avoid variables with short names like p 304
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 358
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 368
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 378
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 388

fr/paris/lutece/util/httpaccess/InvalidResponseStatus.java

Rule Violation Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 4070
ImmutableField Private field '_nResponseStatus' could be made final; it is only initialized in the declaration or constructor. 42
ShortVariable Avoid variables with short names like e 54

fr/paris/lutece/util/httpaccess/MemoryFileItem.java

Rule Violation Line
ImmutableField Private field '_data' could be made final; it is only initialized in the declaration or constructor. 53
ImmutableField Private field '_strName' could be made final; it is only initialized in the declaration or constructor. 54
ImmutableField Private field '_lSize' could be made final; it is only initialized in the declaration or constructor. 55
ImmutableField Private field '_strContentType' could be made final; it is only initialized in the declaration or constructor. 56
ArrayIsStoredDirectly The user-supplied array 'data' is stored directly. 70
MissingOverride The method 'delete()' is missing an @Override annotation. 8184
MissingOverride The method 'get()' is missing an @Override annotation. 8992
MethodReturnsInternalArray Returning '_data' may expose an internal array. 91
MissingOverride The method 'getContentType()' is missing an @Override annotation. 97100
MissingOverride The method 'getFieldName()' is missing an @Override annotation. 107110
MissingOverride The method 'getInputStream()' is missing an @Override annotation. 115118
MissingOverride The method 'getName()' is missing an @Override annotation. 123126
MissingOverride The method 'getOutputStream()' is missing an @Override annotation. 131134
MissingOverride The method 'getSize()' is missing an @Override annotation. 139142
MissingOverride The method 'getString()' is missing an @Override annotation. 147150
MissingOverride The method 'getString(String)' is missing an @Override annotation. 155158
MissingOverride The method 'isFormField()' is missing an @Override annotation. 163166
MissingOverride The method 'isInMemory()' is missing an @Override annotation. 171174
MissingOverride The method 'setFieldName(String)' is missing an @Override annotation. 179182
MissingOverride The method 'setFormField(boolean)' is missing an @Override annotation. 187190
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 195
MissingOverride The method 'write(File)' is missing an @Override annotation. 195198
MissingOverride The method 'getHeaders()' is missing an @Override annotation. 200203
CommentRequired Public method and constructor comments are required 200203
CommentRequired Public method and constructor comments are required 205208
MissingOverride The method 'setHeaders(FileItemHeaders)' is missing an @Override annotation. 205208

Priority 4

fr/paris/lutece/util/httpaccess/HttpAccess.java

Rule Violation Line
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 972987
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 10271044

Files

fr/paris/lutece/util/httpaccess/HttpAccess.java

Rule Violation Priority Line
ExcessiveImports A high number of imports can indicate a high degree of coupling within an object. 3 341352
GodClass Possible God Class (WMC=115, ATFD=87, TCC=12.656%) 3 831352
CyclomaticComplexity The class 'HttpAccess' has a total cyclomatic complexity of 115 (highest 24). 3 831352
ExcessiveClassLength Avoid really long classes. 3 831352
TooManyMethods This class has too many methods, consider refactoring it. 3 841352
ImmutableField Private field '_responseValidator' could be made final; it is only initialized in the declaration or constructor. 3 123
ImmutableField Private field '_accessService' could be made final; it is only initialized in the declaration or constructor. 3 126
UseObjectForClearerAPI Rather than using a lot of String arguments, consider using a container object for those values. 3 378379
ConfusingTernary Avoid if (x != y) ..; else ..; 3 440
ConfusingTernary Avoid if (x != y) ..; else ..; 3 462
ConfusingTernary Avoid if (x != y) ..; else ..; 3 488
ConfusingTernary Avoid if (x != y) ..; else ..; 3 509
ConfusingTernary Avoid if (x != y) ..; else ..; 3 616
ExcessiveMethodLength Avoid really long methods. 3 710812
NPathComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has an NPath complexity of 1616 3 710812
CyclomaticComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has a cyclomatic complexity of 24. 3 710812
PrematureDeclaration Avoid declaring a variable if it is unreferenced before a possible exit point. 3 713
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 720
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 738757
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 745
AvoidLiteralsInIfCondition Avoid using Literals in Conditional Statements 3 749
ConfusingTernary Avoid if (x != y) ..; else ..; 3 762
ConfusingTernary Avoid if (x != y) ..; else ..; 3 762
ConfusingTernary Avoid if (x != y) ..; else ..; 3 774
ConfusingTernary Avoid if (x != y) ..; else ..; 3 774
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 784
ConfusingTernary Avoid if (x != y) ..; else ..; 3 796
ConfusingTernary Avoid if (x != y) ..; else ..; 3 803
ConfusingTernary Avoid if (x != y) ..; else ..; 3 872
ConfusingTernary Avoid if (x != y) ..; else ..; 3 943
AvoidFileStream Avoid instantiating FileInputStream, FileOutputStream, FileReader, or FileWriter 1 963
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 4 972987
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 4 10271044
ConfusingTernary Avoid if (x != y) ..; else ..; 3 10741089
ShortVariable Avoid variables with short names like p 3 1077
ConfusingTernary Avoid if (x != y) ..; else ..; 3 11321147
ShortVariable Avoid variables with short names like p 3 1135
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1223
UseStringBufferForStringAppends Prefer StringBuilder (non-synchronized) or StringBuffer (synchronized) over += for concatenating strings 3 1230
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 1259
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 1259
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 1259
UseLocaleWithCaseConversions When doing a String.toLowerCase()/toUpperCase() call, use a Locale 3 1261
UseIndexOfChar String.indexOf(char) is faster than String.indexOf(String). 3 1261
AvoidThrowingRawExceptionTypes Avoid throwing raw exception types. 1 1295
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1338

fr/paris/lutece/util/httpaccess/HttpAccessException.java

Rule Violation Priority Line
ShortVariable Avoid variables with short names like e 3 56
ShortVariable Avoid variables with short names like e 3 71

fr/paris/lutece/util/httpaccess/HttpAccessService.java

Rule Violation Priority Line
UnusedPrivateField Avoid unused private fields such as 'PROPERTY_HTTP_PROTOCOLE_CONTENT_CHARSET'. 3 108
UnusedPrivateField Avoid unused private fields such as 'PROPERTY_HTTP_PROTOCOLE_ELEMENT_CHARSET'. 3 111
SingularField Perhaps '_httpClient' could be replaced by a local variable. 3 121
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 131
FieldDeclarationsShouldBeAtStartOfClass Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 3 133
NonThreadSafeSingleton Singleton is not thread safe 3 142148
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 176248
CyclomaticComplexity The method 'getHttpClient(String)' has a cyclomatic complexity of 13. 3 176248
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 203208
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 210213
CyclomaticComplexity The method 'matches(String, String)' has a cyclomatic complexity of 13. 3 286336
NPathComplexity The method 'matches(String, String)' has an NPath complexity of 245 3 286336
ShortVariable Avoid variables with short names like c 3 299
ShortVariable Avoid variables with short names like p 3 304
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 358
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 368
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 378
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 388

fr/paris/lutece/util/httpaccess/HttpClientConfiguration.java

Rule Violation Priority Line
FormalParameterNamingConventions The method parameter name '_strProxyHost' doesn't match '[a-z][a-zA-Z0-9]*' 1 69
FormalParameterNamingConventions The method parameter name '_strProxyPort' doesn't match '[a-z][a-zA-Z0-9]*' 1 87
FormalParameterNamingConventions The method parameter name '_strProxyUserName' doesn't match '[a-z][a-zA-Z0-9]*' 1 105
FormalParameterNamingConventions The method parameter name '_strProxyPassword' doesn't match '[a-z][a-zA-Z0-9]*' 1 123
FormalParameterNamingConventions The method parameter name '_strHostName' doesn't match '[a-z][a-zA-Z0-9]*' 1 141
FormalParameterNamingConventions The method parameter name '_strDomainName' doesn't match '[a-z][a-zA-Z0-9]*' 1 159
FormalParameterNamingConventions The method parameter name '_strRealm' doesn't match '[a-z][a-zA-Z0-9]*' 1 177
FormalParameterNamingConventions The method parameter name '_strNoProxyFor' doesn't match '[a-z][a-zA-Z0-9]*' 1 195
FormalParameterNamingConventions The method parameter name '_strContentCharset' doesn't match '[a-z][a-zA-Z0-9]*' 1 213
FormalParameterNamingConventions The method parameter name '_strElementCharset' doesn't match '[a-z][a-zA-Z0-9]*' 1 231
FormalParameterNamingConventions The method parameter name '_bConnectionPoolEnabled' doesn't match '[a-z][a-zA-Z0-9]*' 1 285

fr/paris/lutece/util/httpaccess/InvalidResponseStatus.java

Rule Violation Priority Line
MissingSerialVersionUID Classes implementing Serializable should set a serialVersionUID 3 4070
ImmutableField Private field '_nResponseStatus' could be made final; it is only initialized in the declaration or constructor. 3 42
ShortVariable Avoid variables with short names like e 3 54

fr/paris/lutece/util/httpaccess/MemoryFileItem.java

Rule Violation Priority Line
ImmutableField Private field '_data' could be made final; it is only initialized in the declaration or constructor. 3 53
ImmutableField Private field '_strName' could be made final; it is only initialized in the declaration or constructor. 3 54
ImmutableField Private field '_lSize' could be made final; it is only initialized in the declaration or constructor. 3 55
ImmutableField Private field '_strContentType' could be made final; it is only initialized in the declaration or constructor. 3 56
ArrayIsStoredDirectly The user-supplied array 'data' is stored directly. 3 70
MissingOverride The method 'delete()' is missing an @Override annotation. 3 8184
MissingOverride The method 'get()' is missing an @Override annotation. 3 8992
MethodReturnsInternalArray Returning '_data' may expose an internal array. 3 91
MissingOverride The method 'getContentType()' is missing an @Override annotation. 3 97100
MissingOverride The method 'getFieldName()' is missing an @Override annotation. 3 107110
MissingOverride The method 'getInputStream()' is missing an @Override annotation. 3 115118
MissingOverride The method 'getName()' is missing an @Override annotation. 3 123126
MissingOverride The method 'getOutputStream()' is missing an @Override annotation. 3 131134
MissingOverride The method 'getSize()' is missing an @Override annotation. 3 139142
MissingOverride The method 'getString()' is missing an @Override annotation. 3 147150
MissingOverride The method 'getString(String)' is missing an @Override annotation. 3 155158
MissingOverride The method 'isFormField()' is missing an @Override annotation. 3 163166
MissingOverride The method 'isInMemory()' is missing an @Override annotation. 3 171174
MissingOverride The method 'setFieldName(String)' is missing an @Override annotation. 3 179182
MissingOverride The method 'setFormField(boolean)' is missing an @Override annotation. 3 187190
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 195
MissingOverride The method 'write(File)' is missing an @Override annotation. 3 195198
MissingOverride The method 'getHeaders()' is missing an @Override annotation. 3 200203
CommentRequired Public method and constructor comments are required 3 200203
CommentRequired Public method and constructor comments are required 3 205208
MissingOverride The method 'setHeaders(FileItemHeaders)' is missing an @Override annotation. 3 205208

fr/paris/lutece/util/httpaccess/SimpleResponseValidator.java

Rule Violation Priority Line
FieldNamingConventions The final field name '_aAuthorizedStatus' doesn't match '[a-z][a-zA-Z0-9]*' 1 46