NDepend 6


Again I get from Patrick Smacchia an opportunity to test new version of NDepend - this time version 6. If you don’t know, NDepend is a tool that measure and present information about code metrics in your .Net code. It can run as standalone application, but also as Visual Studio plugin.

In this article I will only focus on elements that are new in comparison to the previous versions. You can read my earlier description here and here.

Performance

I usually work with NDepend in Visual Studio. The tool integrates with VS flawless, it feels as part of the IDE. There was only one problem, because of the complex nature of calculating metrics, the tool wasn’t very fast. Occasionally it could also hang. Fortunately this is changed in the new release. Now the whole process of analyzing solution is much faster and I have feeling that the plugin is more stable. After installing version 6 I’ve never experienced a crash.

Better treemap

One of the “killer feature” of NDepend is treemap of the source code. In the previous versions it shows graphic representation based on one of the selected metrics. This is very nice, because you can easily spot problematic places - usually big rectangles on the map. Sometimes this can be misleading. Imagine situation when you look at treemap of lines of codes per method. You see a big figure and you start wondering what wrong is with this method. How big is your surprise when you examine it and discover that the code in this method only add some constants to the dictionary. Of course such method isn’t big deal and can safely be in your code. Thankfully with the new feature of NDepend, such situations can easily be eliminated. Now you can add another metrics to the view - every rectangle will be filled with additional color that indicate another metric. To solve a problem description above, we can add code complexity metric. This will point us to the code that we should refactor.

Treemap

Documentation

In my former overview of NDepend I haven’t write much about its documentation. When you start working with NDepend all those queries, matrices, graphs and maps can be overwhelming - especially when you don’t know (and understand) all the metric and how they describe your code. Thankfully almost every element is well documented. Without trouble you will find info about metrics, how they are calculated and what they mean (i.e. what value means bad code). This info is available as context pop-ups in the GUI, but also on the HTML pages. A big plus for that!

Version 6 extend this with detailed description of rules (i.e. “Types too big - critical”) and how you can fix it. If you want you can extend those description by yourself.

rules

Themes

Previous version of NDepend introduced huge changes in the look and feel of the GUI. In current version the changes aren’t so big. There are some small tweaks here and there. As a bigger improvement we can treat possibility of setting different colored themes (light, dark, blue and others) - maybe nothing very important, but it nice to have such option.

matrix

Conclusion

Probably you would like to hear from me if it’s worth buying new version of NDepend? As usual, it depends ;)

If you work with NDepend every day with many projects then I think you should. You will be happy with the speed and stability of the tool. New features will be additional plus.

If you use it occasionally and only some subset of all its options then probably you can think twice before spending money.

If you haven’t use it before and you want to improve code quality of your .Net projects, then it’s good time to buy it.

Note: On the screenshots you can see results of analyzing Lucene.Net source code.


You may also like

NDepend

NDepend 5

DevDay 2013