PMD Results

The following document contains the results of PMD 6.55.0.

Violations By Priority

Priority 3

gov/nist/secauto/metaschema/maven/plugin/AbstractMetaschemaMojo.java

Rule Violation Line
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 230

gov/nist/secauto/metaschema/maven/plugin/GenerateSchemaMojo.java

Rule Violation Line
ImmutableField Private field 'inlineDefinitions' could be made final; it is only initialized in the declaration or constructor. 102
RedundantFieldInitializer Avoid using redundant field initializer for 'inlineChoiceDefinitions' 111
ImmutableField Private field 'inlineChoiceDefinitions' could be made final; it is only initialized in the declaration or constructor. 111
CyclomaticComplexity The method 'generate(Set)' has a cyclomatic complexity of 10. 156–200
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 215
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 225
CognitiveComplexity The method 'execute()' has a cognitive complexity of 22, current threshold is 15 247–319
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 16. 247–319
NPathComplexity The method 'execute()' has an NPath complexity of 492, current threshold is 200 247–319
ConfusingTernary Avoid if (x != y) ..; else ..; 259–264
CollapsibleIfStatements These nested if statements could be combined 271–273
CollapsibleIfStatements These nested if statements could be combined 295–297

gov/nist/secauto/metaschema/maven/plugin/GenerateSourcesMojo.java

Rule Violation Line
CognitiveComplexity The method 'execute()' has a cognitive complexity of 23, current threshold is 15 129–201
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 18. 129–201
NPathComplexity The method 'execute()' has an NPath complexity of 984, current threshold is 200 129–201
ConfusingTernary Avoid if (x != y) ..; else ..; 141–146
CollapsibleIfStatements These nested if statements could be combined 154–156
CollapsibleIfStatements These nested if statements could be combined 178–180

gov/nist/secauto/metaschema/metaschema_maven_plugin/HelpMojo.java

Rule Violation Line
GodClass Possible God Class (WMC=78, ATFD=23, TCC=6.667%) 28–446
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 83–86
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 87–90
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 11. 97–160
NPathComplexity The method 'execute()' has an NPath complexity of 256, current threshold is 200 97–160
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 191
OnlyOneReturn A method should have only one exit point, and that should be the last statement in the method 210
CognitiveComplexity The method 'writeGoal(StringBuilder, String, Element)' has a cognitive complexity of 15, current threshold is 15 219–257
CyclomaticComplexity The method 'writeGoal(StringBuilder, String, Element)' has a cyclomatic complexity of 11. 219–257
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 346
LinguisticNaming Linguistics Antipattern - The transform method 'toLines' should not return void linguistically 368–409
OnlyOneReturn A method should have only one exit point, and that should be the last statement in the method 441

Priority 4

gov/nist/secauto/metaschema/metaschema_maven_plugin/HelpMojo.java

Rule Violation Line
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.lang.String' due to existing implicit import 'java.lang.*' 43
UselessParentheses Useless parentheses. 229
UselessParentheses Useless parentheses. 278
UselessParentheses Useless parentheses. 288

Files

gov/nist/secauto/metaschema/maven/plugin/AbstractMetaschemaMojo.java

Rule Violation Priority Line
NullAssignment Assigning an Object to null is a code smell. Consider refactoring. 3 230

gov/nist/secauto/metaschema/maven/plugin/GenerateSchemaMojo.java

Rule Violation Priority Line
ImmutableField Private field 'inlineDefinitions' could be made final; it is only initialized in the declaration or constructor. 3 102
RedundantFieldInitializer Avoid using redundant field initializer for 'inlineChoiceDefinitions' 3 111
ImmutableField Private field 'inlineChoiceDefinitions' could be made final; it is only initialized in the declaration or constructor. 3 111
CyclomaticComplexity The method 'generate(Set)' has a cyclomatic complexity of 10. 3 156–200
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 215
AvoidCatchingGenericException Avoid catching generic exceptions such as NullPointerException, RuntimeException, Exception in try-catch block 3 225
CognitiveComplexity The method 'execute()' has a cognitive complexity of 22, current threshold is 15 3 247–319
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 16. 3 247–319
NPathComplexity The method 'execute()' has an NPath complexity of 492, current threshold is 200 3 247–319
ConfusingTernary Avoid if (x != y) ..; else ..; 3 259–264
CollapsibleIfStatements These nested if statements could be combined 3 271–273
CollapsibleIfStatements These nested if statements could be combined 3 295–297

gov/nist/secauto/metaschema/maven/plugin/GenerateSourcesMojo.java

Rule Violation Priority Line
CognitiveComplexity The method 'execute()' has a cognitive complexity of 23, current threshold is 15 3 129–201
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 18. 3 129–201
NPathComplexity The method 'execute()' has an NPath complexity of 984, current threshold is 200 3 129–201
ConfusingTernary Avoid if (x != y) ..; else ..; 3 141–146
CollapsibleIfStatements These nested if statements could be combined 3 154–156
CollapsibleIfStatements These nested if statements could be combined 3 178–180

gov/nist/secauto/metaschema/metaschema_maven_plugin/HelpMojo.java

Rule Violation Priority Line
GodClass Possible God Class (WMC=78, ATFD=23, TCC=6.667%) 3 28–446
UnnecessaryFullyQualifiedName Unnecessary use of fully qualified name 'java.lang.String' due to existing implicit import 'java.lang.*' 4 43
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 3 83–86
IdenticalCatchBranches 'catch' branch identical to 'IOException' branch 3 87–90
CyclomaticComplexity The method 'execute()' has a cyclomatic complexity of 11. 3 97–160
NPathComplexity The method 'execute()' has an NPath complexity of 256, current threshold is 200 3 97–160
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 191
OnlyOneReturn A method should have only one exit point, and that should be the last statement in the method 3 210
CognitiveComplexity The method 'writeGoal(StringBuilder, String, Element)' has a cognitive complexity of 15, current threshold is 15 3 219–257
CyclomaticComplexity The method 'writeGoal(StringBuilder, String, Element)' has a cyclomatic complexity of 11. 3 219–257
UselessParentheses Useless parentheses. 4 229
UselessParentheses Useless parentheses. 4 278
UselessParentheses Useless parentheses. 4 288
UseDiamondOperator Explicit type arguments can be replaced by Diamond Operator 3 346
LinguisticNaming Linguistics Antipattern - The transform method 'toLines' should not return void linguistically 3 368–409
OnlyOneReturn A method should have only one exit point, and that should be the last statement in the method 3 441