What you need is a tool that can analyze your code base. The best I have found for .Net is NDepend.
NDepend provides a query language for code.
I started a project and added all assemblies except the test ones. I then ran the query :
SELECT TYPES WHERE TypeCa == 0
TypeCa refers to the 'Afferent Coupling' of the type.. ie. how many other types refer to this one.
This found 40 files I could delete.
I used Resharper to double check each one was not used (except in tests).
I got a couple of false positives with types I am only using to pass as type parameters to generic classes. This is the only thing stopping me adding this check as part of our build script.
Finding all those classes by hand would have taken much longer, so...
Works for us!
Cool and useful! But I'm sure we found more from your analysis than you say ... more to this?
Post a Comment