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.
Features
The main features of NDepend are:- Interactive Web Reports about all Aspects of.NET Code Quality and Security . Reports can be built on any platform: Windows, Linux and MacOS
- CI/CD Integration with,,,,,
- Dependency Visualization
- .
- Software Metrics
- from Visual Studio coverage, dotCover, OpenCover, NCover, NCrunch.
- allowing the user to focus on newly identified issues.
- Integration with Visual Studio 2022, 2019, 2017, 2015, 2013, 2012, 2010, or can run as a standalone through VisualNDepend.exe, side by side with JetBrains Rider or Visual Studio Code.
Code rules through LINQ queries (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:
//
warnif count > 0
from baseClass in JustMyCodeTypes
where baseClass.IsClass && baseClass.NbChildren > 0 // <-- for optimization!
let derivedClassesUsed = baseClass.DerivedTypes.UsedBy
where derivedClassesUsed.Count > 0
select new
- Avoid making complex methods even more complex :
//
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
Additionally, the tool provides a live CQLinq query editor with code completion and embedded documentation.
NDepend reviewed by the .NET community
**
*
*
- discusses NDepend