NDepend - Code Analysis and Refactoring

NDepend is a code analysis tool for Visual Studio, allowing you to measure code quality using various techniques included within the software package that plugs quite neatly into Visual Studio.


I have been working on a complete refactoring of www.sk8loc8.com for the last few months, moving from a somewhat inconsistent Linq2SQL set up to a cleaner stack consisting of view models, UI Service layer, Domain Model and Generic Repository with EF4 sitting underneath it all.  One thing that is never easy is to gain an understanding of just how tied up your code is, and what approach you need to take to clean it all up.  Resharper is always my first tool of choice, but what to do when you have some ad-hoc question in your mind about what state of affairs your solution is currently in?  NDepend fills this gap rather neatly, allowing you to write custom queries using Code Query Language (CQL) to shine a light on those dark areas of code within your solution. 


My favourite part of NDepend has to be the dependency Graph.  It provides a global overview of ‘whos using who’ and is really useful when your trying to break apart that spaghetti mess you promised yourself was just a prototype.  This works hand in hand with the dependency matrix, which is sometimes easier to reference in the muddiest of waters.

If i were to change one thing about it, it would be to make the initial introduction a little easier.  It can be a touch difficult to get your head around at first, but if you take the time out to watch the introductory video, you will soon be on your feet.

What are you waiting for?  Get that spaghetti code out and let NDepend have it for breakfast.

1 Comment

Comments have been disabled for this content.