Fork me on GitHub

PMD Results

The following document contains the results of PMD 5.3.5.

Files

fr/paris/lutece/plugins/chat/business/ChatRoom.java

Violation Line
Private field '_strName' could be made final; it is only initialized in the declaration or constructor. 51
Consider replacing this Hashtable with the newer java.util.Map 58
Avoid using implementation types like 'Hashtable'; use the interface instead 58
Avoid using implementation types like 'Hashtable'; use the interface instead 58
Private field '_htUsers' could be made final; it is only initialized in the declaration or constructor. 58
Avoid using implementation types like 'Hashtable'; use the interface instead 59
Private field '_htBannedUsers' could be made final; it is only initialized in the declaration or constructor. 59
Avoid using implementation types like 'Hashtable'; use the interface instead 59
Consider replacing this Hashtable with the newer java.util.Map 59
Consider replacing this Vector with the newer java.util.List 60
Use ArrayList instead of Vector 60
Avoid using implementation types like 'Vector'; use the interface instead 60
Avoid using implementation types like 'Vector'; use the interface instead 60
Private field '_vRoomEntries' could be made final; it is only initialized in the declaration or constructor. 60
Use block level rather than method level synchronization 8083
Use block level rather than method level synchronization 92114
Avoid variables with short names like e 101
Avoid variables with short names like u 105
Use block level rather than method level synchronization 123138
Consider replacing this Vector with the newer java.util.List 234
Avoid using implementation types like 'Vector'; use the interface instead 234
Avoid using implementation types like 'Vector'; use the interface instead 234

fr/paris/lutece/plugins/chat/business/ChatUser.java

Violation Line
Consider replacing this Vector with the newer java.util.List 56
Use ArrayList instead of Vector 56
Avoid using implementation types like 'Vector'; use the interface instead 56
Private field '_vChatEntries' could be made final; it is only initialized in the declaration or constructor. 56
Avoid using implementation types like 'Vector'; use the interface instead 56
Private field '_nMaxMessages' could be made final; it is only initialized in the declaration or constructor. 57
Private field '_dateJoin' could be made final; it is only initialized in the declaration or constructor. 59
Avoid using implementation types like 'ArrayList'; use the interface instead 69
Private field '_listSentData' could be made final; it is only initialized in the declaration or constructor. 69
Avoid using implementation types like 'ArrayList'; use the interface instead 69
Use block level rather than method level synchronization 179187
Assigning an Object to null is a code smell. Consider refactoring. 227
Avoid variables with short names like sd 319
Avoid variables with short names like i 332
Avoid variables with short names like sd 337
Use explicit scoping instead of the default package private level 353
Use explicit scoping instead of the default package private level 354

fr/paris/lutece/plugins/chat/business/RoomList.java

Violation Line
Consider replacing this Hashtable with the newer java.util.Map 45
Avoid using implementation types like 'Hashtable'; use the interface instead 45
Private field '_chatRooms' could be made final; it is only initialized in the declaration or constructor. 45
Avoid using implementation types like 'Hashtable'; use the interface instead 45
Consider using varargs for methods or constructors which take an array the last parameter. 83

fr/paris/lutece/plugins/chat/service/ChatConstantes.java

Violation Line
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 49
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 50
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 51
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 52
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 53
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 54
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 55
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 56
Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes. 57

fr/paris/lutece/plugins/chat/service/ChatPlugin.java

Violation Line
Document empty constructor 4749
Avoid unnecessary constructors - the compiler will generate these for you 4749
It is a good practice to call super() in a constructor 4749

fr/paris/lutece/plugins/chat/service/ChatService.java

Violation Line
Possible God class (WMC=97, ATFD=156, TCC=0.019704433497536946) 341005
The class 'ChatService' has a Modified Cyclomatic Complexity of 3 (Highest = 15). 65882
The class 'ChatService' has a Standard Cyclomatic Complexity of 3 (Highest = 15). 65882
The class 'ChatService' has a Cyclomatic Complexity of 3 (Highest = 15). 65882
Private field '_timer' could be made final; it is only initialized in the declaration or constructor. 132
Use block level rather than method level synchronization 154208
Avoid variables with short names like i 272
The String literal "chat.room" appears 7 times in this file; the first occurrence is on line 276 276
Avoid variables with short names like e 319
Avoid variables with short names like e 341
Avoid variables with short names like u 352
Avoid variables with short names like me 371
Use equals() to compare object references. 373
Avoid variables with short names like e 384
The method 'parseCommand' has a Modified Cyclomatic Complexity of 15. 472554
The method 'parseCommand' has a Standard Cyclomatic Complexity of 15. 472554
The method 'parseCommand' has a Cyclomatic Complexity of 15. 472554
When doing a String.toLowerCase()/toUpperCase() call, use a Locale 566
A switch statement does not contain a break 569606
Position literals first in String comparisons 617
Position literals first in String comparisons 622
Position literals first in String comparisons 627
Position literals first in String comparisons 627
Position literals first in String comparisons 632
Position literals first in String comparisons 637
Avoid variables with short names like e 782
StringBuffer constructor is initialized with size 16, but has at least 18 characters appended. 783
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 784
Avoid appending characters as strings in StringBuffer.append. 797
Rather than using a lot of String arguments, consider using a container object for those values. 835
Position literals first in String comparisons 840
Prefer StringBuffer over += for concatenating strings 842
Position literals first in String comparisons 875
Prefer StringBuffer over += for concatenating strings 877
This call to String.startsWith can be rewritten using String.charAt(0) 917
String.indexOf(char) is faster than String.indexOf(String). 924
String.indexOf(char) is faster than String.indexOf(String). 930
When doing a String.toLowerCase()/toUpperCase() call, use a Locale 944
Use explicit scoping instead of the default package private level 951954
Use explicit scoping instead of the default package private level 961964
Use explicit scoping instead of the default package private level 971974
Use explicit scoping instead of the default package private level 981984
Use explicit scoping instead of the default package private level 991994
Use explicit scoping instead of the default package private level 10011004

fr/paris/lutece/plugins/chat/web/ChatApp.java

Violation Line
Avoid unused imports such as 'fr.paris.lutece.portal.service.security.UserNotSignedException' 42
Avoid unused imports such as 'fr.paris.lutece.portal.service.security.UserNotSignedException' 42
Avoid unnecessary constructors - the compiler will generate these for you 8082
Document empty constructor 8082
Avoid variables with short names like t 179

fr/paris/lutece/plugins/chat/web/ChatJspBean.java

Violation Line
The class 'ChatJspBean' has a Cyclomatic Complexity of 6 (Highest = 14). 52257
The class 'ChatJspBean' has a Standard Cyclomatic Complexity of 6 (Highest = 14). 52257
The class 'ChatJspBean' has a Modified Cyclomatic Complexity of 5 (Highest = 13). 52257
Avoid unused private fields such as 'CONTENT_TYPE'. 61
System.out.println is used 73
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 141
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 142
The method 'getUserData' has a Modified Cyclomatic Complexity of 13. 153256
The method getUserData() has an NPath complexity of 1064 153256
The method 'getUserData' has a Cyclomatic Complexity of 14. 153256
The method 'getUserData' has a Standard Cyclomatic Complexity of 14. 153256
Avoid really long methods. 153256
Avoid declaring a variable if it is unreferenced before a possible exit point. 155
Avoid variables with short names like u 217
Avoid appending characters as strings in StringBuffer.append. 222
Avoid appending characters as strings in StringBuffer.append. 226
Avoid appending characters as strings in StringBuffer.append. 233

fr/paris/lutece/plugins/chat/web/ChatServlet.java

Violation Line
The class 'ChatServlet' has a Standard Cyclomatic Complexity of 4 (Highest = 14). 60298
The class 'ChatServlet' has a Cyclomatic Complexity of 4 (Highest = 14). 60298
The class 'ChatServlet' has a Modified Cyclomatic Complexity of 3 (Highest = 13). 60298
Overriding method merely calls super 8386
Document empty method 160161
Use explicit scoping instead of the default package private level 168171
Use explicit scoping instead of the default package private level 179187
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 182
StringBuffer (or StringBuilder).append is called consecutively without reusing the target variable. 183
The method 'getUserData' has a Standard Cyclomatic Complexity of 14. 194297
The method 'getUserData' has a Modified Cyclomatic Complexity of 13. 194297
Use explicit scoping instead of the default package private level 194297
Avoid really long methods. 194297
The method 'getUserData' has a Cyclomatic Complexity of 14. 194297
The method getUserData() has an NPath complexity of 1064 194297
Avoid declaring a variable if it is unreferenced before a possible exit point. 196
Avoid variables with short names like u 258
Avoid appending characters as strings in StringBuffer.append. 263
Avoid appending characters as strings in StringBuffer.append. 267
Avoid appending characters as strings in StringBuffer.append. 274