PMD Results

The following document contains the results of PMD 4.3.

Files

org/redhat/vmtruckloader/service/MachineSpecification.java

ViolationLine
Document empty constructor35
The field name indicates a constant but its modifiers do not43
Variables should start with a lowercase character43
The field name indicates a constant but its modifiers do not45
Variables should start with a lowercase character45

org/redhat/vmtruckloader/service/VmTruckLoader.java

ViolationLine
Too many static imports may lead to messy code22 - 223
This class has too many methods, consider refactoring it.53 - 223
The class 'VmTruckLoader' has a Cyclomatic Complexity of 3 (Highest = 11).53 - 223
All methods are static. Consider using Singleton instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.53 - 223
A catch statement should never catch throwable since it includes errors.67
System.exit() should not be used in J2EE/JEE apps71
The method 'run' has a Cyclomatic Complexity of 11.75 - 139
Local variable 'arguments' could be declared final76
Local variable 'props' could be declared final86
Local variable 'weld' could be declared final90
Local variable 'machineService' could be declared final91
System.exit() should not be used in J2EE/JEE apps96
Local variable 'lines' could be declared final166
Local variable 'specs' could be declared final167
Local variable 'arguments' could be declared final201
System.exit() should not be used in J2EE/JEE apps208
System.exit() should not be used in J2EE/JEE apps214
System.out.print is used218
System.exit() should not be used in J2EE/JEE apps219

org/redhat/vmtruckloader/util/CSVUtils.java

ViolationLine
Local variable 'entries' could be declared final86
Local variable 'writer' could be declared final88
Local variable 'strategy' could be declared final102
Local variable 'columns' could be declared final104
Local variable 'csv' could be declared final107
Local variable 'list' could be declared final108

org/redhat/vmtruckloader/util/FileUtils.java

ViolationLine
Local variable 'fileEncoding' could be declared final73
Local variable 'fileEncoding' could be declared final87
Local variable 'text' could be declared final88
Local variable 'fileEncoding' could be declared final118
Local variable 'lines' could be declared final119

org/redhat/vmtruckloader/util/VirtualMachineUtils.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.42 - 79

org/redhat/vmtruckloader/vmware/VMWareMachineSpecsUtils.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.41 - 107
Local variable 'vmSpec' could be declared final49
Local variable 'ethernet' could be declared final56
Local variable 'nicSpec' could be declared final64
Local variable 'nic' could be declared final67
Local variable 'nicBacking' could be declared final68
Local variable 'info' could be declared final71
Local variable 'vmSpec' could be declared final87

org/redhat/vmtruckloader/vmware/VMWareManagedObjectUtils.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.44 - 191
Local variable 'managedEntities' could be declared final51
Avoid printStackTrace(); use a logger call instead.58
Local variable 'managedEntities' could be declared final66
Local variable 'inventoryNavigator' could be declared final69
Avoid printStackTrace(); use a logger call instead.74
Local variable 'pools' could be declared final82
Local variable 'pool' could be declared final85
Local variable 'folders' could be declared final95
Prefer StringBuffer over += for concatenating strings99
Deeply nested if..then statements are hard to read142 - 146
Avoid printStackTrace(); use a logger call instead.170
Local variable 'rootFolder' could be declared final180
Local variable 'inventoryNavigator' could be declared final181
Local variable 'errorMessage' could be declared final185

org/redhat/vmtruckloader/vmware/action/AbstractVMWareActionCallback.java

ViolationLine
The class 'AbstractVMWareActionCallback' has a Cyclomatic Complexity of 8 (Highest = 13).45 - 89
The method 'runTask' has a Cyclomatic Complexity of 13.49 - 83
Local variable 'status' could be declared final53
Local variable 'info' could be declared final55

org/redhat/vmtruckloader/vmware/action/CloneMachineCallback.java

ViolationLine
It is a good practice to call super() in a constructor59 - 62
Local variable 'relocateSpec' could be declared final65
Local variable 'pool' could be declared final68
Local variable 'store' could be declared final75
Local variable 'nic' could be declared final96
Avoid instantiating new objects inside loops97
Local variable 'nicSpec' could be declared final97
Local variable 'relocateSpec' could be declared final107
Local variable 'cloneSpec' could be declared final109
Local variable 'sourceVm' could be declared final115
Local variable 'setupFolder' could be declared final120
Local variable 'status' could be declared final126
Local variable 'errorMessage' could be declared final137 - 138

org/redhat/vmtruckloader/vmware/action/EditMachineCallback.java

ViolationLine
The class 'EditMachineCallback' has a Cyclomatic Complexity of 5 (Highest = 14).54 - 120
It is a good practice to call super() in a constructor60 - 62
Use equals() to compare strings instead of '==' or '!='73
The method 'runTask' has a Cyclomatic Complexity of 14.88 - 119
Local variable 'task' could be declared final90

org/redhat/vmtruckloader/vmware/action/MoveVirtualMachineToNetworkCallback.java

ViolationLine
A high number of imports can indicate a high degree of coupling within an object.22 - 197
Local variable 'networkNameEncoded' could be declared final174
System.out.print is used175
Local variable 'switches' could be declared final176
Local variable 'switchList' could be declared final177
Local variable 'sw' could be declared final179
System.out.print is used181
Local variable 'managedEntities' could be declared final184
Local variable 'g' could be declared final186
Local variable 'switchKey' could be declared final188
Local variable 'sw' could be declared final189
System.out.print is used190