My experience of using NDepend

My experience of using NDepend

Recently, I was playing with NDepend.

For those who don't know what it is, NDepend is a static analysis tool for .NET managed code.

They say its "Swiss Army Knife" for .NET Developers" on their website, if you are a windows user, I confirm it!

For macOS and Linux users, currently, it doesn't support some features (most features).

My experience, as a developer:

definitely using tools like NDepend in teams will save time and resources.

Yeah, there are some similar tools like SonarQube but of course, they have their own pros and cons. For basic needs, all of them are really good.

NDepend has a nice feature called Dependency Visualization which you can see your project dependencies as a graph I like this one more than the others.

I use this feature to examine the dependencies between my assemblies, types and methods. This helps me to keep a view of whether coupling between types is out of hand, and also helps me spot refactoring opportunities.

Additionally, it has a fantastic query language, CQL, which lets you write custom queries. These can be simple things such as "show me all methods that call this method", to queries to highlight dead code, queries on cylcomatic complexity, coupling, etc, and much much more.

The main features of NDepend are:

  • Dependency Visualization (using dependency graphs, and dependency matrix)
  • Smart Technical Debt Estimation
  • Quality Gates
  • Declarative code rule over C# LINQ query (CQLinq). The NDepend default Rules-Set has few overlaps with popular Roslyn analyzers. Roslyn analyzers are good at analyzing the code flow - what is happening inside a method - while the NDepend code model, on which the NDepend rules are based, is optimized for a 360 view of particular higher-scale areas including OOP, dependencies, metrics, breaking changes, mutability, naming...
  • Software metrics (NDepend currently supports 82 code metrics: Cyclomatic complexity; Afferent and Efferent Coupling; Relational Cohesion; Google page rank of .NET types; Percentage of code covered by tests, etc.)
  • Code Coverage data import from Visual Studio coverage, dotCover, OpenCover, NCover, NCrunch.
  • Version comparison of two versions of the same assembly
  • 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.
  • Reporting and CI/CD Integration with Azure DevOps, Bamboo, Jenkins, TeamCity, AppVeyor

No alt text provided for this image


Here is a short video about Dependency Visualization feature of NDepend:


#Ndepend #Analysis #Code_Analysis

要查看或添加评论,请登录

Kamran Sadin的更多文章

  • What is NullReferenceException?

    What is NullReferenceException?

    NullReferenceException! If you don't know the meaning of this exception, read this post. The short answer is: You have…

  • ???? : KSCheckMark TagHelper

    ???? : KSCheckMark TagHelper

    ???? ????? ?????? ?? ????? ?? ?? ????? ????/??? ????? ????? ? ??????? ?? ???? ???? ?? ??? ???? ????? ????? ?? ?? ?????…

  • ????? ????? ??? ??????? ?? ???.

    ????? ????? ??? ??????? ?? ???.

    ???? ??? ???? ??? ?? ??? ???? ???? ?? ?? ??? ??? ???? ?? ?? ???? ????? ???? ??? ????? ???? ??? ????? ?????? ????? ????…

  • Lazy Loading ?????

    Lazy Loading ?????

    Lazy Loading ?? ???????? ??????? ?? ????? ???? ?? ????? ??????? ???????? ?????? ? ????? ?? ????? ?? ?? ??? ???????? ??…

  • How to create custom TagHelper in DotNET Core

    How to create custom TagHelper in DotNET Core

    ????? ???? TagHelper ??????? ?? DotNet Core: ??? ?? ???? ?? ?????? ??? ?????? ?? ?????? ?? ???? ?????????? ?? ?????…

  • How HTML element can be bind to page by vue?

    How HTML element can be bind to page by vue?

    In last tip, I wrote about data binding to attributes, what about binding a html element to page? For example I want to…

  • VueJS and Data Binding:

    VueJS and Data Binding:

    As you know we can show data in page with {{}}, but what about binding data to an element attribute like href? For…

  • ????? ?? ?????? ?????? ??????? ??.

    ????? ?? ?????? ?????? ??????? ??.

    ??? ??? ?? ???????? ?????? ??????? ?? ??????? ?? ???? ???? ?? ????? ?? ??? ???????? ???????? ???? ?? ?????? ??? ???? ??…

  • ??? ?????? ????? ?????? ???? ??? ?? ASP.NET Core

    ??? ?????? ????? ?????? ???? ??? ?? ASP.NET Core

    ??? ??????? ????? ?????? ???????? ???? ??? ?? ?????? ???? ????? ???? ??????? ?? ???? ??? ?? ?????? ??? ?? ????? ?????…

    2 条评论

社区洞察

其他会员也浏览了