PMD Results

The following document contains the results of PMD 3.9.

Files

org/limmen/crs/client/ClientConfigurationFactory.java

ViolationLine
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.16 - 44
Avoid unused imports such as 'org.limmen.crs.client.locator.StaticServiceLocator'19
Avoid unused imports such as 'org.limmen.crs.client.transport.HttpTransport'20
Each class should declare at least one constructor36 - 44
Parameter 'transport' is not assigned and could be declared final38
Parameter 'serviceLocator' is not assigned and could be declared final38

org/limmen/crs/client/ClientConfigurationUtil.java

ViolationLine
Avoid unused imports such as 'org.limmen.crs.client.transport.HttpTransport'21
Possible unsafe assignment to a non-final static field in a constructor.39
Parameter 'aSection' is not assigned and could be declared final50
Parameter 'aSetting' is not assigned and could be declared final50
Parameter 'aSection' is not assigned and could be declared final80
Parameter 'aSetting' is not assigned and could be declared final80
Parameter 'aSection' is not assigned and could be declared final94
Parameter 'aSetting' is not assigned and could be declared final94
Parameter 'aSection' is not assigned and could be declared final108
Parameter 'aSetting' is not assigned and could be declared final108
Parameter 'aSection' is not assigned and could be declared final122
Parameter 'aSetting' is not assigned and could be declared final122
Parameter 'aSection' is not assigned and could be declared final136
Parameter 'aSetting' is not assigned and could be declared final136
Parameter 'aSection' is not assigned and could be declared final163
Parameter 'aSetting' is not assigned and could be declared final163

org/limmen/crs/client/locator/MDNSServiceLocator.java

ViolationLine
Avoid unnecessary constructors - the compiler will generate these for you31 - 34
Found 'DD'-anomaly for variable 'jmdns' (lines '39'-'58').39 - 58
Found 'DD'-anomaly for variable 'hostname' (lines '40'-'67').40 - 67
Found 'DD'-anomaly for variable 'port' (lines '41'-'69').41 - 69
Found 'DD'-anomaly for variable 'contextPath' (lines '42'-'71').42 - 71
Local variable 'addressesEnum' could be declared final46 - 47
Local variable 'serviceInfo' could be declared final60 - 63
Avoid if (x != y) ..; else ..;65 - 79

org/limmen/crs/client/locator/StaticServiceLocator.java

ViolationLine
Each class should declare at least one constructor22 - 52
Found 'DD'-anomaly for variable 'service' (lines '27'-'36').27 - 36
Avoid if (x != y) ..; else ..;29 - 48
Local variable 'hostname' could be declared final32
Local variable 'port' could be declared final33
Local variable 'contextPath' could be declared final34

org/limmen/crs/client/transport/AbstractTransport.java

ViolationLine
Each class should declare at least one constructor23 - 44
Perhaps 'service' could be replaced by a local variable.25
Parameter 'serviceLocator' is not assigned and could be declared final40

org/limmen/crs/client/transport/HttpTransport.java

ViolationLine
Local variable 'data' could be declared final44
Avoid unnecessary constructors - the compiler will generate these for you60 - 63
Parameter 'aSection' is not assigned and could be declared final65
Parameter 'aSetting' is not assigned and could be declared final65
Parameter 'configurationName' is not assigned and could be declared final65
Local variable 'buffer' could be declared final67
StringBuffer constructor is initialized with size 16, but has at least 51 characters appended.67
Avoid appending characters as strings in StringBuffer.append.76
StringBuffer.append is called 2 consecutive times with literal Strings. Use a single append with a single String.91
Found 'UR'-anomaly for variable 'nameValuePair' (lines '120'-'120').120
Found 'UR'-anomaly for variable 'readLine' (lines '120'-'120').120
Parameter 'anId' is not assigned and could be declared final120
Parameter 'configurationName' is not assigned and could be declared final120
Parameter 'section' is not assigned and could be declared final120
Local variable 'query' could be declared final122
Found 'DD'-anomaly for variable 'reader' (lines '123'-'137').123 - 137
Found 'DD'-anomaly for variable 'type' (lines '124'-'147').124 - 147
Found 'DD'-anomaly for variable 'value' (lines '125'-'151').125 - 151
Local variable 'connection' could be declared final129 - 130
Found 'DD'-anomaly for variable 'readLine' (lines '139'-'141').139 - 141
Avoid assignments in operands141
Found 'DU'-anomaly for variable 'readLine' (lines '141'-'185').141 - 185
Local variable 'nameValuePair' could be declared final143
Avoid instantiating new objects inside loops143
Found 'DD'-anomaly for variable 'type' (lines '147'-'147').147
Found 'DD'-anomaly for variable 'value' (lines '151'-'151').151
Avoid empty catch blocks177 - 180

org/limmen/crs/client/transport/Transport.java

ViolationLine
Found 'DU'-anomaly for variable 'aSection' (lines '25'-'25').25
Found 'DU'-anomaly for variable 'anId' (lines '25'-'25').25
Found 'DU'-anomaly for variable 'configurationName' (lines '25'-'25').25
Found 'DU'-anomaly for variable 'serviceLocator' (lines '27'-'27').27