views:

150

answers:

2

I've just done a major, major overhaul on a colleagues project and throughout the process almost everything got rewritten. There was far too much code beforehand.

Now, I am left with the prospect that in amongst my project somewhere are old pre-refactoring methods that are no longer needed.

Is there a way to search the whole project for such methods in one go?

I understand the risk of potentially removing code used via reflection.

It's very similar to this question, except I would like two extra things:

  • An answer specific to ReSharper
  • Instructions on how to achieve this using ReSharper as I cannot seem to figure it out
+1  A: 

As far as I know, there is not way to do this with R# for the entire solution/project. The only way I know of is to go through your code manually, pressing Alt+F7 on each method name.

levi rosol
+7  A: 

Use solution-wide analysis.

If you change "Unused declaration" in "R# Options/Inspection Severity/Code Redundancies/Unused declaration" to "Show as Errors", you'll be able to identify all unused declarations.

Pawel Lesnikowski
That's not entirely correct. This will show you unused declarations with private visibility, but not with internal or public. ReSharper 5 will likely have better story about this issue.
Ilya Ryzhenkov
This now works for public and internal members in the beta of R# 5.
Wilka