Wednesday, October 7, 2009

NDepend – Part 1

Its a .NET Static analysis tool for Architecture and developers to analyze the code structure,specify design rules , do some massive code review , compare different versions of code etc . This tool is developed by Patrick Smacchia(C# MVP).

Main features of NDepend are as follows as

  1. Code Query Language(CQL)
  2. Compare Builds
  3. 82 Code metrics
  4. Manage Complexity and Dependencies
  5. Detect Dependency Cycles
  6. Harness Test Coverage Data
  7. Enforce Immutability and purity
  8. Warning about the health of your Build Process
  9. Generate custom report from your Build Process
  10. Diagrams
  11. Facilities to cope with real-world environment

To read more

This is the sample program i am going to analyze by using NDepend.

using System;
using System.IO;
using System.Collections.Generic;
interface IFirst
    int AgeFirst { get; set; }
    string NameFirst { get; set; }
interface ISecond
    int AgeSecond { get; set; }
    string NameSecond { get; set; }
abstract class abstractClass
    int Ageabstract { get; set; }
    string Nameabstract { get; set; }
class Program
    static void Main(string[] args)

As we all know that the interface is not derived from System.Object.

and the abstract is derived from System.Object.

The Dependency Matrix in NDepend helps to See things graphically.

interface VS Abstract1

For IL Instruction for abstract class can be find out with the help of Metrics in NDepend as follows.


There are lot of things like Code Query Language(CQL), Detect Dependency Cycles,Compare Builds etc are there to explore in NDepend tool.That i will cover the the upcoming parts.

If any one interested in this tool, have a look on NDepend and order it Now.

Note : Thanks Patrick Smacchia, for given a free licence of NDepend to write a review.