NDepend


title: "NDepend" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["static-program-analysis-tools", ".net-programming-tools", "software-metrics"] topic_path: "technology/software-engineering" source: "https://en.wikipedia.org/wiki/NDepend" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::data[format=table title="Infobox Software"]

FieldValue
logoNDepend.jpg
nameNDepend
developerNDepend
latest_release_version2025.1
operating_systemWindows
genreSoftware quality
licenseCommercial, Proprietary
website
::

| logo = NDepend.jpg | screenshot = | caption = | name = NDepend | developer = NDepend | latest_release_version = 2025.1 | operating_system = Windows | genre = Software quality | license = Commercial, Proprietary | website = NDepend is a static analysis tool for C# and .NET code to manage code quality and security. The tool proposes a large number of features, from CI/CD Web Reporting to Quality Gate and Dependencies Visualization. For that reason, the community refers to it as the "Swiss Army Knife" for .NET Developers.

Features

::figure[src="https://upload.wikimedia.org/wikipedia/commons/8/8d/ReportBig2023-Issue.png" caption="NDepend Report Source Files List" alt="NDepend Report Source Files List"] ::

::figure[src="https://upload.wikimedia.org/wikipedia/commons/b/b0/ReportBig2023-Source.png"] ::

::figure[src="https://upload.wikimedia.org/wikipedia/commons/6/68/ClassDependents2.png" alt="NDepend Dependency Graph"] ::

The main features of NDepend are:

Code rules through LINQ queries (CQLinq)

::figure[src="https://upload.wikimedia.org/wikipedia/commons/0/0e/CQLinq_Overview.png" alt="NDepend Code Querying CQLinq"] ::

Live code queries and code rules through LINQ queries is the backbone of NDepend, all features use it extensively. Here are some sample code queries:

  • Base class should not use derivatives:

::code[lang=csharp] // Base class should not use derivatives warnif count > 0 from baseClass in JustMyCodeTypes where baseClass.IsClass && baseClass.NbChildren > 0 // <-- for optimization! let derivedClassesUsed = baseClass.DerivedTypes.UsedBy(baseClass) where derivedClassesUsed.Count() > 0 select new { baseClass, derivedClassesUsed } ::

::code[lang=csharp] // Avoid making complex methods even more complex (source code cyclomatic complexity) warnif count > 0 from m in JustMyCodeMethods where !m.IsAbstract && m.IsPresentInBothBuilds() && m.CodeWasChanged() let oldCC = m.OlderVersion().CyclomaticComplexity where oldCC > 6 && m.CyclomaticComplexity > oldCC select new { m, oldCC, newCC = m.CyclomaticComplexity, oldLoc = m.OlderVersion().NbLinesOfCode, newLoc = m.NbLinesOfCode, } ::

Additionally, the tool provides a live CQLinq query editor with code completion and embedded documentation.

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

static-program-analysis-tools.net-programming-toolssoftware-metrics