PMD Results

The following document contains the results of PMD 5.0.5.

Files

org/andromda/maven/plugin/cartridge/AbstractCartridgeTestMojo.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 71
Found non-transient, non-static member. Please mark as transient or provide accessors. 102
Comment is too large: Line too long 112
Found non-transient, non-static member. Please mark as transient or provide accessors. 123
A catch statement should never catch throwable since it includes errors. 185
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 191
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 191

org/andromda/maven/plugin/cartridge/CartridgeTest.java

Violation Line
This class name ends with Test but contains no test cases 34362
Variables that are final and static should be all capitals, 'logger' is not all capitals. 37
Field instance has the same name as a method 59
Singleton is not thread safe 6871
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. 115
JUnit 4 indicates test suites via annotations, not the suite method. 139144
Local variable 'suite' could be declared final 141
Comment is too large: Line too long 184
Avoid instantiating new objects inside loops 187
Local variable 'strings' could be declared final 187
Avoid instantiating new objects inside loops 190197
Local variable 'failureMessage' could be declared final 202
Local variable 'missingFileIterator' could be declared final 205
Prefer StringBuffer over += for concatenating strings 244
Parameter 'file' is not assigned and could be declared final 273
Parameter 'file' is not assigned and could be declared final 299
Local variable 'directory' could be declared final 315
Avoid throwing raw exception types. 318
Local variable 'suffix' could be declared final 332
Found non-transient, non-static member. Please mark as transient or provide accessors. 336
Avoid if (x != y) ..; else ..; 348
Assigning an Object to null is a code smell. Consider refactoring. 360

org/andromda/maven/plugin/cartridge/CartridgeTestFormatter.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 26
Found non-transient, non-static member. Please mark as transient or provide accessors. 31
Private field 'report' could be made final; it is only initialized in the declaration or constructor. 31
Found non-transient, non-static member. Please mark as transient or provide accessors. 36
Private field 'reportWriter' could be made final; it is only initialized in the declaration or constructor. 36
Avoid using redundant field initializer for 'testFailureIgnore' 41
Found non-transient, non-static member. Please mark as transient or provide accessors. 66
Avoid using redundant field initializer for 'numberOfErrors' 66
Parameter 'test' is not assigned and could be declared final 72
Parameter 'throwable' is not assigned and could be declared final 73
Avoid using redundant field initializer for 'numberOfFailures' 84
Found non-transient, non-static member. Please mark as transient or provide accessors. 84
Parameter 'test' is not assigned and could be declared final 90
Parameter 'failure' is not assigned and could be declared final 91
Parameter 'test' is not assigned and could be declared final 102
Document empty method 103104
Avoid using redundant field initializer for 'numberOfTests' 109
Found non-transient, non-static member. Please mark as transient or provide accessors. 109
Parameter 'test' is not assigned and could be declared final 114
Avoid using redundant field initializer for 'startTime' 122
Found non-transient, non-static member. Please mark as transient or provide accessors. 122
Variables that are final and static should be all capitals, 'newLine' is not all capitals. 127
The String literal "-------------------------------------------------------------------------------" appears 4 times in this file; the first occurrence is on line 136 136
Parameter 'test' is not assigned and could be declared final 150
Parameter 'throwable' is not assigned and could be declared final 151
Found non-transient, non-static member. Please mark as transient or provide accessors. 158
Private field 'failures' could be made final; it is only initialized in the declaration or constructor. 158
Parameter 'test' is not assigned and could be declared final 167
Use explicit scoping instead of the default package private level 167230
Useless parentheses. 169
StringBuffer constructor is initialized with size 16, but has at least 40 characters appended. 170
No need to call String.valueOf to append to a string. 170
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 171
StringBuffer (or StringBuilder).append is called 2 consecutive times with literal Strings. Use a single append with a single combined String. 172
Local variable 'ctr' could be declared final 180
Local variable 'comparator' could be declared final 186
Local variable 'comparator' could be declared final 196
Avoid throwing raw exception types. 225
Found non-transient, non-static member. Please mark as transient or provide accessors. 237
Use explicit scoping instead of the default package private level 237
Found non-transient, non-static member. Please mark as transient or provide accessors. 238
Use explicit scoping instead of the default package private level 238
Parameter 'testFailureIgnore' is not assigned and could be declared final 260

org/andromda/maven/plugin/cartridge/CartridgeTestMojo.java

Violation Line
The class 'CartridgeTestMojo' has a Cyclomatic Complexity of 22 (Highest = 21). 24193
Avoid really long methods. 30192
The method execute() has an NPath complexity of 1201 30192
The method 'execute' has a Cyclomatic Complexity of 21. 30192
Avoid if (x != y) ..; else ..; 33191
Avoid if (x != y) ..; else ..; 5070
Avoid if (x != y) ..; else ..; 5470
New exception is thrown in catch block, original stack trace may be lost 6768
Avoid if (x != y) ..; else ..; 7393
Avoid if (x != y) ..; else ..; 7793
New exception is thrown in catch block, original stack trace may be lost 9091
A catch statement should never catch throwable since it includes errors. 168
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 170

org/andromda/maven/plugin/cartridge/CartridgeTestUpdaterMojo.java

Violation Line
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
A catch statement should never catch throwable since it includes errors. 92
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 98
An instanceof check is being performed on the caught exception. Create a separate catch clause for this exception type. 98

org/andromda/maven/plugin/cartridge/FileComparator.java

Violation Line
Found non-transient, non-static member. Please mark as transient or provide accessors. 19
Found non-transient, non-static member. Please mark as transient or provide accessors. 20
Avoid using redundant field initializer for 'binary' 21
Found non-transient, non-static member. Please mark as transient or provide accessors. 21
Found non-transient, non-static member. Please mark as transient or provide accessors. 22
Avoid using redundant field initializer for 'ignoreWhitespace' 23
Found non-transient, non-static member. Please mark as transient or provide accessors. 23
Found non-transient, non-static member. Please mark as transient or provide accessors. 24
Avoid using redundant field initializer for 'ignoreLinesWithStrings' 24
Parameter 'testName' is not assigned and could be declared final 36
Parameter 'expectedFile' is not assigned and could be declared final 37
Parameter 'actualFile' is not assigned and could be declared final 38
Parameter 'binary' is not assigned and could be declared final 39
Parameter 'testName' is not assigned and could be declared final 61
Parameter 'expectedFile' is not assigned and could be declared final 62
Parameter 'actualFile' is not assigned and could be declared final 63
Parameter 'binary' is not assigned and could be declared final 64
Parameter 'ignoreWhitespace' is not assigned and could be declared final 65
Parameter 'ignoreLineEndings' is not assigned and could be declared final 66
Parameter 'ignoreLinesWithStrings' is not assigned and could be declared final 67
JUnit 4 tests that execute tests should use the @Test annotation 7887
JUnit tests should not contain more than 1 assert(s). 78
JUnit 4 tests that execute tests should use the @Test annotation 93141
JUnit tests should not contain more than 1 assert(s). 93
Local variable 'message' could be declared final 97
Comment is too large: Line too long 111
A catch statement should never catch throwable since it includes errors. 137
Parameter 'patternList' is not assigned and could be declared final 148
Parameter 'input' is not assigned and could be declared final 148
Local variable 'pattern' could be declared final 151

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

Violation Line
Comment is too large: Line too long 11
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
Avoid really long methods. 52259
The method execute() has an NCSS line count of 151 52259
The method execute() has an NPath complexity of 3000 52259
Local variable 'sb' could be declared final 66
Avoid variables with short names like sb 66
The String literal "" appears 35 times in this file; the first occurrence is on line 69 69
The String literal "Required: Yes" appears 8 times in this file; the first occurrence is on line 125 125
Parameter 'str' is not assigned and could be declared final 270
Parameter 'repeat' is not assigned and could be declared final 270
Local variable 'buffer' could be declared final 272
Parameter 'sb' is not assigned and could be declared final 290
Avoid variables with short names like sb 290
Parameter 'description' is not assigned and could be declared final 290
Parameter 'indent' is not assigned and could be declared final 290
Local variable 'it' could be declared final 292
Parameter 'indent' is not assigned and could be declared final 308
Parameter 'lineLength' is not assigned and could be declared final 308
Parameter 'text' is not assigned and could be declared final 308
Parameter 'indentSize' is not assigned and could be declared final 308
Local variable 'lines' could be declared final 310
Local variable 'ind' could be declared final 312
Local variable 'plainLines' could be declared final 313
Parameter 'lines' is not assigned and could be declared final 330
Parameter 'indentSize' is not assigned and could be declared final 330
Parameter 'line' is not assigned and could be declared final 330
Parameter 'lineLength' is not assigned and could be declared final 330
Local variable 'lineIndent' could be declared final 332
Local variable 'buf' could be declared final 333
Local variable 'tokens' could be declared final 334
Local variable 'token' could be declared final 337
Avoid variables with short names like c 353
Local variable 'c' could be declared final 353
Parameter 'line' is not assigned and could be declared final 377