The first post about NDepend

First of all, I’d like to thank you Patrick (owner of NDepend to provide me the professional license of NDepend. This is definitely a cool and powerful tool even I just started using it.

In this post, I am going to introduce the simple steps I used to detect my project’s code quality.

Install NDepend

Go to page and download the trial by simply providing your Email.

Follow the official instructions to install it (

Get familiar with the menu

Once installed, the NDEPEND menu will be added into the Visual Studio menu, where you can initiate code analysis. You can also do the same via NDepend Start Page links.



Starting to analyze

Click the link ‘Analyze VS solutions and VS projects’ to start analyzing.


In the dialog, select your solution and then click OK button to continue.


In the ‘Analyze a set of .NET assemblies’ dialog, you can resolve any issues highlighted in red before start the analyzing as sometimes some projects cannot be loaded or there are multiple versions can be found. Normally you can Cleanup and Rebuild your solution to fix most of the issues.

Click ‘Analyze XX .NET Assemblies’ button to continue.


In the result dashboard, you can find out the summary about your code quality, e.g. Code Rules violated cases, total line of code, comment lines and so forth. You can also create trend reports about these indicators.

I didn’t realize there are so many issues with my code.  I will definitely use the information NDepend provided to fix all of them.Open-mouthed smile

For example, by clicking one of the violated rule, I can get all the details and then fix them accordingly.


Some interesting and helpful diagrams

NDepend provides some helpful diagrams as well to help you understand your projects.

Dependency Matrix


Dependency Graph


Abstractness vs. Instability


Treemap Metric View


With all these diagrams, I will immediately know where I am not not architecting or designing well (and there are a lot places to improve apparently Embarrassed smile).


NDepend helps me to analyze my code and find out all the coding issues very quickly. I am surprised by the enormous set of rules NDepend provides to validate the code quality.  This is absolutely an powerful and great tool to use if you want to improve your code quality and to adopt the preferred coding practices in .NET. I am just a beginner in NDepend’s world but I will definitely utilize it more in future.

I noticed there are some rules which are covered by Visual Studio but not appearing in NDepend’s result but it may be because I missed them, i.e. CA2241 Provide correct arguments to formatting methods. However this won’t really impact anything. I was actually thinking whether it is possible to bring all the Microsoft defined rules into NDepend?

info Last modified by Raymond at 8 months ago * This page is subject to Site terms.

More from Kontext

local_offer .net core

visibility 2393
thumb_up 0
access_time 3 years ago

After upgrading to ASP.NET Core 2.1 (.NET Core SDK 2.1.301), you may encounter the following error about encoding: System.ArgumentException    HResult=0x80070057    Message='Cyrillic' is not a supported encoding name. For information on defining a cus...

open_in_new ASP.NET Core

local_offer sqlite local_offer .net core local_offer entity-framework

visibility 22628
thumb_up 2
access_time 3 years ago

SQLite is a self-contained and embedded SQL database engine. In .NET Core, Entity Framework Core provides APIs to work with SQLite. This page provides sample code to create a SQLite database using package Microsoft.EntityFrameworkCore.Sqlite . Create sample project ...

open_in_new .NET Framework

local_offer core 2 local_offer .net core

visibility 2331
thumb_up 0
access_time 3 years ago

In .NET Core 2.x, Windows Forms or WPF are not implemented since they are based on GDI+ and DirectX respectively in Windows. In .NET Core 3.0, there is plan to add Desktop Packs which includes UWP. WPF and Windows Forms. However, they will still be Windows-only. In .NET Core applications, you may...

open_in_new ASP.NET Core

local_offer .net core

visibility 5992
thumb_up 0
access_time 3 years ago

.NET core introduces a logging API that works with a number of logging frameworks. The built-in providers are configurable and extensible to support different level loggings.

open_in_new .NET Framework

info About author

comment Comments (0)

comment Add comment

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

No comments yet.

Dark theme mode

Dark theme mode is available on Kontext.

Learn more arrow_forward

Kontext Column

Created for everyone to publish data, programming and cloud related articles. Follow three steps to create your columns.

Learn more arrow_forward