Avoid assignments in operands

Impact area

Manageability

Severity

Medium

Affected element

Lightning

Rule ID

SF-0060

Impact

Assignments in operands make code more complicated and harder to read. Also it can be a signal of a poorly-defined equality operator (assignment operator ‘=’ was used instead of the equality operator ‘==’."") which will produce unwanted results.

Remediation

This is sometime indicative of the bug where the assignment operator ‘=’ was used instead of the equality operator ‘==’.""

Time to fix

30 min

References

See the PMD documentation article: AssignmentInOperand.

What's here


Related content

PMD - Lightning rules




Last modified on Jun 10, 2020