Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I find and remove unused classes to cleanup my code?

Tags:

c#

resharper

Is there a quick way to detect classes in my application that are never used? I have just taken over a project and I am trying to do some cleanup.

I do have ReSharper if that helps.

like image 533
leora Avatar asked Dec 21 '08 13:12

leora


1 Answers

I don't recommend deleting old code on a new-to-you project. That's really asking for trouble. In the best case, it might tidy things up for you, but isn't likely to help the compiler or your customer much. In all but the best case, something will break.

That said, I realize it doesn't really answer your question. For that, I point you to this related question:

Is there a custom FxCop rule that will detect unused PUBLIC methods?

like image 58
Michael Haren Avatar answered Sep 28 '22 12:09

Michael Haren