NDepend, for all your .NET project analysis needs!

Hello,

I’ve been postponing this post for a while now, mostly due to a lack of time but now I’ll take a brief moment and tell you a little bit about NDepend.

NDepend is an standalone application / extension for Visual Studio.
It allows us, developers, to get detailed information about a .NET project.

NDepend will load up your assemblies and scan them down from top to bottom while keeping detailed information that will be displayed to you in a nice HTML page after it’s done processing your assemblies.

I haven’t used all of NDepend’s functionality as of yet, but I can tell you it has a lot! of capabilities.

For instance, there’s a feature that will display any circular references you might have in your project, no matter how deep.
It does this by using a “dependency matrix”. It might take some getting used to in the beginning, but once you have the hang of it, it is quite easy to use.

An example dependency matrix

It also shows you who depends on who and NDepend will display it in a nicely, organized way (= Dependency Graph)

An example dependency graph

NDepend allows you to configure certain settings, an example being “My methods must be 40% commented”.
Each time NDepend encounters a method or function that has less then 40% comment coverage, it will add the method to its error list and let you know which method or function needs more commentating 🙂
Other options are coding conventions (for example, all members of a class must start with _ and then a capital letter), IL complexity (to prevent you from writing too complex methods), Lines of Code (to prevent you from writing methods or functions that contain too many lines of code) and much more!

A CQL example

NDepends CQL (Code Query Language) is another nice feature. It allows you to write SQL like queries to retrieve information regarding your project.
An example:

SELECT METHODS WHERE NbLinesOfCode > 30

would return a list of all methods in your assemblies that contain more then 30 lines of code!

If you are working on a large project with multiple people, NDepend will surely make your day!
Keep your co-workers working with the same conventions as declared when the project started and prevent them from starting to use their own 🙂

I really can’t describe all the functionality of NDepend, so if this post has sparked your interest in NDepend, head over to http://www.ndepend.com and check them out!
I’m sure you won’t regret it 😉

NDepend is mad fun to play around with and it WILL give you a better insight in your project and it WILL help you clean up your code quite a bit!

Leave a Reply

Your email address will not be published.

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.