Home United States USA — software Writing Beautiful, Optimized, and Better. NET Code With NDepend Static Analysis

Writing Beautiful, Optimized, and Better. NET Code With NDepend Static Analysis

156
0
SHARE

Learn about NDepend, the “Swiss Army Knife for .NET developers, architects, and teams.” Install and set up NDepend to improve code almost immediately.
Join the DZone community and get the full member experience. Over the years, I’ve been in various discussions regarding the benefits of clean architecture, best practices, techniques such as code reviews, unit tests, etc., and I think to some degree, most of us are aligned on the reasons behind it. Having a clean architecture or code-base not only makes your development team happier, but it has a far-reaching impact on the business itself. In this post, we will learn about NDepend, which is described on their website as the following:
“The ‘Swiss Army Knife’ for. NET Developers, Architects, and Teams”
Here, we will take the first steps to see how to install and set up NDepend in the Visual Studio project and get started with improving code almost immediately. You can setup NDepend on your machine easily by following these steps:
The following is a 3-minute video from NDepend to show these steps:
I followed the steps as shown in the video and got NDepend set up in minutes. Let’s look at the code base that I will be using for testing purposes. I have a very simple. NET project with the following structure:
As you can see, it is a typical. NET Core Web API project (demoApp. Web) and it references two standard library projects for the domain model (demoApp. Core) and database repository (demoApp. Data). You can download the source code from this repository or use your own codebase and the principles will be the same. I am using this very simple codebase to keep the focus on NDepend in this introductory post and at the same time, I am very well aware of this application code structure and component dependencies. But as you may be already thinking, what about the complex code bases? and what if the developer is new to the project? This is where NDepend shines.

Continue reading...