NDepend 6

NDepend 6 is out; let's see what it can do for us!

I got the latest bits and ran an analysis on an old project of mine - a MUD Bot. For such a small project, the dependency graph (depicted below) didn't tell me much that I didn't already know, but the code quality analysis was a lot more telling. NDepend quickly ran through its 273 queries, highlighting first an issue with a method being too complex. It was the ShortenPath method in my NavigationModule depicted to your right. Seeing the code, I immediately realized that I was lacking a crucial domain concept - that of a Path! A room in a MUD world doesn't just have exits that can be represented as a string, but they can also be temporarily disabled, e.g. blocked by a locked door. Well, that was a quick win!








One big reason to upgrade to NDepend 6, is to get support for Visual Studio 2015. From what I can tell, it doesn't yet support .NET Core projects, but I've gotten back to them about that, so hopefully things will be even better soon!


NDepend packs a lot of features! It has a bunch of matrices that I haven't learned how to read yet, but the lists, the graphs and the search features are great! Here's an example matrix graph from the same project:



And here's an example of a dependency graph on PlayerModule - the class responsible for identifying the current player's Class (profession) and perform basic interactions with the world (retrieving and storing items in an arbitrary container, such as a sack or a backpack):



A player class, can override some behaviours (by overriding the virtual methods of PlayerModule); a Cleric, being able to heal itself, overrides ActOnBattleHealth, for example to stay alive:



OK, so I like the graph functionality ;-). Let's look at the search features next!



If you're not using Resharper already, NDepend's search functionality is quite neat, sporting a separate results window which lists not only the the results, but also the generated query for you to work with.



It also features an Export to Graph button which renders the results as a graph so you can see relationships in your code:



Whoop! Another graph! ;-)

The search functionality goes a lot deeper than simple name matching, however! Expanding the possible search targets, we start to approach the power of NDepend:


Having integrations with your source control, you can find classes and methods that were added, removed, changed ... see what was refactored, how the test coverage was affected and much more.


These were some highlights that struck me as I was evaluating the tool. For more information, check out http://www.ndepend.com/ndepend-v6!

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