PMD Results

The following document contains the results of PMD 4.3.

Files

org/jboss/netty/example/http/upload/HttpClient.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.55 - 997

org/jboss/netty/example/http/upload/HttpRequestHandler.java

ViolationLine
Avoid if (x != y) ..; else ..;114 - 231
Avoid empty catch blocks125 - 126

org/jboss/netty/example/http/upload/HttpResponseHandler.java

ViolationLine
Avoid if (x != y) ..; else ..;41 - 77

org/jboss/netty/example/http/upload/HttpServer.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.32 - 46

org/jboss/netty/handler/codec/http2/AbstractDiskHttpData.java

ViolationLine
Avoid if (x != y) ..; else ..;86 - 90
These nested if statements could be combined219 - 221
An empty method in an abstract class should be abstract instead286 - 288

org/jboss/netty/handler/codec/http2/AbstractHttpData.java

ViolationLine
Avoid reassigning parameters such as 'name'41
Switch statements should have a default label59 - 72
A switch statement does not contain a break59 - 72
Overridable method 'setCharset' called during object construction76

org/jboss/netty/handler/codec/http2/AbstractMemoryHttpData.java

ViolationLine
An empty method in an abstract class should be abstract instead136 - 138
An empty method in an abstract class should be abstract instead191 - 193

org/jboss/netty/handler/codec/http2/CookieDecoder.java

ViolationLine
Avoid empty catch blocks94 - 96
Avoid if (x != y) ..; else ..;159
Avoid empty catch blocks161 - 163
Avoid empty catch blocks173 - 175

org/jboss/netty/handler/codec/http2/CookieEncoder.java

ViolationLine
These nested if statements could be combined198 - 209
Switch statements should have a default label228 - 235
A switch statement does not contain a break228 - 235
Avoid reassigning parameters such as 'val'248

org/jboss/netty/handler/codec/http2/DefaultCookie.java

ViolationLine
Avoid reassigning parameters such as 'name'67
Switch statements should have a default label84 - 90
A switch statement does not contain a break84 - 90
Overridable method 'setValue' called during object construction98
Avoid reassigning parameters such as 'value'332
Switch statements should have a default label342 - 347
A switch statement does not contain a break342 - 347

org/jboss/netty/handler/codec/http2/DefaultHttpChunk.java

ViolationLine
Overridable method 'setContent' called during object construction37

org/jboss/netty/handler/codec/http2/DefaultHttpDataFactory.java

ViolationLine
Private field 'useDisk' could be made final; it is only initialized in the declaration or constructor.44
Private field 'checkSize' could be made final; it is only initialized in the declaration or constructor.46

org/jboss/netty/handler/codec/http2/DefaultHttpMessage.java

ViolationLine
Overridable method 'setProtocolVersion' called during object construction45
Avoid reassigning parameters such as 'content'98

org/jboss/netty/handler/codec/http2/DefaultHttpRequest.java

ViolationLine
Overridable method 'setMethod' called during object construction42
Overridable method 'setUri' called during object construction43

org/jboss/netty/handler/codec/http2/DefaultHttpResponse.java

ViolationLine
Overridable method 'setStatus' called during object construction40

org/jboss/netty/handler/codec/http2/DiskAttribute.java

ViolationLine
Overridable method 'setValue' called during object construction58

org/jboss/netty/handler/codec/http2/DiskFileUpload.java

ViolationLine
Overridable method 'setFilename' called during object construction49
Overridable method 'setContentType' called during object construction50
Overridable method 'setContentTransferEncoding' called during object construction51
Avoid if (x != y) ..; else ..;132

org/jboss/netty/handler/codec/http2/HttpClientCodec.java

ViolationLine
Document empty constructor107 - 108
Switch statements should have a default label186 - 220
A switch with less than 3 branches is inefficient, use a if statement instead.186 - 220
These nested if statements could be combined212 - 217

org/jboss/netty/handler/codec/http2/HttpCodecUtil.java

ViolationLine
A class which only has private constructors should be final28 - 176
Switch statements should have a default label90 - 96
A switch statement does not contain a break90 - 96
Switch statements should have a default label114 - 121
A switch with less than 3 branches is inefficient, use a if statement instead.114 - 121
Switch statements should have a default label124 - 154
Switch statements should have a default label126 - 133
A switch with less than 3 branches is inefficient, use a if statement instead.126 - 133
A switch with less than 3 branches is inefficient, use a if statement instead.136 - 143

org/jboss/netty/handler/codec/http2/HttpContentDecoder.java

ViolationLine
Avoid if (x != y) ..; else ..;73 - 77
Avoid if (x != y) ..; else ..;110 - 132
Avoid if (x != y) ..; else ..;111 - 129

org/jboss/netty/handler/codec/http2/HttpContentEncoder.java

ViolationLine
Avoid if (x != y) ..; else ..;100 - 137
Deeply nested if..then statements are hard to read127 - 131
Avoid if (x != y) ..; else ..;143 - 165
Avoid if (x != y) ..; else ..;144 - 162

org/jboss/netty/handler/codec/http2/HttpHeaders.java

ViolationLine
Avoid if (x != y) ..; else ..;855 - 861
Use equals() to compare object references.961
Use equals() to compare object references.977

org/jboss/netty/handler/codec/http2/HttpMessageDecoder.java

ViolationLine
Switch statements should have a default label396 - 399
A switch statement does not contain a break396 - 399
Avoid if (x != y) ..; else ..;500 - 506
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()500
Avoid empty if statements504 - 506
Switch statements should have a default label536 - 546
A switch with less than 3 branches is inefficient, use a if statement instead.536 - 546
Avoid reassigning parameters such as 'hex'570
Avoid reassigning parameters such as 'hex'570

org/jboss/netty/handler/codec/http2/HttpMessageEncoder.java

ViolationLine
Avoid if (x != y) ..; else ..;90 - 98

org/jboss/netty/handler/codec/http2/HttpMethod.java

ViolationLine
Avoid reassigning parameters such as 'name'105
Avoid if (x != y) ..; else ..;116 - 120
Avoid reassigning parameters such as 'name'132

org/jboss/netty/handler/codec/http2/HttpPostRequestDecoder.java

ViolationLine
Overridable method 'parseBodyMultipart' called during object construction187
These nested if statements could be combined368 - 370
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()372
A high ratio of statements to labels in a switch statement. Consider refactoring.447 - 513
Avoid empty if statements537 - 539
A high ratio of statements to labels in a switch statement. Consider refactoring.578 - 653
Avoid empty if statements677 - 679
A switch statement does not contain a break759 - 850
Avoid if (x != y) ..; else ..;1067 - 1077
Avoid if (x != y) ..; else ..;1079 - 1087
Avoid if (x != y) ..; else ..;1152 - 1153
Avoid empty if statements1741 - 1743
Document empty constructor1859 - 1860
Document empty constructor1905 - 1906
Document empty constructor1941 - 1942

org/jboss/netty/handler/codec/http2/HttpPostRequestEncoder.java

ViolationLine
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()411
Substitute calls to size() == 0 (or size() != 0) with calls to isEmpty()436
Avoid if (x != y) ..; else ..;550 - 555
Avoid if (x != y) ..; else ..;580 - 596
When doing a String.toLowerCase()/toUpperCase() call, use a Locale604 - 605
Avoid empty if statements605 - 607
When doing a String.toLowerCase()/toUpperCase() call, use a Locale607 - 608
Avoid empty if statements608 - 610
Avoid empty if statements639 - 641
Avoid if (x != y) ..; else ..;841 - 846
Avoid if (x != y) ..; else ..;848 - 854

org/jboss/netty/handler/codec/http2/HttpResponseStatus.java

ViolationLine
Switch statements should have a default label289 - 390
Switch statements should have a default label434 - 439
A switch statement does not contain a break434 - 439
A switch with less than 3 branches is inefficient, use a if statement instead.434 - 439

org/jboss/netty/handler/codec/http2/HttpVersion.java

ViolationLine
Avoid reassigning parameters such as 'text'56
Position literals first in String comparisons62
Position literals first in String comparisons65
Avoid reassigning parameters such as 'text'96
Avoid reassigning parameters such as 'protocolName'139

org/jboss/netty/handler/codec/http2/InternalAttribute.java

ViolationLine
Document empty constructor40 - 41

org/jboss/netty/handler/codec/http2/MemoryAttribute.java

ViolationLine
Overridable method 'setValue' called during object construction47

org/jboss/netty/handler/codec/http2/MemoryFileUpload.java

ViolationLine
Overridable method 'setFilename' called during object construction43
Overridable method 'setContentType' called during object construction44
Overridable method 'setContentTransferEncoding' called during object construction45
Avoid if (x != y) ..; else ..;120

org/jboss/netty/handler/codec/http2/MixedAttribute.java

ViolationLine
Private field 'limitSize' could be made final; it is only initialized in the declaration or constructor.36
New exception is thrown in catch block, original stack trace may be lost57
These nested if statements could be combined73 - 81
These nested if statements could be combined144 - 149
These nested if statements could be combined157 - 162

org/jboss/netty/handler/codec/http2/MixedFileUpload.java

ViolationLine
Private field 'limitSize' could be made final; it is only initialized in the declaration or constructor.36
Private field 'definedSize' could be made final; it is only initialized in the declaration or constructor.38
These nested if statements could be combined59 - 70
These nested if statements could be combined148 - 156
These nested if statements could be combined164 - 172

org/jboss/netty/handler/codec/http2/QueryStringDecoder.java

ViolationLine
Avoid if (x != y) ..; else ..;158 - 163
Avoid if (x != y) ..; else ..;254 - 268
These nested if statements could be combined265 - 267
Switch statements should have a default label333 - 340
A switch with less than 3 branches is inefficient, use a if statement instead.333 - 340
New exception is thrown in catch block, original stack trace may be lost384

org/jboss/netty/handler/codec/http2/QueryStringEncoder.java

ViolationLine
New exception is thrown in catch block, original stack trace may be lost135

org/jboss/netty/handler/ipfilter/CIDR4.java

ViolationLine
Private field 'addressInt' could be made final; it is only initialized in the declaration or constructor.30
Avoid empty catch blocks48 - 50

org/jboss/netty/handler/ipfilter/CIDR6.java

ViolationLine
Private field 'addressBigInt' could be made final; it is only initialized in the declaration or constructor.38
Avoid empty catch blocks56 - 58
Deeply nested if..then statements are hard to read80 - 82

org/jboss/netty/handler/ipfilter/IpFilteringHandler.java

ViolationLine
Switch statements should have a default label94 - 135
Avoid if (x != y) ..; else ..;107 - 133
Avoid if (x != y) ..; else ..;115 - 119

org/jboss/netty/handler/ipfilter/IpFilterRuleHandler.java

ViolationLine
Document empty constructor82 - 83

org/jboss/netty/handler/ipfilter/IpSubnet.java

ViolationLine
Private field 'cidr' could be made final; it is only initialized in the declaration or constructor.61
Avoid empty catch blocks177 - 178

org/jboss/netty/handler/ipfilter/IpSubnetFilterRule.java

ViolationLine
Private field 'isAllowRule' could be made final; it is only initialized in the declaration or constructor.33

org/jboss/netty/handler/ipfilter/IpV4Subnet.java

ViolationLine
Avoid empty catch blocks286 - 287

org/jboss/netty/handler/ipfilter/IpV4SubnetFilterRule.java

ViolationLine
Private field 'isAllowRule' could be made final; it is only initialized in the declaration or constructor.30

org/jboss/netty/handler/ipfilter/OneIpFilterHandler.java

ViolationLine
These nested if statements could be combined91 - 99
Deeply nested if..then statements are hard to read91 - 99
These nested if statements could be combined93 - 98

org/jboss/netty/handler/traffic/AbstractTrafficShapingHandler.java

ViolationLine
An empty method in an abstract class should be abstract instead328 - 330
Deeply nested if..then statements are hard to read395 - 403
Deeply nested if..then statements are hard to read415 - 417
Avoid if (x != y) ..; else ..;512

org/jboss/netty/handler/traffic/ChannelTrafficShapingHandler.java

ViolationLine
These nested if statements could be combined165 - 168

org/jboss/netty/handler/traffic/GlobalTrafficShapingHandler.java

ViolationLine
Overridable method 'createGlobalTrafficCounter' called during object construction88
Overridable method 'createGlobalTrafficCounter' called during object construction99
Overridable method 'createGlobalTrafficCounter' called during object construction108
Overridable method 'createGlobalTrafficCounter' called during object construction116
Overridable method 'createGlobalTrafficCounter' called during object construction131
Overridable method 'createGlobalTrafficCounter' called during object construction143
Overridable method 'createGlobalTrafficCounter' called during object construction154
Overridable method 'createGlobalTrafficCounter' called during object construction164

org/jboss/netty/handler/traffic/TrafficCounter.java

ViolationLine
Avoid reassigning parameters such as 'timeout'153
Overridable method 'configure' called during object construction244