Product Features

NDepend is a "Swiss Army Knife" for .NET project teams. With its wide range of features, it gives deep insight into code bases and empowers developers and architects to make intelligent decisions on projects.

Evaluate the Health of Your Application

NDepend allows your team to accurately gauge the overall health of your application, no matter how complex it is.

Code Rule and Code Query

More than 150 default code rules to check against best practices. Support for Code Query over LINQ (CQLinq) to easily write custom rules and query code.

Reduce Friction Between Your Developer Teams

NDepend's reporting and analysis helps architects and developers to communicate and reduce confusion.

Continuous Integration Reporting

Integrate NDepend analysis into your build process and get highly customized and detailed reports to see progression and prevent code quality degradation.

Complexity and Diagrams

Spot too complex code at a glance thanks to unique diagramming capabilities in the .NET world.

Easily Manage Gigantic Projects with Hundreds of Developers

Large companies often have many large builds that work together, often in mysterious ways. NDepend's in-depth reporting and custom code queries can help your company enforce its own coding standards and maintain very complex projects.

Trend Monitoring

Get Trend Charts about pretty much any code metrics to master the evolution of your application.

Working with Legacy Code is Now Easier

By mapping out the structure of the project, it is much easier to see how components and dependencies are connected.

Real-World Proof

Full Visual Studio integration, .NET Reflector support, super fast and lightweight analysis, NDepend is conceived for real-world programmers.

See how NDepend can change the way your company creates software.
Click below to download your 14 day trial

Download free trial.

Or you can see how to get started with NDepend and explore its in-depth documentation.

Get Started

NDepend Overview Tour



Code Rule and Code Query over LINQ (CQLinq)

NDepend lets query the code base over LINQ queries thanks to CQLinq.
For example the following CQLinq query matches all public methods that have more than 30 lines of code:
from m in Application.Methods  
where m.NbLinesOfCode >  30  && m.IsPublic
select m
Around 200 default queries and rules are provided when you create a new NDepend project. They are easy to read and easy to adapt to your need.
Writing CQLinq queries and constraints is straightforward both because it is C# LINQ syntax and because NDepend provides a CQLinq editor which supports:
  • code completion / intellisense
  • live compile error description
  • integrated tooltip documentation

Also, once the query is compiled, it gets executed immediately and its result is well displayed and browsable:


Powerful and elaborated queries and rules can be written with CQLinq, like the following one for example:
// <Name>UI layer shouldn't use directly DB types</Name>
warnif count > 0

// UI layer is made of types in namespaces using a UI framework
let uiTypes = Application.Namespaces.UsingAny(
                 
Assemblies.WithNameIn("PresentationFramework", "System.Windows", 
                                       
"System.Windows.Forms", "System.Web")
              
).ChildTypes()

// You can easily customize this line to define what are DB types.
let dbTypes = ThirdParty.Assemblies.WithNameIn("System.Data", "EntityFramework", "NHibernate").ChildTypes()
              
.Except(ThirdParty.Types.WithNameIn("DataSet", "DataTable", "DataRow"))

from uiType in uiTypes.UsingAny(dbTypes)
let dbTypesUsed = dbTypes.Intersect(uiType.TypesUsed)
select new { uiType, dbTypesUsed }

But short CQLinq queries can be written (or even generated) to get some immediate answers to questions about a code base:
  • Is the code layered correctly?
    from n in Namespaces where n.Level == null select n
  • Which methods have been refactored since the last release and are not thoroughly covered by tests?
    from m in Application.Methods where 
    m.CodeWasChanged()  &&  m.PercentageCoverage <  100
    select new { m, m.PercentageCoverage } 
  • Which classes implement a particular interface?
    from t in Types 
    where t.IsClass && t.Implement("System.IDisposable")
    select t
  • Which methods create objects of a particular class?
    from m in Methods where m.CreateA ("MyNamespace.MyClass") select m
  • Which methods assign a particular field?
    from m in Methods 
    where m.AssignField("MyNamespace.MyClass.m_Field")
    select m
  • What are the 10 most complex methods?
    (from m in Methods 
     
    orderby m.CyclomaticComplexity
     
    select new { m, m.CyclomaticComplexity }).Take(10) 
  • Which method could have a more restricted visibility?
    from m in Application.Methods 
    where m.Visibility != m.OptimalVisibility
    select new { m, 
                 
    m.Visibility , 
                 
    CouldBeDeclared = m.OptimalVisibility,
                 
    m.MethodsCallingMe }
  • Which complex method is not enough commented?
    from m in Application.Methods 
    where m.CyclomaticComplexity >  15 && m.PercentageComment <  10
    select new { m, m.CyclomaticComplexity, m.PercentageComment }


You can also be warned automatically when a CQLinq query returns a certain result. Such a CQLinq code query is actually a code rule such as:
  • I don’t want that my User Interface layer to depend directly on the DataBase layer:
    warnif count > 0 
    from n in Namespaces 
    where n.IsUsing("DataLayer") && (n.Name == @"UILayer")
    select n
  • Static fields should not be named m_XXX (Custom naming conventions):
    warnif count > 0 
    from f in Fields where f.NameLike (@"^m_") && f.IsStatic
    select f
  • Methods out of MyAssembly and MyAssembly2 should not have more than 30 lines of code:
    warnif count > 0  
    from  m in Application.Assemblies.WithNameNotIn("MyAssembly1", "MyAssembly2").ChildMethods() 
    where m.NbLinesOfCode > 30
    select new { m, m.NbLinesOfCode }
  • Public methods should not be removed to avoid API breaking changes:
    warnif count > 0 
    from m in codeBase.OlderVersion().Application.Methods 
    where m.IsPublic && m.WasRemoved()
    select m
  • Types tagged with the attribute MyNamespace.FullCoveredAttribute must be thoroughly covered by tests:
    warnif count > 0  
    from  t in Application.Types 
    where t.HasAttribute ("NDepend.Attributes.FullCoveredAttribute") && 
          
    t.PercentageCoverage <  100
    select new { t, t.PercentageCoverage }
Related Documentation::
Default CQLinq Rules
CQLinq Syntax
CQLinq Features
CQLinq Performance
CQL to CQLinq Conversion
Declare CQLinq rules in C# or VB.NET source code