Getting Started with NDepend for Visual Studio 2022
Tags: ndepend, visualstudio, csharp, beginners
Published: 2022-06-25 05:50:30

My previous post was about NDepend on Linux and how to utilize the NDepend to check your code quality. Now, I will explain some functions of NDepend for Visual Studio 2022. Let's get started.

## Download NDepend & Install the Visual Studio Extension

1. If you want to use the Trial version or have bought the license, please download [here](https://www.ndepend.com/download)
2. After downloading and extracting it, please open the `VisualNDepend.exe` installer.

    ![File](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1j995lq2prjemffip5a0.png)

3. If you don't have the license yet, press `Start Evaluation`. If you have the license, please insert into the box after the `Activate` button and click the `Activate` button. After activate the license, you may click `Continue` button.

    ![Start Evaluation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i38sikgo8cjljvnponsi.png)

    ![Continue](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c6arn54xlrstcdszwqy1.png)
 

4. Since I will integrate with Visual Studio. Please select `Install Visual Studio Extension` button.

    ![Page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5e3s6uaekqdm7l2tcdk.png)

5. Press `Install` for Visual Studio 2022. Please wait until the process is successful.

    ![VS 2022](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ihrmy77jkiuqer6ejp9k.png)

    ![Complete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jidag7j9y3das2aalbv6.png)

## Let's Explore

I will use different code/repositories to explore my code. I will use my old project when I was a Computer Science Student.

{% github berv-uni-project/tweety %}

### Dependency Graph

* I will attach NDepend Project to my project.

    ![Attach](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tor81fnliq1vaerey8md.png)

    ![Analyze](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d13cfmpcivmy0k2olxyf.png)
 
* You will get this dialog. Anyway, I will try the Dependency Graph.

    ![Dialog](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17kretbtyiv74kfgobt7.png)
 
    ![Dependency Graph](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ghzzj3m32j5klfkdruxh.png)
 
    ![Dependency Graph 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/li1hhq7wpzc5frsyixke.png)

* The Dependency Graph is a cool feature. Usually, when I want to know and understand the business flow or class interaction, I need to read the code from the top (controller/etc.). The Dependency Graph really helps me to browse my code easily and interactively.

### Code Coverage

* Since in this project I use Unit Test, so I can explore more the Code Coverage too.

    ![Dashboard](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mliokyat5pdcja5vbeu9.png)

    ![Code Metrics View](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jk06jzp8tfrb69jckkme.png)
 
* I also can see the visualization of my code coverage. This is cool!

## TLDR

So, what do you think? It's awesome, right? Mostly my main job is maintaining the existing code. That is why I'm highlighting the feature of Dependency Graph and Code Metrics View.

Anyway, I'm going to write something about DevOps Extension: [Code Quality NDepend for Azure DevOps, TFS 2017 and TFS 2018](https://marketplace.visualstudio.com/items?itemName=ndepend.ndependextension). So stay tune!

![Awesome GIF](https://media.giphy.com/media/dXckBa1HDG86RqUh19/giphy.gif)