Code Inspection: Unused local variable
This inspection detects local variables in a method that are declared and may be assigned, but are never used. Such a variable might act only once as the recipient in an assignment statement, without read usages, for example:
Unused variables increase code size and decrease performance. You should remove or use an unused local variable. JetBrains Rider suggests removing it with the quick-fix Remove unused local variable.
JetBrains Rider also offers an additional quick-fix — Indicate unused variable with name. You can select a meaningful name for it (
unused), to indicate that the variable is unused deliberately. With these names, JetBrains Rider will not highlight the variable as unused.