This nifty class of tools is especially indispensable for architects, technical leads and solo programmers who are concerned about code quality and need to have code critically reviewed in order to avoid paying a technical debt. For architects and technical leads, having an automated tool can help them save time and cover a greater breadth of code to review for quality and any architecture flaws. For solo programmers who don't have the luxury of a peer to review their code (there is the StackExchange CodeReview forum but reviews may not be low-level or very comprehensive), these code analysis tools are a tremendous help to improve their craft.
NDepend (currently in version 4) is a powerful .NET code analysis tool that reveals a wealth of distilled information. It can be used as a Visual Studio Add-in (for versions 2012, 2010 & 2008) or through a standalone Windows GUI app, VisualNDepend or via a console app.
Potential uses of NDepend include:
- a thorough assessment of code quality via 82 different code metrics
- the ability to visualize your code at a high-level
- detecting dependencies between assemblies/components
- integrated into your build process
- comparing builds and tracking code differences
- reverse engineering a complex .NET code base
- using the lines of code metric of an existing module to estimate time required for a future module based on its LoC.
- perform an objective analysis of the quality of a library before acquiring it
- define custom rules to validate against and query code using CQL or Code Query Language, NDepend’s own query language for inspecting your code. It is like SQL for assemblies.
- receive warnings on Build process health
- integration of NDepend analysis into the build process can result in NDepend continuously checking for the violation of CQLinq rules
For someone completely new to code analysis tools, understanding the code metrics jargon can be intimidating. While NDepend has pretty detailed documentation, understanding the numerous keywords that are referenced by the tool can be a little daunting. If you put the effort to get past that, NDepend can pay rich dividends.
The man behind the tool, Patrick Smacchia, has been a Microsoft Visual C# MVP since 2003. In tune with the theme of NDepend, his blog is titled Code Better. He regularly answers questions on NDepend and related topics that are posted on StackOverflow.
To get started, try the free 14-day evaluation copy downloadable from the NDepend website. I was fortunate to have received a review copy from NDepend.
0 comments:
Post a Comment