NDepend Blog

Improve your .NET code quality with NDepend

The NDepend GitHub Action is now available!

January 25, 2023 3 minutes read

NDepend GitHub Action Now Available

NDepend is a tool for .NET developers and teams that assesses the code quality within the IDE and the CI-CD process. With 17 years of existence and over 12.000 companies using it, the tool offers many features to improve .NET code. The tool is now available as a GitHub Action.

Why the NDepend GitHub Action?

NDepend as a GitHub Action provides several key & unique benefits:

  • Out of the box integration: No need to install or configure any external code quality server, just add the action in your workflow and it’s done. After the analysis a build summary is generated and you can explore in-depth the analysis result from VisualNDepend or the Visual Studio extension, or by downloading the html report available as a build artefactNDepend GitHub Action
  • Pull request quality check: When an analysis is done after the creation of a Pull Request, the NDepend action adds a comment to your PR. This comment contains the quality gates status and the number of issues per severity, same presentation as the Build Summary in the screenshot above. And to have more details you can click on the link provided in the comment.
  • Data privacy ensured: unlike other tools where the source and the analysis results could be uploaded to an external server, Ndepend github action stores the analysis result as a build artifact, so zero data is uploaded outside your github account.
  • Highly customizable: NDepend provides a unique way to customize rules, quality gates,code metrics and trends through C# LINQ queries. This way it is possible to quickly customize your configuration. 
  • Diff against a baseline: To check the code quality evolution, it’s necessary to be able to compare the analysis of two versions. NDepend provides advanced features to check results against a baseline that is easily configurable from the action.This way the tool can highlight new issues and fixed issues since the baseline. It can also list new classes, refactored methods or API breaking changes.
  • Rich UI to explore the result: After the analysis, you can explore the analysis result from VisualNDepend which provides advanced features to understand and explore the result.

    NDepend GitHub Action Dashboard

How to set up the integration?

The ndepend action must be added after your build and unit testing actions, note that only the license parameter is mandatory.

After the analysis, the ndepend result is stored as an artifact of your build, and to explore it you have two options:

  • Download the zipped ndepend artifact from your build summary, and open the generated HTML + js report it contains.
  • Access the result from VisualNDepend or the Visual Studio extension

Learn more and get support

For more info about the NDepend GitHub Action, please refer to this documentation https://www.ndepend.com/docs/ndepend-github-action

Also you can contact us at support@ndepend.com