SHARE:

NDepend is the must-have tool for .NET applications. Discovering the report feature at a glance.

Introduction

In computer science and software engineering, in particular, software quality is an overall assessment of software based on many indicators.
The completeness of the features, the correction and precision of the results, the reliability, the fault tolerance, the facility and the flexibility of its use, the simplicity, the extensibility, the compatibility and the portability, the facility of correction and transformation, the performance, consistency and integrity of the information it contains are all quality factors. In software engineering, factorization of data and code is the universal means of obtaining quality. This article will discuss NDepend, a tool to help .NET software developers achieve high quality in their
programs, especially the code analysis report.

What is NDepend?

NDepend was created as an OSS project in 2004. It became commercial in 2007 and evolved a lot since. It does static code analysis for .NET, and you can try it free for 14 days. NDepend can be used in standalone or integrated Visual Studio mode (Visual Studio Extension).
This tool gives you one-click access to many metrics in your code with a graphical representation. Interesting! With the report, which is the most exciting feature of NDepend, you can easily find your technical debt and fix it!

Running a report

  • The first step here is to generate the dashboard that will display metrics about your project like:
  • Technical Debt
  • Lines of code
  • Comments
  • Issues
  • Programming rules
  • Code coverage
  • Quality gates
  • And more other features

As you can see, the dashboard contains reliable and relevant information about your project. If you click on the green arrow surrounded by a folder icon on the top right of your screen, you’ll generate a report in HTML, opened automatically by your default Web Browser:

The generated report allows you to see what coding rules have been broken by listing the files that contain those broken rules. In the meantime, each listed file shows how many coding rules have not been resolved yet and a few more pieces of information about the file itself:

If you click on a file, you’ll see  errors that should be fixed in a very user-friendly presentation as follows:

After the fixing issues, recompiling your project and regenerating your report, you’ll see the diff in the fixed file:

This is more user-friendly than any other tool, and I appreciate it. Also this view can show code coverage data by tests if you import this info through the NDepend project:

Conclusion

I did not introduce every feature of NDepend because it’s a vast and complete product. I chose the most exciting features for me.
I didn’t specify that all NDepend results can be diff-ed since a
baseline:  https://www.ndepend.com/docs/code-diff-in-visual-studio.
I didn’t dig into Technical-Debt capabilities:
https://www.ndepend.com/docs/technical-debt that NDepend has facilities to explore dependencies with code graph and DSM (Dependency Structure Matrix)
https://www.ndepend.com/docs/visual-studio-dependency-graph
https://www.ndepend.com/docs/dependency-structure-matrix-dsm
https://www.ndepend.com/docs/cqlinq-features#Dependencies 
that NDepend can import code
coverage data and use it in some rule…
https://www.ndepend.com/docs/treemap-visualization-of-code-metrics#Color

Written by

anthonygiretti

Anthony is a specialist in Web technologies (14 years of experience), in particular Microsoft .NET and learns the Cloud Azure platform. He has received twice the Microsoft MVP award and he is also certified Microsoft MCSD and Azure Fundamentals.