ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: Unused parameter (private accessibility)

Last modified: 29 May 2024

This inspection reports parameters that are declared in a method signature but never used in the method body.

The presence of an unused parameter can be misleading to other developers. It could also be indicative of an error where the parameter was intended to be used, but was inadvertently overlooked, possibly leading to unexpected behavior or bugs in the application.

In the below example, the users of the PrintString method would probably not check its implementation because its name and signature seem self-explanatory — they would expect it to print the string passed by the argument. So the fact that the method will print a constant string might be an unexpected behavior.