If don't know about NDepend, here are some references :
- on NDepend Website:
- Getting Started
- Features
- CQL Syntax , CQL Features and CQL Rules Help
- API
- Exploring Existing Code Architecture in Visual Studio
- NDepend on Wikipedia (with more references links)
- Pattrick's blog
- Other blog posts and articles:
- .NET Tools: NDepend static analysis tool, leave T-Pain behind.
- Educating Programmers with Placemats - NDepend Static Analysis Poster which talks about this NDepend Metrics pdf
- Exiting The Zone of Pain - Static Analysis with NDepend
- Continuous code quality measurement with NDepend and TeamCity
- Static Code Analysis based on NDepend
To start my NDepend test, I went to http://www.ndepend.com/NDependDownload.aspx and using the License key Patrick sent me, I choose the Professional Edition:
...that triggered the download of a zip with these files:
...which I unziped to a local folder and added the NDependProLicense.xml file (I also received from Patrick)
Here is the default UI of the stand-alone VisualNDepend.exe application:
Clicking on the link next to the red arrow, gets me a list of the latest VS solutions that I have opened:
Clicking ok will show a screen with the list the assemblies to analyse (with the option to remove or add more):
Once the analysis finishes (after less then 1 minute), this dialog pops up
I clicked on the first button (Interactive UI Graph) and got this:
The Dependency Graph can be popped-out and viewed independently:
... with lots of interresting analysis options in this UI:
Back in the main UI, here are the metrics view:
... the project properties:
... the rules execution result
... with these being the rules that are triggering errors (in red)
Note: the memory used also seems to be decent:
Installing VisualStudio add-in
Back in the unzip dir, I clicked on the NDepend.Install.VisualStudioAddin.exe file
... which opened up this UI:
... and this after clicking Install:
Next time VisualStudio opens up, we have a new menu:
I opened up the TeamMentor project and chose the NDepend menu option to Attach a new NDepend Project to VS Solution
... and now the NDepend windows show up inside a VisualStudio panel window:
...which can be placed anywhere inside the VisualStudio UI
Note that afte the project is assigned, the NDepend menu has different entries:
Opening up the Queries and Rules Edit menu option, opens up this REPL CQL rules editor
where we can write a LINQ query (with Code Complete support)
So for example, here is a query that lists all methods in the analysed assemblies:
... with lots of interesting pre-massaged data analysis:
... and really powerful results
I really like this query environment. It is fast, powerful and easy to understand
And it will be even better once I can access this data from the O2’s C# REPL that is also running as a VisualStudio extension :)
See next posts for my first experiments at writing CQL queries