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.

Was it helpful ?

THE AI CODE GOVERNANCE BRIEF

Sign up for new updates!