PMD Results

The following document contains the results of PMD 5.0.5.

Files

org/andromda/schema2xmi/JdbcTypeFinder.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. 1756
Variables that are final and static should be all capitals, 'jdbcTypes' is not all capitals. 18
Local variable 'fields' could be declared final 27
Local variable 'fieldsNum' could be declared final 28
A catch statement should never catch throwable since it includes errors. 38
Parameter 'jdbcType' is not assigned and could be declared final 52

org/andromda/schema2xmi/ModelElementFinder.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. 17123
Parameter 'model' is not assigned and could be declared final 27
Parameter 'fullyQualifiedName' is not assigned and could be declared final 28
Local variable 'names' could be declared final 33
Local variable 'name' could be declared final 39
Deeply nested if..then statements are hard to read 4045
Parameter 'modelPackage' is not assigned and could be declared final 63
Parameter 'object' is not assigned and could be declared final 70
Unnecessary use of fully qualified name 'org.omg.uml.modelmanagement.UmlPackage' due to existing import 'org.omg.uml.modelmanagement.UmlPackage' 87
Parameter 'umlPackage' is not assigned and could be declared final 87
Parameter 'object' is not assigned and could be declared final 94
Parameter 'elements' is not assigned and could be declared final 110
Parameter 'object' is not assigned and could be declared final 117

org/andromda/schema2xmi/Schema2XMI.java

Violation Line
A catch statement should never catch throwable since it includes errors. 132
Avoid printStackTrace(); use a logger call instead. 134
Local variable 'formatter' could be declared final 223
Parameter 'args' is not assigned and could be declared final 241
Local variable 'parser' could be declared final 244
Parameter 'args' is not assigned and could be declared final 251
Local variable 'schema2Xmi' could be declared final 253
Local variable 'commandLine' could be declared final 256
Local variable 'inputModel' could be declared final 269
Local variable 'transformer' could be declared final 270275
Local variable 'outputLocation' could be declared final 290
A catch statement should never catch throwable since it includes errors. 294
Avoid printStackTrace(); use a logger call instead. 297
Avoid variables with short names like th 301
Parameter 'th' is not assigned and could be declared final 301

org/andromda/schema2xmi/Schema2XMIGlobals.java

Violation Line
The field name indicates a constant but its modifiers do not 14
Only variables that are final should contain underscores (except for underscores in standard prefix/suffix), 'PACKAGE_SEPARATOR' is not final. 14
Variables should start with a lowercase character, 'PACKAGE_SEPARATOR' starts with uppercase character. 14
Only variables that are final should contain underscores (except for underscores in standard prefix/suffix), 'REPOSITORY_NAMESPACE_NETBEANSMDR' is not final. 19
Avoid excessively long variable names like REPOSITORY_NAMESPACE_NETBEANSMDR 19
The field name indicates a constant but its modifiers do not 19
Variables should start with a lowercase character, 'REPOSITORY_NAMESPACE_NETBEANSMDR' starts with uppercase character. 19

org/andromda/schema2xmi/Schema2XMIUtils.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. 1248
Use explicit scoping instead of the default package private level 2247
Deeply nested if..then statements are hard to read 3442
These nested if statements could be combined 3442

org/andromda/schema2xmi/SchemaTransformer.java

Violation Line
A high number of imports can indicate a high degree of coupling within an object. 11154
Too many fields 561154
Avoid really long classes. 561154
Variables that are final and static should be all capitals, 'logger' is not all capitals. 58
Avoid using redundant field initializer for 'repository' 59
Private field 'repository' could be made final; it is only initialized in the declaration or constructor. 59
Found non-transient, non-static member. Please mark as transient or provide accessors. 59
Private field 'jdbcDriver' could be made final; it is only initialized in the declaration or constructor. 64
Avoid using redundant field initializer for 'jdbcDriver' 64
Found non-transient, non-static member. Please mark as transient or provide accessors. 64
Private field 'jdbcUser' could be made final; it is only initialized in the declaration or constructor. 69
Avoid using redundant field initializer for 'jdbcUser' 69
Found non-transient, non-static member. Please mark as transient or provide accessors. 69
Private field 'jdbcPassword' could be made final; it is only initialized in the declaration or constructor. 74
Avoid using redundant field initializer for 'jdbcPassword' 74
Found non-transient, non-static member. Please mark as transient or provide accessors. 74
Avoid using redundant field initializer for 'jdbcConnectionUrl' 79
Found non-transient, non-static member. Please mark as transient or provide accessors. 79
Private field 'jdbcConnectionUrl' could be made final; it is only initialized in the declaration or constructor. 79
Avoid using redundant field initializer for 'packageName' 85
Found non-transient, non-static member. Please mark as transient or provide accessors. 85
Found non-transient, non-static member. Please mark as transient or provide accessors. 90
Avoid using redundant field initializer for 'schema' 90
Found non-transient, non-static member. Please mark as transient or provide accessors. 96
Avoid using redundant field initializer for 'tableNamePattern' 96
Avoid using redundant field initializer for 'typeMappings' 101
Found non-transient, non-static member. Please mark as transient or provide accessors. 101
Found non-transient, non-static member. Please mark as transient or provide accessors. 106
Private field 'classes' 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. 111
Private field 'foreignKeys' could be made final; it is only initialized in the declaration or constructor. 111
Avoid using redundant field initializer for 'classStereotypes' 116
Found non-transient, non-static member. Please mark as transient or provide accessors. 116
Found non-transient, non-static member. Please mark as transient or provide accessors. 122
Avoid using redundant field initializer for 'columnTaggedValue' 122
Avoid using redundant field initializer for 'tableTaggedValue' 128
Found non-transient, non-static member. Please mark as transient or provide accessors. 128
Avoid using redundant field initializer for 'metaColumnDecPlaces' 144
Found non-transient, non-static member. Please mark as transient or provide accessors. 151
Private field 'attributeTaggedValues' could be made final; it is only initialized in the declaration or constructor. 151
Found non-transient, non-static member. Please mark as transient or provide accessors. 156
Avoid using redundant field initializer for 'xmiVersion' 156
Parameter 'jdbcDriver' is not assigned and could be declared final 166
Parameter 'jdbcConnectionUrl' is not assigned and could be declared final 167
Parameter 'jdbcUser' is not assigned and could be declared final 168
Parameter 'jdbcPassword' is not assigned and could be declared final 169
Parameter 'inputModel' is not assigned and could be declared final 207
Avoid reassigning parameters such as 'outputLocation' 208
Avoid declaring a variable if it is unreferenced before a possible exit point. 210
Local variable 'startTime' could be declared final 210
Ensure that resources like this Connection object are closed after use 216
A catch statement should never catch throwable since it includes errors. 234
Parameter 'typeMappingsUri' is not assigned and could be declared final 254
A catch statement should never catch throwable since it includes errors. 260
Parameter 'packageName' is not assigned and could be declared final 271
Parameter 'schema' is not assigned and could be declared final 281
Parameter 'tableNamePattern' is not assigned and could be declared final 292
Found non-transient, non-static member. Please mark as transient or provide accessors. 300
Parameter 'columnNamePattern' is not assigned and could be declared final 308
Parameter 'classStereotypes' is not assigned and could be declared final 318
Found non-transient, non-static member. Please mark as transient or provide accessors. 326
Avoid using redundant field initializer for 'identifierStereotypes' 326
Parameter 'identifierStereotypes' is not assigned and could be declared final 333
Parameter 'columnTaggedValue' is not assigned and could be declared final 344
Parameter 'tableTaggedValue' is not assigned and could be declared final 355
Parameter 'taggedValues' is not assigned and could be declared final 363
Local variable 'tokList' could be declared final 365
Local variable 'tok' could be declared final 367
Local variable 'parts' could be declared final 368
Local variable 'tag' could be declared final 370
Local variable 'value' could be declared final 371
Parameter 'xmiVersion' is not assigned and could be declared final 383
Found non-transient, non-static member. Please mark as transient or provide accessors. 391
Found non-transient, non-static member. Please mark as transient or provide accessors. 396
A method/constructor shouldnt explicitly throw java.lang.Exception 403
Avoid if (x != y) ..; else ..; 410419
Local variable 'leafPackage' could be declared final 422426
Parameter 'modelManagementPackage' is not assigned and could be declared final 447
Avoid reassigning parameters such as 'modelPackage' 448
Avoid reassigning parameters such as 'packageName' 449
Local variable 'packages' could be declared final 454
Parameter 'connection' is not assigned and could be declared final 484
Parameter 'corePackage' is not assigned and could be declared final 485
Parameter 'modelPackage' is not assigned and could be declared final 486
Local variable 'metadata' could be declared final 489
Ensure that resources like this ResultSet object are closed after use 490
Local variable 'tableRs' could be declared final 490494
Local variable 'tableName' could be declared final 500
Local variable 'umlClass' could be declared final 505
Local variable 'umlClass' could be declared final 511
Local variable 'warning' could be declared final 523
Local variable 'tableName' could be declared final 533
Parameter 'modelPackage' is not assigned and could be declared final 562
Parameter 'metadata' is not assigned and could be declared final 563
Parameter 'corePackage' is not assigned and could be declared final 564
Parameter 'tableName' is not assigned and could be declared final 565
Local variable 'className' could be declared final 567
Local variable 'umlClass' could be declared final 568570
Local variable 'taggedValue' could be declared final 578579
The method createAttributes() has an NPath complexity of 1741 599727
Avoid really long methods. 599727
Parameter 'metadata' is not assigned and could be declared final 600
Parameter 'corePackage' is not assigned and could be declared final 601
Parameter 'tableName' is not assigned and could be declared final 602
Ensure that resources like this ResultSet object are closed after use 606
Local variable 'colMeta' could be declared final 609
Local variable 'colCount' could be declared final 610
Local variable 'typeName' could be declared final 638
Local variable 'colSize' could be declared final 639
Local variable 'required' could be declared final 672
Local variable 'attribute' could be declared final 674686
Local variable 'taggedValue' could be declared final 692693
Local variable 'keys' could be declared final 703
Local variable 'taggedValue' could be declared final 707708
Parameter 'metaColumnDecPlaces' is not assigned and could be declared final 732
Parameter 'metaColumnColumnSize' is not assigned and could be declared final 746
Parameter 'metaColumnTypeName' is not assigned and could be declared final 760
Parameter 'corePackage' is not assigned and could be declared final 780
Avoid reassigning parameters such as 'type' 781
Local variable 'typeName' could be declared final 791
Assigning an Object to null is a code smell. Consider refactoring. 792
Local variable 'packageName' could be declared final 793
Local variable 'umlPackage' could be declared final 794798
Parameter 'metadata' is not assigned and could be declared final 823
Parameter 'tableName' is not assigned and could be declared final 824
Parameter 'columnName' is not assigned and could be declared final 825
Ensure that resources like this ResultSet object are closed after use 829
Local variable 'columnRs' could be declared final 829
Parameter 'metadata' is not assigned and could be declared final 848
Parameter 'tableName' is not assigned and could be declared final 849
Local variable 'primaryKeys' could be declared final 852
Ensure that resources like this ResultSet object are closed after use 853
Local variable 'primaryKeyRs' could be declared final 853
Avoid really long methods. 872988
Parameter 'metadata' is not assigned and could be declared final 873
Parameter 'corePackage' is not assigned and could be declared final 874
Parameter 'tableName' is not assigned and could be declared final 875
Local variable 'primaryKeys' could be declared final 878
Local variable 'associations' could be declared final 879
Ensure that resources like this ResultSet object are closed after use 880
Local variable 'columnRs' could be declared final 880
Local variable 'fkColumnName' could be declared final 884
Local variable 'foreignTableName' could be declared final 888
Local variable 'association' could be declared final 889891
Local variable 'endName' could be declared final 903
Local variable 'primaryEnd' could be declared final 906919
Local variable 'required' could be declared final 923
Local variable 'deleteRule' could be declared final 931
Avoid declaring a variable if it is unreferenced before a possible exit point. 942955
Local variable 'foreignEnd' could be declared final 942955
Local variable 'taggedValue' could be declared final 968969
Parameter 'corePackage' is not assigned and could be declared final 998
Parameter 'name' is not assigned and could be declared final 999
Parameter 'value' is not assigned and could be declared final 1000
Local variable 'values' could be declared final 1002
Local variable 'taggedValue' could be declared final 10041005
Local variable 'tagDefinition' could be declared final 1009
Parameter 'corePackage' is not assigned and could be declared final 1027
Parameter 'names' is not assigned and could be declared final 1028
Parameter 'baseClass' is not assigned and could be declared final 1029
Local variable 'stereotypes' could be declared final 1031
Local variable 'name' could be declared final 1041
Local variable 'baseClasses' could be declared final 1047
Avoid instantiating new objects inside loops 1047
Parameter 'tableName' is not assigned and could be declared final 1069
Parameter 'columnName' is not assigned and could be declared final 1070
Parameter 'tableName' is not assigned and could be declared final 1094
Parameter 'columnName' is not assigned and could be declared final 1095
Local variable 'foreignKeys' could be declared final 1100
Parameter 'dataTypes' is not assigned and could be declared final 1120
Parameter 'required' is not assigned and could be declared final 1121
Parameter 'dataTypes' is not assigned and could be declared final 1145
Parameter 'lower' is not assigned and could be declared final 1146
Parameter 'upper' is not assigned and could be declared final 1147
Local variable 'mult' could be declared final 1149
Local variable 'range' could be declared final 1150

org/andromda/schema2xmi/SchemaTransformerException.java

Violation Line
Parameter 'throwable' is not assigned and could be declared final 18
Parameter 'message' is not assigned and could be declared final 28
Parameter 'message' is not assigned and could be declared final 40
Parameter 'throwable' is not assigned and could be declared final 41

org/andromda/schema2xmi/SqlToModelNameFormatter.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. 1157
Parameter 'name' is not assigned and could be declared final 18
Parameter 'name' is not assigned and could be declared final 29
Parameter 'name' is not assigned and could be declared final 40
Local variable 'buffer' could be declared final 42
Local variable 'tokens' could be declared final 43