![]() | This article may be too technical for most readers to understand.(June 2022) |
![]() | |
Developer(s) | NDepend |
---|---|
Stable release | 2024.1
|
Operating system | Windows |
Type | Software quality |
License | Commercial, Proprietary |
Website |
ndepend |
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.
The main features of NDepend are:
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:
// <Name>Base class should not use derivatives</Name>
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 }
// <Name>Avoid making complex methods even more complex (source code cyclomatic complexity)</Name>
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.
![]() | This article may be too technical for most readers to understand.(June 2022) |
![]() | |
Developer(s) | NDepend |
---|---|
Stable release | 2024.1
|
Operating system | Windows |
Type | Software quality |
License | Commercial, Proprietary |
Website |
ndepend |
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.
The main features of NDepend are:
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:
// <Name>Base class should not use derivatives</Name>
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 }
// <Name>Avoid making complex methods even more complex (source code cyclomatic complexity)</Name>
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.