A value is assigned to a variable or property, but either that location is never read later on, or its value is always overwritten before being read. This means that the original assignment has no effect, and could indicate a logic error or incomplete code.
Ensure that you check the control and data flow in the method carefully. If a value is really not needed, consider omitting the assignment. Be careful, though: if the right-hand side has a side-effect (like performing a method call), it is important to keep this to preserve the overall behavior.
In the following example, the return value of the call to
send on line 2
is assigned to the local variable
result, but then never used.
send returns a status code indicating whether the operation
succeeded or not, the value of
result should be checked, perhaps like this: