Before I start on this, I am sure I am not going to full fill all what I want to express about NDepend. NDepend takes your to the deep dark corners of your code and lights up those bright corners in it. Thanks to Patrick Smacchia and all this product development team for such great tool.
What is NDepend?
I don't think I can explain better than what is written in its web site:
"NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.
The result is better communication, improved quality, easier maintenance and faster development."
So it is a massive code analysis tool, analyse every aspect of your code and produces informative reports with detailed matrices, diagrams and charts that should help you improve your code.
NDepend also generate and HTML report with all code analysis made alone with matrices and attached diagrams, figures and charts. One good thing I loved about this report, is when I found a term that I don't understand there is a link that takes me directly to online help where this term is defined. This helped me a lot, because some terms I am not familiar with, maybe my English or I am bad Engineer :o), either reason, it helped me and sure would improve any of those 2 defects in me :o).
Not only NDepend gives you these reports about your analysed code, but also it allows your edit constraints on and queries that produce these reports.
The powerfully behind NDepend is in its massive detailed Matrices. I am not going to list these matrices here because simple it would be copy and past from NDepend Matrices documentation. But I'll summarize there categories:
Under each group you'll find set of useful matrices. These groups share matrices between them. For example NbLineOfCode matrix which stands for Number Lines of Code is available on application, assemblies, namespaces, types and methods.
On Matrices documentation and under each matrix you'll find a recommendation note. These recommendations should guide you to the optimal value that can assist you to decide something. For example there is a matrix for Method rank available among matrices on methods. The recommendation states that methods with high MethodRank should be more carefully tested because bugs in such methods will likely be more catastrophic.
Code Query Language CQL:
NDepend as a cool feature called CQL Code Query Language. It is fun because you can query your code to display some information related to a specific matrix or set of matrices.
For example I want to display list of methods that has MethodRank > 10 I could write something like:
SELECT METHODS FROM ASSEMBLIES "Bloggie.Core" WHERE MethodRank > 10
But is much fun than that when you work with Visual NDepend:
Analyse your Code:
After you run NDepend code analysis it will provide your with information about your code. For example it will query your code to display information about unused code or dead code which called a group. This group includes 3 queries about unused types, unused methods and unused fields. It is not limited to that as you can add additional query or build a totally new group and specify your queries underneath it.
Beside adding you can modify any query if you think it is too strict or inapplicable in your case. For example there is CQL Group that evaluates code quality on of the queries check if number of parameters for each method do not exceed 5. If this value doesn't enough for you or maybe too much for you, you can changes it by modifying the query. Another query that checks for naming convention that require all local variable to be prefixed with "m_" I don't use this naming convention so I changed it.
More of fun is that you can Declare CQL constraints in C# or VB.NET source code and Visual NDepend will detect them and load them to be included in your analysis.
NDepend is really massive tool, it is integrated with VS.NET 2008 & VS.NET 2005 as well as reflector tool.
NDepend web site is rich of online demos that will guide you on how to use NDepend and maximize its usage to assist you to analyse your projects' code.
More external Reviews & Resources about NDepend:
NDepend is time saver & quality guide. It will point you to the areas of your code can't reach by manual analysis and review. Try it and you'll never regret that you did.