PMD Results

The following document contains the results of PMD 5.0.2.

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
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
Local variable 'cl' could be declared final 41
Avoid variables with short names like cl 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 catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 55
Avoid empty catch blocks 55 - 58
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
Local variable 'andromdapp' could be declared final 38
Avoid declaring a variable if it is unreferenced before a possible exit point. 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 16 - 62
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
Private field 'bean' could be made final; it is only initialized in the declaration or constructor. 16
Found non-transient, non-static member. Please mark as transient or provide accessors. 16
It is a good practice to call super() in a constructor 21 - 24
Parameter 'key' is not assigned and could be declared final 29
Use block level rather than method level synchronization 29 - 49
Avoid empty catch blocks 44 - 47
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 44

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

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 1 - 588
Avoid unused imports such as 'org.apache.maven.BuildFailureException' 22
Avoid unused imports such as 'org.apache.maven.BuildFailureException' 22
Avoid unused imports such as 'org.apache.maven.lifecycle.LifecycleExecutionException' 25
Avoid unused imports such as 'org.apache.maven.lifecycle.LifecycleExecutionException' 25
Avoid unused imports such as 'org.codehaus.plexus.util.dag.CycleDetectedException' 32
Avoid unused imports such as 'org.codehaus.plexus.util.dag.CycleDetectedException' 32
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
Found non-transient, non-static member. Please mark as transient or provide accessors. 87
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. 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. 138 - 250
Avoid if (x != y) ..; else ..; 144 - 244
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 empty catch blocks 273 - 276
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 273
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
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 ..; 401 - 428
A catch statement should never catch throwable since it includes errors. 482
Avoid if (x != y) ..; else ..; 513 - 529
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
Found non-transient, non-static member. Please mark as transient or provide accessors. 41
Private field 'includes' could be made final; it is only initialized in the declaration or constructor. 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 146 - 148

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

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 1 - 462
Too many fields 46 - 462
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
Found non-transient, non-static member. Please mark as transient or provide accessors. 138
Private field 'classpathArtifactTypes' could be made final; it is only initialized in the declaration or constructor. 138
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. 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
Avoid using redundant field initializer for 'skipProcessing' 161
Found non-transient, non-static member. Please mark as transient or provide accessors. 161
A catch statement should never catch throwable since it includes errors. 199
A method/constructor shouldnt explicitly throw java.lang.Exception 212
A method/constructor shouldnt explicitly throw java.lang.Exception 212
Avoid instantiating new objects inside loops 217
Found non-transient, non-static member. Please mark as transient or provide accessors. 222
Private field 'projects' could be made final; it is only initialized in the declaration or constructor. 222
A method/constructor shouldnt explicitly throw java.lang.Exception 232
A method/constructor shouldnt explicitly throw java.lang.Exception 232
Local variable 'pom' could be declared final 237
Avoid if (x != y) ..; else ..; 243 - 254
A method/constructor shouldnt explicitly throw java.lang.Exception 273
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 322 - 348
Avoid if (x != y) ..; else ..; 368 - 381
Found non-transient, non-static member. Please mark as transient or provide accessors. 389
Avoid if (x != y) ..; else ..; 405 - 421
Avoid instantiating new objects inside loops 409
A method/constructor shouldnt explicitly throw java.lang.Exception 433
A method/constructor shouldnt explicitly throw java.lang.Exception 433
Local variable 'poms' could be declared final 447
Avoid instantiating new objects inside loops 451 - 453

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

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 21
Private field 'driver' could be made final; it is only initialized in the declaration or constructor. 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 catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 107
Avoid empty catch blocks 107 - 111

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
Found non-transient, non-static member. Please mark as transient or provide accessors. 38
Private field 'excludes' could be made final; it is only initialized in the declaration or constructor. 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
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. 1 - 591
Too many fields 53 - 591
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
Found non-transient, non-static member. Please mark as transient or provide accessors. 90
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. 97
Private field 'executeScripts' could be made final; it is only initialized in the declaration or constructor. 105
Found non-transient, non-static member. Please mark as transient or provide accessors. 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
Found non-transient, non-static member. Please mark as transient or provide accessors. 159
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. 167
Found non-transient, non-static member. Please mark as transient or provide accessors. 174
The method execute() has an NPath complexity of 328 179 - 276
Deeply nested if..then statements are hard to read 208 - 213
Deeply nested if..then statements are hard to read 226 - 231
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 270 - 273
Avoid if (x != y) ..; else ..; 285
Avoid if (x != y) ..; else ..; 300 - 319
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
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
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 505 - 512
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
Avoid using implementation types like 'HashMap'; use the interface instead 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 158 - 171
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
The method execute() has an NPath complexity of 2597 98 - 239
Avoid really long methods. 98 - 239
Avoid instantiating new objects inside loops 153 - 154
Avoid instantiating new objects inside loops 163
Avoid instantiating new objects inside loops 165 - 167
Avoid if (x != y) ..; else ..; 169 - 178
The String literal " to " appears 4 times in this file; the first occurrence is on line 190 190
Avoid if (x != y) ..; else ..; 204 - 211
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 286 - 288
A method/constructor shouldnt explicitly throw java.lang.Exception 304
A method/constructor shouldnt explicitly throw java.lang.Exception 304
Avoid instantiating new objects inside loops 311
Local variable 'freader' could be declared final 311
Avoid instantiating new objects inside loops 334
Avoid instantiating new objects inside loops 335
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 346
Avoid empty catch blocks 346 - 349

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). 31 - 328
The method write() has an NPath complexity of 11520 61 - 267
Avoid really long methods. 61 - 267
Avoid long parameter lists. 61 - 72
The method 'write' has a Cyclomatic Complexity of 22. 61 - 267
A method/constructor shouldnt explicitly throw java.lang.Exception 73
A method/constructor shouldnt explicitly throw java.lang.Exception 73
Avoid if (x != y) ..; else ..; 116 - 128
These nested if statements could be combined 196 - 204
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 15 - 46
This abstract class does not have any abstract methods 15 - 46
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
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
Line too long 20
Local variable 'outputPath' could be declared final 26 - 28

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

Violation Line
Abstract classes should be named AbstractXXX 23 - 271
The Logger variable declaration does not contain the static and final modifiers 29
Avoid empty catch blocks 71 - 74
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 71
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 80
Avoid empty catch blocks 80 - 83
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 177
A method/constructor shouldnt explicitly throw java.lang.Exception 214
A method/constructor shouldnt explicitly throw java.lang.Exception 214
A method/constructor shouldnt explicitly throw java.lang.Exception 242
A method/constructor shouldnt explicitly throw java.lang.Exception 242
Local variable 'path' could be declared final 263
Avoid instantiating new objects inside loops 265 - 267

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
Line too long 31
A method/constructor shouldnt explicitly throw java.lang.Exception 36
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
Line too long 40
A method/constructor shouldnt explicitly throw java.lang.Exception 42
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 41 - 49
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. 19 - 96
Variables that are final and static should be all capitals, 'projectCache' is not all capitals. 23
Use block level rather than method level synchronization 34 - 66
Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 56
Deeply nested if..then statements are hard to read 58 - 61
Avoid instantiating new objects inside loops 86 - 88

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

Violation Line
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
It is somewhat confusing to have a field name matching the declaring class name 13
Field instance has the same name as a method 18
Singleton is not thread safe 27 - 30
Use block level rather than method level synchronization 50 - 53
Assigning an Object to null is a code smell. Consider refactoring. 61