Exploring your code with NDepend 2017.1.0 Professional Edition

I just got my hands on a license to NDepend 2017 (thanks patrick!). After installing it and opening an arbitrary solution I was working on at the office, it struck me how great it is to have someone - or a tool - to discuss complexity with! Not wanting to attach a NDepend project to my solution (since I share this solution with my colleagues who is not evaluating this tool yet), I opened the stand-alone Visual NDepend from the NDepend menubar


Analyzing my solution, the tool highlighted that one of my methods were overly large and complex - a method that evaluated certain column headers in an Excel document against a set of known terms in order to understand its structure. Just by highlighting this complexity nudged me to take a step back and look at our overall solution to see if this particular logic belonged there, or if this entire project, in fact, could be seen as just an extraction process, handling the interpretation elsewhere. THIS is something I appreciate from this tool - it gives you a different kind of feedback from other, more code-centric tools (or tools with a more narrow focus, perhaps)? I see NDepend as a great compliment to, say, Resharper, which both helps you to write good up-to-date code and ensures that you follow your team's coding conventions.

Another nice feature that I found while rooting around - this time on another solution - was the nice exploration menu on my solution right-click menu:



If you are a maintainer of a code base, getting a visual guide inside studio of what has changed might be more appealing than reading through that git log.

Another nice feature - where NDepend really shines - is its massive rule engine:


So what does it tell you? Let's look at the All issues in Application on this arbitrary project I opened:


There are two things I like here:
1. An opinion on what is right and wrong so that you have something to discuss with your team about. The rules are a very good starting point, but should you feel that they don't apply to your team, you can change them - after you've had a healthy discussion!

2. See those Debt and Annual Interest columns? Those are calculated approximations of how much they cost to fix and how much that cost adds up if left untouched. Talk about incentive to fix things! This is one of the new features in NDepend 2017 and something I welcome! Again, it's an approximation based on an opinion, but it's one hell of a starting point for discussion, if you don't want to accept the value as is!

If you haven't tried NDepend yet, go ahead and give it a whirl! It comes with a 14 day trial period and short video tutorials, so it's not much of an investment on your part!

More resources:

Comments

Popular posts from this blog

Auto Mapper and Record Types - will they blend?

Unit testing your Azure functions - part 2: Queues and Blobs

Testing WCF services with user credentials and binary endpoints