jenkinsci/hpe-application-automation-tools-plugin

View on GitHub
src/main/java/com/microfocus/application/automation/tools/octane/model/processors/parameters/NodeLabelParameterProcessor.java

Summary

Maintainability
A
0 mins
Test Coverage

Remove this useless assignment to local variable "labelPd".
Open

            LabelParameterDefinition labelPd = (LabelParameterDefinition) pd;

A dead store happens when a local variable is assigned a value that is not read by any subsequent instruction. Calculating or retrieving a value only to then overwrite it or throw it away, could indicate a serious error in the code. Even if it's not an error, it is at best a waste of resources. Therefore all calculated values should be used.

Noncompliant Code Example

i = a + b; // Noncompliant; calculation result not used before value is overwritten
i = compute();

Compliant Solution

i = a + b;
i += compute();

Exceptions

This rule ignores initializations to -1, 0, 1, null, true, false and "".

See

There are no issues that match your filters.

Category
Status