For this application review, I've chosen a proof of concept I built last year, a small dungeon generator for RPGs (just places rooms and intersecting corridors, don't think I did anything exceptional ;)
The code needs refactoring (or probably starting from a clean project to better apply design patterns as a Factory), it was made in two nights and it even lacks documentation in all non-vital areas. But it had some unit tests and a "console renderer" to see the results:
So, although quite small in code (1.900 lines of code containing unit tests & comments) it is a good candidate for testing NDepend.
What is NDepend? Simply said, is the heavy artillery for .NET analysts and architects.
You need to check your code's complexity? You will get every available aspect, from methods' nesting depth, to cyclomatic complexity to missing comments in large blocks of code.
You need to change an assembly and want to know how the application will be affected and where to change the references and calls? You can check from simple graphs:
To a full dependency matrix:
You will get quite big HTML reports detailing everything, easily readable and very very detailed. They contain even the CQL's querys launched against your application.
CQL is a SQL-like language thats allows to create custom or advanced code analysis. You can check some examples of custom made CQL querys in the Rules for Spartan Programmers post.
NDepend allows too to compare two versions of assemblies, once again generating highly detailed reports. To see an example check the .NET 3.5 SP1 changes overview post.
The application integratesperfectly into Visual Studio, via the context menu:
We have available some flash movie tutorials to learn how to perform all tasks in few minutes, there are new revisions/builds of the application often...
I've just started using NDepend, and I feel like it should be mandatory for architects, like FXCop.
Any project can benefit from it. My dungeon generator application needs things like refactoring (methods with too many input parameters or too many lines of code inside, unsealed classes, possible conversions to structures...
Many thanks to Patrick Smacchia for providing me a Professional license of NDepend.
Tags: Tools