Resharper does not warn that the parameter has never been used.

I wonder why resharper doesn't generate warnings like "parameter" aaa "is never used" for unused method arguments of public methods:

enter image description here

If you have configured resharper to perform "broad solution analysis", the warning will be displayed in both private and public methods:

enter image description here

Any idea about the reason? This is mistake?

+3


source to share


1 answer


Removing a parameter from a method is a split change, and therefore such a parameter cannot be simply removed simply because it is not currently being used. For a method, the private

only area to look at is the class in question. When the method is public, the tool cannot know if it is actually possible to remove the parameter. If he can see the entire scope, he can determine if the method is actually being used outside the class, and thus determine if the method can be refactored.



+3


source







All Articles