PMD Results

The following document contains the results of PMD 5.0.5.

Files

org/andromda/maven/plugin/andromdapp/AbstractAndroMDAppMojo.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 34
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 51
Found non-transient, non-static member. Please mark as transient or provide accessors. 56
Comment is too large: Line too long 66
Avoid using redundant field initializer for 'skipProcessing' 85
Avoid instantiating new objects inside loops 110

org/andromda/maven/plugin/andromdapp/AndroMDAppCleanMojo.java

Violation Line
Avoid variables with short names like cl 41
Local variable 'cl' could be declared final 41
System.out.print is used 44
Local variable 'ucl' could be declared final 46
Local variable 'urls' could be declared final 47
Local variable 'url' could be declared final 48
System.out.print is used 49
Avoid empty catch blocks 5558
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 55
System.out.print is used 60
Avoid variables with short names like th 62
System.out.print is used 64
A catch statement should never catch throwable since it includes errors. 69
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 71

org/andromda/maven/plugin/andromdapp/AndroMDAppMojo.java

Violation Line
Avoid declaring a variable if it is unreferenced before a possible exit point. 38
Local variable 'andromdapp' could be declared final 38
A catch statement should never catch throwable since it includes errors. 53
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 55

org/andromda/maven/plugin/andromdapp/AppManagementMojo.java

Violation Line
Abstract classes should be named AbstractXXX 1662
Found non-transient, non-static member. Please mark as transient or provide accessors. 25
Found non-transient, non-static member. Please mark as transient or provide accessors. 32

org/andromda/maven/plugin/andromdapp/BeanProperties.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 16
Private field 'bean' could be made final; it is only initialized in the declaration or constructor. 16
It is a good practice to call super() in a constructor 2124
Use block level rather than method level synchronization 2949
Parameter 'key' is not assigned and could be declared final 29
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 44
Avoid empty catch blocks 4447

org/andromda/maven/plugin/andromdapp/BuildMojo.java

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 1588
Found non-transient, non-static member. Please mark as transient or provide accessors. 46
Found non-transient, non-static member. Please mark as transient or provide accessors. 51
Found non-transient, non-static member. Please mark as transient or provide accessors. 56
Found non-transient, non-static member. Please mark as transient or provide accessors. 66
Found non-transient, non-static member. Please mark as transient or provide accessors. 73
Found non-transient, non-static member. Please mark as transient or provide accessors. 80
Private field 'goals' could be made final; it is only initialized in the declaration or constructor. 87
Found non-transient, non-static member. Please mark as transient or provide accessors. 87
Found non-transient, non-static member. Please mark as transient or provide accessors. 99
Found non-transient, non-static member. Please mark as transient or provide accessors. 106
Private field 'executionProperties' could be made final; it is only initialized in the declaration or constructor. 106
Found non-transient, non-static member. Please mark as transient or provide accessors. 133
Avoid really long methods. 138250
Avoid if (x != y) ..; else ..; 144244
The String literal "" appears 5 times in this file; the first occurrence is on line 160 160
Local variable 'index' could be declared final 161
Do not explicitly trigger a garbage collection. 207
String.trim().length()==0 is an inefficient way to validate an empty String. 216
A catch statement should never catch throwable since it includes errors. 228
Avoid printStackTrace(); use a logger call instead. 230
A catch statement should never catch throwable since it includes errors. 246
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 273
Avoid empty catch blocks 273276
System.out.print is used 287
System.out.print is used 312
System.out.print is used 323
System.out.print is used 332
Assigning an Object to null is a code smell. Consider refactoring. 352
Comment is too large: Line too long 381
Parameter 'sortProjects' is not assigned and could be declared final 392
Local variable 'executed' could be declared final 396
Avoid if (x != y) ..; else ..; 401428
A catch statement should never catch throwable since it includes errors. 482
Avoid if (x != y) ..; else ..; 513529
Avoid if (x != y) ..; else ..; 549
Avoid instantiating new objects inside loops 558
Avoid instantiating new objects inside loops 577

org/andromda/maven/plugin/andromdapp/DeployMojo.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 27
Private field 'includes' could be made final; it is only initialized in the declaration or constructor. 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Private field 'excludes' could be made final; it is only initialized in the declaration or constructor. 48
Found non-transient, non-static member. Please mark as transient or provide accessors. 48
A catch statement should never catch throwable since it includes errors. 109
Avoid instantiating new objects inside loops 146148

org/andromda/maven/plugin/andromdapp/EclipseMojo.java

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 1462
Too many fields 46462
Found non-transient, non-static member. Please mark as transient or provide accessors. 52
Found non-transient, non-static member. Please mark as transient or provide accessors. 59
Private field 'includes' could be made final; it is only initialized in the declaration or constructor. 68
Found non-transient, non-static member. Please mark as transient or provide accessors. 68
Found non-transient, non-static member. Please mark as transient or provide accessors. 75
Private field 'excludes' could be made final; it is only initialized in the declaration or constructor. 82
Found non-transient, non-static member. Please mark as transient or provide accessors. 82
Found non-transient, non-static member. Please mark as transient or provide accessors. 89
Found non-transient, non-static member. Please mark as transient or provide accessors. 96
Private field 'repositoryVariableName' could be made final; it is only initialized in the declaration or constructor. 96
Found non-transient, non-static member. Please mark as transient or provide accessors. 105
Found non-transient, non-static member. Please mark as transient or provide accessors. 114
Found non-transient, non-static member. Please mark as transient or provide accessors. 121
Found non-transient, non-static member. Please mark as transient or provide accessors. 126
Found non-transient, non-static member. Please mark as transient or provide accessors. 131
Private field 'classpathArtifactTypes' could be made final; it is only initialized in the declaration or constructor. 138
Found non-transient, non-static member. Please mark as transient or provide accessors. 138
Found non-transient, non-static member. Please mark as transient or provide accessors. 146
Private field 'resolveTransitiveDependencies' could be made final; it is only initialized in the declaration or constructor. 146
Found non-transient, non-static member. Please mark as transient or provide accessors. 153
Private field 'skipProcessing' could be made final; it is only initialized in the declaration or constructor. 161
Found non-transient, non-static member. Please mark as transient or provide accessors. 161
Avoid using redundant field initializer for 'skipProcessing' 161
A catch statement should never catch throwable since it includes errors. 199
A method/constructor shouldnt explicitly throw java.lang.Exception 212
Avoid instantiating new objects inside loops 217
Private field 'projects' could be made final; it is only initialized in the declaration or constructor. 222
Found non-transient, non-static member. Please mark as transient or provide accessors. 222
A method/constructor shouldnt explicitly throw java.lang.Exception 232
Local variable 'pom' could be declared final 237
Avoid if (x != y) ..; else ..; 243254
A method/constructor shouldnt explicitly throw java.lang.Exception 273
Avoid instantiating new objects inside loops 277
Deeply nested if..then statements are hard to read 322348
Avoid if (x != y) ..; else ..; 368381
Found non-transient, non-static member. Please mark as transient or provide accessors. 389
Avoid if (x != y) ..; else ..; 405421
Avoid instantiating new objects inside loops 409
A method/constructor shouldnt explicitly throw java.lang.Exception 433
Local variable 'poms' could be declared final 447
Avoid instantiating new objects inside loops 451453

org/andromda/maven/plugin/andromdapp/JdbcDriverWrapper.java

Violation Line
Private field 'driver' could be made final; it is only initialized in the declaration or constructor. 21
Found non-transient, non-static member. Please mark as transient or provide accessors. 21
Parameter 'driver' is not assigned and could be declared final 26
Parameter 'url' is not assigned and could be declared final 34
Parameter 'url' is not assigned and could be declared final 44
Parameter 'properties' is not assigned and could be declared final 45
Parameter 'url' is not assigned and could be declared final 73
Parameter 'properties' is not assigned and could be declared final 74
Local variable 'method' could be declared final 104
Avoid empty catch blocks 107111
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 107

org/andromda/maven/plugin/andromdapp/Location.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 18
Private field 'includes' could be made final; it is only initialized in the declaration or constructor. 33
Found non-transient, non-static member. Please mark as transient or provide accessors. 33
Private field 'excludes' could be made final; it is only initialized in the declaration or constructor. 38
Found non-transient, non-static member. Please mark as transient or provide accessors. 38

org/andromda/maven/plugin/andromdapp/SchemaManagement.java

Violation Line
Avoid modifiers which are implied by the context 22
A method/constructor shouldnt explicitly throw java.lang.Exception 22

org/andromda/maven/plugin/andromdapp/SchemaManagementException.java

Violation Line
Parameter 'message' is not assigned and could be declared final 18
Parameter 'message' is not assigned and could be declared final 30
Parameter 'parent' is not assigned and could be declared final 31
Parameter 'message' is not assigned and could be declared final 41

org/andromda/maven/plugin/andromdapp/SchemaMojo.java

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 1591
Too many fields 53591
Found non-transient, non-static member. Please mark as transient or provide accessors. 61
Found non-transient, non-static member. Please mark as transient or provide accessors. 69
Found non-transient, non-static member. Please mark as transient or provide accessors. 76
Found non-transient, non-static member. Please mark as transient or provide accessors. 83
Private field 'properties' could be made final; it is only initialized in the declaration or constructor. 90
Found non-transient, non-static member. Please mark as transient or provide accessors. 90
Found non-transient, non-static member. Please mark as transient or provide accessors. 97
Found non-transient, non-static member. Please mark as transient or provide accessors. 105
Private field 'executeScripts' could be made final; it is only initialized in the declaration or constructor. 105
Field executeScripts has the same name as a method 105
Found non-transient, non-static member. Please mark as transient or provide accessors. 111
Found non-transient, non-static member. Please mark as transient or provide accessors. 121
Found non-transient, non-static member. Please mark as transient or provide accessors. 128
Found non-transient, non-static member. Please mark as transient or provide accessors. 136
Found non-transient, non-static member. Please mark as transient or provide accessors. 144
Found non-transient, non-static member. Please mark as transient or provide accessors. 152
Private field 'jdbcPassword' could be made final; it is only initialized in the declaration or constructor. 159
Found non-transient, non-static member. Please mark as transient or provide accessors. 159
Found non-transient, non-static member. Please mark as transient or provide accessors. 167
Found non-transient, non-static member. Please mark as transient or provide accessors. 174
The method execute() has an NPath complexity of 328 179276
Deeply nested if..then statements are hard to read 208213
Deeply nested if..then statements are hard to read 226231
Avoid instantiating new objects inside loops 235
Assigning an Object to null is a code smell. Consider refactoring. 246
A catch statement should never catch throwable since it includes errors. 258
Avoid empty catch blocks 270273
Avoid if (x != y) ..; else ..; 285
Avoid if (x != y) ..; else ..; 300319
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 310
Avoid instantiating new objects inside loops 352
Avoid if (x != y) ..; else ..; 436
A method/constructor shouldnt explicitly throw java.lang.Exception 449
Local variable 'driver' could be declared final 451
A method/constructor shouldnt explicitly throw java.lang.Exception 475
Ensure that resources like this Statement object are closed after use 484
Deeply nested if..then statements are hard to read 505512
Avoid instantiating new objects inside loops 513
Found non-transient, non-static member. Please mark as transient or provide accessors. 534
Found non-transient, non-static member. Please mark as transient or provide accessors. 539
Avoid using implementation types like 'HashMap'; use the interface instead 569
Variables that are final and static should be all capitals, 'tasksCache' is not all capitals. 569

org/andromda/maven/plugin/andromdapp/ScriptClassGeneratorMojo.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 49
Found non-transient, non-static member. Please mark as transient or provide accessors. 56
Found non-transient, non-static member. Please mark as transient or provide accessors. 63
Found non-transient, non-static member. Please mark as transient or provide accessors. 70
Local variable 'rootPath' could be declared final 94
A catch statement should never catch throwable since it includes errors. 114
These nested if statements could be combined 158171
Local variable 'fileName' could be declared final 188
Avoid instantiating new objects inside loops 190

org/andromda/maven/plugin/andromdapp/SymbolicLinkExplodedEarMojo.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 48
Found non-transient, non-static member. Please mark as transient or provide accessors. 57
Found non-transient, non-static member. Please mark as transient or provide accessors. 67
Avoid using redundant field initializer for 'isWindows' 82
Avoid really long methods. 98239
The method execute() has an NPath complexity of 2597 98239
Avoid instantiating new objects inside loops 153154
Avoid instantiating new objects inside loops 163
Avoid instantiating new objects inside loops 165167
Avoid if (x != y) ..; else ..; 169178
The String literal " to " appears 4 times in this file; the first occurrence is on line 190 190
Avoid if (x != y) ..; else ..; 204211
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 235
Found non-transient, non-static member. Please mark as transient or provide accessors. 244
Avoid instantiating new objects inside loops 286288
A method/constructor shouldnt explicitly throw java.lang.Exception 304
Local variable 'freader' could be declared final 311
Avoid instantiating new objects inside loops 311
Avoid instantiating new objects inside loops 334
Avoid instantiating new objects inside loops 335
Avoid empty catch blocks 346349
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 346

org/andromda/maven/plugin/andromdapp/UndeployMojo.java

Violation Line
A catch statement should never catch throwable since it includes errors. 38

org/andromda/maven/plugin/andromdapp/eclipse/ClasspathWriter.java

Violation Line
The class 'ClasspathWriter' has a Cyclomatic Complexity of 7 (Highest = 22). 31328
The method 'write' has a Cyclomatic Complexity of 22. 61267
The method write() has an NPath complexity of 11520 61267
Avoid really long methods. 61267
Avoid long parameter lists. 6172
A method/constructor shouldnt explicitly throw java.lang.Exception 73
Avoid if (x != y) ..; else ..; 116128
These nested if statements could be combined 196204
This call to String.startsWith can be rewritten using String.charAt(0) 248
Avoid reassigning parameters such as 'rootDirectory' 280
Avoid instantiating new objects inside loops 287
This call to String.startsWith can be rewritten using String.charAt(0) 293

org/andromda/maven/plugin/andromdapp/eclipse/EclipseWriter.java

Violation Line
Abstract classes should be named AbstractXXX 1546
This abstract class does not have any abstract methods 1546
Found non-transient, non-static member. Please mark as transient or provide accessors. 18
Found non-transient, non-static member. Please mark as transient or provide accessors. 21
Consider simply returning the value vs storing it in local variable 'file' 43

org/andromda/maven/plugin/andromdapp/eclipse/OrArtifactFilter.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 17

org/andromda/maven/plugin/andromdapp/eclipse/ProjectWriter.java

Violation Line
A method/constructor shouldnt explicitly throw java.lang.Exception 35

org/andromda/maven/plugin/andromdapp/eclipse/Variable.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 12
Found non-transient, non-static member. Please mark as transient or provide accessors. 14

org/andromda/maven/plugin/andromdapp/hibernate/HibernateCreateSchema.java

Violation Line
Comment is too large: Line too long 20
Local variable 'outputPath' could be declared final 2628

org/andromda/maven/plugin/andromdapp/hibernate/HibernateSchemaManagement.java

Violation Line
Abstract classes should be named AbstractXXX 23271
The Logger variable declaration does not contain the static and final modifiers 29
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 71
Avoid empty catch blocks 7174
Avoid empty catch blocks 8083
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 80
Avoid throwing raw exception types. 86
Consider simply returning the value vs storing it in local variable 'value' 131
Parameter 'connection' is not assigned and could be declared final 175
Unnecessary use of fully qualified name 'java.util.Map' due to existing import 'java.util.Map' 176
Parameter 'options' is not assigned and could be declared final 176
A method/constructor shouldnt explicitly throw java.lang.Exception 177
A method/constructor shouldnt explicitly throw java.lang.Exception 214
A method/constructor shouldnt explicitly throw java.lang.Exception 242
Local variable 'path' could be declared final 263
Avoid instantiating new objects inside loops 265267

org/andromda/maven/plugin/andromdapp/hibernate/HibernateUpdateSchema.java

Violation Line
Avoid excessively long variable names like HIBERNATE_PROPERTIES_TEMP_DIRECTORY 26
Variables that are final and static should be all capitals, 'random' is not all capitals. 29
Comment is too large: Line too long 31
A method/constructor shouldnt explicitly throw java.lang.Exception 36
StringBuffer constructor is initialized with size 16, but has at least 97 characters appended. 50
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 51
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 52
Avoid using redundant field initializer for 'jdbcDriverJarLoader' 70
Found non-transient, non-static member. Please mark as transient or provide accessors. 70

org/andromda/maven/plugin/andromdapp/hibernate/HibernateValidateSchema.java

Violation Line
Avoid excessively long variable names like HIBERNATE_PROPERTIES_TEMP_DIRECTORY 19
Variables that are final and static should be all capitals, 'random' is not all capitals. 38
Comment is too large: Line too long 40
A method/constructor shouldnt explicitly throw java.lang.Exception 42
StringBuffer constructor is initialized with size 16, but has at least 127 characters appended. 56
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 57
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 58
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 59

org/andromda/maven/plugin/andromdapp/script/ScriptClassGenerator.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 32
Unnecessary final modifier in final class 4149
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 86
A catch statement should never catch throwable since it includes errors. 140
Avoid printStackTrace(); use a logger call instead. 142
Local variable 'argumentTypes' could be declared final 170
Parameter 'ctClass' is not assigned and could be declared final 190
Local variable 'name' could be declared final 193

org/andromda/maven/plugin/andromdapp/script/ScriptClassGeneratorException.java

Violation Line
Parameter 'message' is not assigned and could be declared final 20
Parameter 'parent' is not assigned and could be declared final 21
Parameter 'message' is not assigned and could be declared final 31
Parameter 'parent' is not assigned and could be declared final 41

org/andromda/maven/plugin/andromdapp/utils/ProjectUtils.java

Violation Line
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning. 1996
Variables that are final and static should be all capitals, 'projectCache' is not all capitals. 23
Use block level rather than method level synchronization 3466
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 56
Deeply nested if..then statements are hard to read 5861
Avoid instantiating new objects inside loops 8688

org/andromda/maven/plugin/andromdapp/utils/Projects.java

Violation Line
It is somewhat confusing to have a field name matching the declaring class name 13
Private field 'projects' could be made final; it is only initialized in the declaration or constructor. 13
Found non-transient, non-static member. Please mark as transient or provide accessors. 13
Field instance has the same name as a method 18
Singleton is not thread safe 2730
Use block level rather than method level synchronization 5053
Assigning an Object to null is a code smell. Consider refactoring. 61

org/andromda/maven/plugin/andromdapp/HelpMojo.java

Violation Line
Comment is too large: Line too long 11
The class 'HelpMojo' has a Cyclomatic Complexity of 11 (Highest = 46). 19599
Found non-transient, non-static member. Please mark as transient or provide accessors. 27
Found non-transient, non-static member. Please mark as transient or provide accessors. 34
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 48
The method 'execute' has a Cyclomatic Complexity of 46. 52464
Avoid really long methods. 52464
The method execute() has an NCSS line count of 293 52464
The method execute() has an NPath complexity of 234375000 52464
Avoid variables with short names like sb 66
Local variable 'sb' could be declared final 66
The String literal "Available parameters:" appears 10 times in this file; the first occurrence is on line 88 88
The String literal "(no description available)" appears 7 times in this file; the first occurrence is on line 92 92
The String literal "Required: Yes" appears 10 times in this file; the first occurrence is on line 185 185
Parameter 'repeat' is not assigned and could be declared final 475
Parameter 'str' is not assigned and could be declared final 475
Local variable 'buffer' could be declared final 477
Parameter 'indent' is not assigned and could be declared final 495
Avoid variables with short names like sb 495
Parameter 'sb' is not assigned and could be declared final 495
Parameter 'description' is not assigned and could be declared final 495
Local variable 'it' could be declared final 497
Parameter 'text' is not assigned and could be declared final 513
Parameter 'indentSize' is not assigned and could be declared final 513
Parameter 'indent' is not assigned and could be declared final 513
Parameter 'lineLength' is not assigned and could be declared final 513
Local variable 'lines' could be declared final 515
Local variable 'ind' could be declared final 517
Local variable 'plainLines' could be declared final 518
Parameter 'lineLength' is not assigned and could be declared final 535
Parameter 'line' is not assigned and could be declared final 535
Parameter 'indentSize' is not assigned and could be declared final 535
Parameter 'lines' is not assigned and could be declared final 535
Local variable 'lineIndent' could be declared final 537
Local variable 'buf' could be declared final 538
Local variable 'tokens' could be declared final 539
Local variable 'token' could be declared final 542
Local variable 'c' could be declared final 558
Avoid variables with short names like c 558
Parameter 'line' is not assigned and could be declared final 582