NDepend

Last updated
NDepend
Developer(s) NDepend
Stable release
2024.1
Operating system Windows
Type Software quality
License Commercial, Proprietary
Website ndepend.com

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.

Contents

Features

NDepend Report Source Files List ReportBig2023-Issue.png
NDepend Report Source Files List
ReportBig2023-Source.png
ClassDependents2.png


The main features of NDepend are:

Code rules through LINQ queries (CQLinq)

CQLinq Overview.png

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>warnifcount>0frombaseClassinJustMyCodeTypeswherebaseClass.IsClass&&baseClass.NbChildren>0// <-- for optimization!letderivedClassesUsed=baseClass.DerivedTypes.UsedBy(baseClass)wherederivedClassesUsed.Count()>0selectnew{baseClass,derivedClassesUsed}
// <Name>Avoid making complex methods even more complex (source code cyclomatic complexity)</Name>warnifcount>0fromminJustMyCodeMethodswhere!m.IsAbstract&&m.IsPresentInBothBuilds()&&m.CodeWasChanged()letoldCC=m.OlderVersion().CyclomaticComplexitywhereoldCC>6&&m.CyclomaticComplexity>oldCCselectnew{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.

See also

NDepend reviewed by the .NET community

Books that mention NDepend

Related Research Articles

In software engineering and development, a software metric is a standard of measure of a degree to which a software system or process possesses some property. Even if a metric is not a measurement, often the two terms are used as synonyms. Since quantitative measurements are essential in all sciences, there is a continuous effort by computer science practitioners and theoreticians to bring similar approaches to software development. The goal is obtaining objective, reproducible and quantifiable measurements, which may have numerous valuable applications in schedule and budget planning, cost estimation, quality assurance, testing, software debugging, software performance optimization, and optimal personnel task assignments.

Cyclomatic complexity is a software metric used to indicate the complexity of a program. It is a quantitative measure of the number of linearly independent paths through a program's source code. It was developed by Thomas J. McCabe, Sr. in 1976.

In the context of software engineering, software quality refers to two related but distinct notions:

<span class="mw-page-title-main">PMD (software)</span> Static software analysis tool

PMD is an open source static source code analyzer that reports on issues found within application code. PMD includes built-in rule sets and supports the ability to write custom rules. PMD does not report compilation errors, as it only can process well-formed source files. Rather, PMD is designed to detect inefficient code or bad programming habits, which can reduce the performance and maintainability of the program if they accumulate. It can analyze files written in Java, JavaScript, Apex and Visualforce, PLSQL, Apache Velocity, XML, and XSL.

<span class="mw-page-title-main">.NET Reflector</span>

.NET Reflector is a class browser, decompiler and static analyzer for software created with .NET Framework, originally written by Lutz Roeder. MSDN Magazine named it as one of the Ten Must-Have utilities for developers, and Scott Hanselman listed it as part of his "Big Ten Life and Work-Changing Utilities".

<span class="mw-page-title-main">C Sharp (programming language)</span> Programming language

C# is a general-purpose high-level programming language supporting multiple paradigms. C# encompasses static typing, strong typing, lexically scoped, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines.

This is an alphabetical list of articles pertaining specifically to software engineering.

Software visualization or software visualisation refers to the visualization of information of and related to software systems—either the architecture of its source code or metrics of their runtime behavior—and their development process by means of static, interactive or animated 2-D or 3-D visual representations of their structure, execution, behavior, and evolution.

<span class="mw-page-title-main">Call graph</span> Structure in computing

A call graph is a control-flow graph, which represents calling relationships between subroutines in a computer program. Each node represents a procedure and each edge (f, g) indicates that procedure f calls procedure g. Thus, a cycle in the graph indicates recursive procedure calls.

<span class="mw-page-title-main">EiffelStudio</span> Development environment

EiffelStudio is a development environment for the Eiffel programming language developed and distributed by Eiffel Software.

Polyspace is a static code analysis tool for large-scale analysis by abstract interpretation to detect, or prove the absence of, certain run-time errors in source code for the C, C++, and Ada programming languages. The tool also checks source code for adherence to appropriate code standards.

<span class="mw-page-title-main">Moose (analysis)</span>

Moose is a free and open source platform for software and data analysis built in Pharo.

<span class="mw-page-title-main">Parasoft C/C++test</span> Integrated set of tools

Parasoft C/C++test is an integrated set of tools for testing C and C++ source code that software developers use to analyze, test, find defects, and measure the quality and security of their applications. It supports software development practices that are part of development testing, including static code analysis, dynamic code analysis, unit test case generation and execution, code coverage analysis, regression testing, runtime error detection, requirements traceability, and code review. It's a commercial tool that supports operation on Linux, Windows, and Solaris platforms as well as support for on-target embedded testing and cross compilers.

JArchitect is a static analysis tool for Java code. This tool supports a large number of code metrics, allows for visualization of dependencies using directed graphs and dependency matrix. The tools also performs code base snapshots comparison, and validation of architectural and quality rules. User-defined rules can be written using LINQ queries. This possibility is named CQLinq. The tool also comes with a large number of predefined CQLinq code rules.

Software diagnosis refers to concepts, techniques, and tools that allow for obtaining findings, conclusions, and evaluations about software systems and their implementation, composition, behaviour, and evolution. It serves as means to monitor, steer, observe and optimize software development, software maintenance, and software re-engineering in the sense of a business intelligence approach specific to software systems. It is generally based on the automatic extraction, analysis, and visualization of corresponding information sources of the software system. It can also be manually done and not automatic.

Software intelligence is insight into the inner workings and structural condition of software assets produced by software designed to analyze database structure, software framework and source code to better understand and control complex software systems in information technology environments. Similarly to business intelligence (BI), software intelligence is produced by a set of software tools and techniques for the mining of data and the software's inner-structure. Results are automatically produced and feed a knowledge base containing technical documentation and blueprints of the innerworking of applications, and make it available to all to be used by business and software stakeholders to make informed decisions, measure the efficiency of software development organizations, communicate about the software health, prevent software catastrophes.

Google Kythe is a source code indexer and cross-referencer for code comprehension which describes itself as a "pluggable, (mostly) language-agnostic ecosystem for building tools that work with code".

CppDepend is a static analysis tool for C/C++ code. This tool supports a large number of code metrics, allows for visualization of dependencies using directed graphs and dependency matrix. The tools also performs code base snapshots comparison, and validation of architectural and quality rules. User-defined rules can be written using LINQ queries. This possibility is named CQLinq. The tool also comes with a large number of predefined CQLinq code rules.

Visual Expert is a static code analysis tool, extracting design and technical information from software source code by reverse-engineering, used by programmers for software maintenance, modernization or optimization.