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. 34–1352
GodClass Possible God Class (WMC=115, ATFD=87, TCC=12.656%) 83–1352
CyclomaticComplexity The class 'HttpAccess' has a total cyclomatic complexity of 115 (highest 24). 83–1352
ExcessiveClassLength Avoid really long classes. 83–1352
TooManyMethods This class has too many methods, consider refactoring it. 84–1352
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. 378–379
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. 710–812
NPathComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has an NPath complexity of 1616 710–812
CyclomaticComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has a cyclomatic complexity of 24. 710–812
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 738–757
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 ..; 1074–1089
ShortVariable Avoid variables with short names like p 1077
ConfusingTernary Avoid if (x != y) ..; else ..; 1132–1147
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 142–148
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 176–248
CyclomaticComplexity The method 'getHttpClient(String)' has a cyclomatic complexity of 13. 176–248
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 203–208
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 210–213
CyclomaticComplexity The method 'matches(String, String)' has a cyclomatic complexity of 13. 286–336
NPathComplexity The method 'matches(String, String)' has an NPath complexity of 245 286–336
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 40–70
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. 81–84
MissingOverride The method 'get()' is missing an @Override annotation. 89–92
MethodReturnsInternalArray Returning '_data' may expose an internal array. 91
MissingOverride The method 'getContentType()' is missing an @Override annotation. 97–100
MissingOverride The method 'getFieldName()' is missing an @Override annotation. 107–110
MissingOverride The method 'getInputStream()' is missing an @Override annotation. 115–118
MissingOverride The method 'getName()' is missing an @Override annotation. 123–126
MissingOverride The method 'getOutputStream()' is missing an @Override annotation. 131–134
MissingOverride The method 'getSize()' is missing an @Override annotation. 139–142
MissingOverride The method 'getString()' is missing an @Override annotation. 147–150
MissingOverride The method 'getString(String)' is missing an @Override annotation. 155–158
MissingOverride The method 'isFormField()' is missing an @Override annotation. 163–166
MissingOverride The method 'isInMemory()' is missing an @Override annotation. 171–174
MissingOverride The method 'setFieldName(String)' is missing an @Override annotation. 179–182
MissingOverride The method 'setFormField(boolean)' is missing an @Override annotation. 187–190
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 195
MissingOverride The method 'write(File)' is missing an @Override annotation. 195–198
MissingOverride The method 'getHeaders()' is missing an @Override annotation. 200–203
CommentRequired Public method and constructor comments are required 200–203
CommentRequired Public method and constructor comments are required 205–208
MissingOverride The method 'setHeaders(FileItemHeaders)' is missing an @Override annotation. 205–208

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. 972–987
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 1027–1044

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 34–1352
GodClass Possible God Class (WMC=115, ATFD=87, TCC=12.656%) 3 83–1352
CyclomaticComplexity The class 'HttpAccess' has a total cyclomatic complexity of 115 (highest 24). 3 83–1352
ExcessiveClassLength Avoid really long classes. 3 83–1352
TooManyMethods This class has too many methods, consider refactoring it. 3 84–1352
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 378–379
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 710–812
NPathComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has an NPath complexity of 1616 3 710–812
CyclomaticComplexity The method 'doPostMultiPart(String, Map, Map, RequestAuthenticator, List, Map, Map)' has a cyclomatic complexity of 24. 3 710–812
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 738–757
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 972–987
DoNotThrowExceptionInFinally A throw statement in a finally block makes the control flow hard to understand. 4 1027–1044
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1074–1089
ShortVariable Avoid variables with short names like p 3 1077
ConfusingTernary Avoid if (x != y) ..; else ..; 3 1132–1147
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 142–148
AvoidSynchronizedAtMethodLevel Use block level rather than method level synchronization 3 176–248
CyclomaticComplexity The method 'getHttpClient(String)' has a cyclomatic complexity of 13. 3 176–248
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 203–208
AvoidDeeplyNestedIfStmts Deeply nested if..then statements are hard to read 3 210–213
CyclomaticComplexity The method 'matches(String, String)' has a cyclomatic complexity of 13. 3 286–336
NPathComplexity The method 'matches(String, String)' has an NPath complexity of 245 3 286–336
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 40–70
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 81–84
MissingOverride The method 'get()' is missing an @Override annotation. 3 89–92
MethodReturnsInternalArray Returning '_data' may expose an internal array. 3 91
MissingOverride The method 'getContentType()' is missing an @Override annotation. 3 97–100
MissingOverride The method 'getFieldName()' is missing an @Override annotation. 3 107–110
MissingOverride The method 'getInputStream()' is missing an @Override annotation. 3 115–118
MissingOverride The method 'getName()' is missing an @Override annotation. 3 123–126
MissingOverride The method 'getOutputStream()' is missing an @Override annotation. 3 131–134
MissingOverride The method 'getSize()' is missing an @Override annotation. 3 139–142
MissingOverride The method 'getString()' is missing an @Override annotation. 3 147–150
MissingOverride The method 'getString(String)' is missing an @Override annotation. 3 155–158
MissingOverride The method 'isFormField()' is missing an @Override annotation. 3 163–166
MissingOverride The method 'isInMemory()' is missing an @Override annotation. 3 171–174
MissingOverride The method 'setFieldName(String)' is missing an @Override annotation. 3 179–182
MissingOverride The method 'setFormField(boolean)' is missing an @Override annotation. 3 187–190
SignatureDeclareThrowsException A method/constructor should not explicitly throw java.lang.Exception 3 195
MissingOverride The method 'write(File)' is missing an @Override annotation. 3 195–198
MissingOverride The method 'getHeaders()' is missing an @Override annotation. 3 200–203
CommentRequired Public method and constructor comments are required 3 200–203
CommentRequired Public method and constructor comments are required 3 205–208
MissingOverride The method 'setHeaders(FileItemHeaders)' is missing an @Override annotation. 3 205–208

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