src/main/java/com/microfocus/application/automation/tools/octane/model/CIEventCausesFactory.java
Refactor this method to reduce its Cognitive Complexity from 26 to the 15 allowed. Open
Open
private static FlowNode lookupJobEnclosingNode(Run targetRun, WorkflowRun parentRun) {
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.
See
Refactor this method to reduce its Cognitive Complexity from 29 to the 15 allowed. Open
Open
public static List<CIEventCause> processCauses(Run<?, ?> run) {
- Read upRead up
- Exclude checks
Cognitive Complexity is a measure of how hard the control flow of a method is to understand. Methods with high Cognitive Complexity will be difficult to maintain.
See
Provide the parametrized type for this generic. Open
Open
Map<String, CIEventCause> result = new LinkedHashMap();//LinkedHashMap - save order of insertion
- Read upRead up
- Exclude checks
Generic types shouldn't be used raw (without type parameters) in variable declarations or return values. Doing so bypasses generic type checking, and defers the catch of unsafe code to runtime.
Noncompliant Code Example
List myList; // Noncompliant Set mySet; // Noncompliant
Compliant Solution
List<String> myList; Set<? extends Number> mySet;