Sunday, 16 June 2013

Installing NDepend

After a nice correspondence with NDepend’s Patrick Smacchia who offered me a license of in exchange for some blog posts on how I used it, here is my first one covering the installation and first run

If don't know about NDepend, here are some references :

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:

image

...that triggered the download of a zip with these files:

image

 ...which I unziped to a local folder and added the NDependProLicense.xml file (I also received from Patrick)

image

Here is the default UI of the stand-alone VisualNDepend.exe application:

image

Clicking on the link next to the red arrow, gets me a list of the latest VS solutions that I have opened:

image

Clicking ok will show a screen with the list the assemblies to analyse (with the option to remove or add more):

image

Once the analysis finishes (after less then 1 minute), this dialog pops up

image

I clicked on the first button (Interactive UI Graph) and got this:

image

The Dependency Graph can be popped-out and viewed independently:

image

... with lots of interresting analysis options in this UI:

image

Back in the main UI, here are the metrics view:

image

... the project properties:

image

... the rules execution result

image

... with these being the rules that are triggering errors (in red)

image

Note: the memory used also seems to be decent:

image

Installing VisualStudio add-in

Back in the unzip dir, I clicked on the NDepend.Install.VisualStudioAddin.exe file

image

... which opened up this UI:

image

... and this after clicking Install:

image

Next time VisualStudio opens up, we have a new menu:

image

I opened up the TeamMentor project and chose the NDepend menu option to Attach a new NDepend Project to VS Solution

image

... and now the NDepend windows show up inside a VisualStudio panel window:

image

 ...which can be placed anywhere inside the VisualStudio UI

image

Note that afte the project is assigned, the NDepend menu has different entries:

image

Opening up the Queries and Rules Edit menu option, opens up this REPL CQL rules editor

image

where we can write a LINQ query (with Code Complete support)

image

So for example, here is a query that lists all methods in the analysed assemblies:

image

... with lots of interesting pre-massaged data analysis:

image
image

... and really powerful results

image

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
Post a Comment