Undetected 'unused parameter' error

I recently discovered via FxCop an unused parameter that was completely
unflagged by ReSharper. It was very simple... a string parameter that
wasn't being passed as an argument to a method that was the sole line (i.e.
the implementation was:

public foo(bunch of parameters, string newString)
{
return foo(bunch MORE parameters, null);
}

Where I should have put 'newString' in for the null. Since newString wasn't
being used anywhere, ReSharper really should have flagged it, rather than
letting it slip through until FxCop found it.

Just FYI.


2 comments
Comment actions Permalink

Thank you for the report.
We will investigate this issue.

--
Eugene Pasynkov
Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"
"Paul Bradshaw" <pbradshaw@advsol.com> wrote in message
news:dbj72r$udh$1@is.intellij.net...
>I recently discovered via FxCop an unused parameter that was completely
>unflagged by ReSharper. It was very simple... a string parameter that
>wasn't being passed as an argument to a method that was the sole line (i.e.
>the implementation was:
>

public foo(bunch of parameters, string newString)
{
return foo(bunch MORE parameters, null);
}

>

Where I should have put 'newString' in for the null. Since newString
wasn't being used anywhere, ReSharper really should have flagged it,
rather than letting it slip through until FxCop found it.

>

Just FYI.

>



0
Comment actions Permalink

ReSharper highlights unused parameters only for private methods. Detecting
unused parameters for public methods would require search through the whole
solution for this method usages (e.g. because the method can be used as delegate
handler and this means that unused parameter cannot be removed).

Valentin Kipiatkov
Chief Scientist, Vice President of Product Development
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I recently discovered via FxCop an unused parameter that was
completely unflagged by ReSharper. It was very simple... a string
parameter that wasn't being passed as an argument to a method that was
the sole line (i.e. the implementation was:

public foo(bunch of parameters, string newString)
{
return foo(bunch MORE parameters, null);
}
Where I should have put 'newString' in for the null. Since newString
wasn't being used anywhere, ReSharper really should have flagged it,
rather than letting it slip through until FxCop found it.

Just FYI.



0

Please sign in to leave a comment.