Code Inspection: Unused assignment
Configure inspections: Settings | Editor | Inspections
Show intention actions: AltEnter
Reports a variable whose value is never used after assignment.
Suggests removing the unused variable to shorten the code and to avoid redundant allocations.
The following cases are reported:
A variable is never read after assignment.
The value of a variable is always overwritten with another assignment before the variable is read next time.
The initializer of a variable is redundant (for one of the above-mentioned reasons).
Place the caret at the highlighted line and press AltEnter or click
.
Click the arrow next to the inspection you want to suppress and select the necessary suppress action.