NsDepCop alternatives and similar packages
Based on the "Code Analysis and Metrics" category.
Alternatively, view NsDepCop alternatives based on common mentions on social networks and blogs.
-
App.Metrics
App Metrics is an open-source and cross-platform .NET library used to record and report metrics within an application. -
CodeMaid
CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding. -
.NET Compiler Platform ("Roslyn") Analyzers
A number of Roslyn diagnostic analyzers initially developed to help flesh out the design and implementation of the static analysis APIs. -
Metrics-Net
The Metrics.NET library provides a way of instrumenting applications with custom metrics (timers, histograms, counters etc) that can be reported in various ways and can provide insights on what is happening inside a running application. -
Gendarme
Gendarme is a extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked. -
PVS-Studio
PVS-Studio is a static analyzer on guard of code quality, security (SAST), and code safety. [Free for OSS] [$] -
NDepend
is a Visual Studio and VS Team Services extension that estimates your .NET code quality and Technical-Debt, that lets create code rules with C# LINQ syntax, visualize code structure and focus on changes and evolution.[$]
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of NsDepCop or a related project?
README
NsDepCop - Namespace Dependency Checker Tool for C#
NsDepCop is a static code analysis tool that helps you to enforce namespace dependency rules in C# projects.
- Runs as part of the build process and reports dependency problems.
- No more unplanned or unnoticed dependencies in your system.
What is this [dependency control](doc/DependencyControl.md) anyway?
Getting Started
- Add the NsDepCop NuGet package to your C# projects:
- Add a file called config.nsdepcop. Edit it and describe [dependency rules](doc/Help.md#dependency-rules).
- Dependency violations will be underlined in the code editor and also reported at build time just like compiler errors/warnings.
See the [Help](doc/Help.md) for details.
Optional Stuff
- Install the NsDepCop Config XML Schema Support for Visual Studio to get validation and IntelliSense while editing the config.nsdepcop files.
Changes in v2.0
The big change in v2.0 is that the implementation changed from MSBuild task + Visual Studio Extension to a standard Roslyn analyzer.
- Supports .NET Core / .NET 5 projects too.
- No need for the NsDepCop Visual Studio Extension any more.
- The NuGet package works both at build time and inside Visual Studio editor.
- If the NuGet package is added to a project then it appears in Solution Explorer: project / Dependencies / Analyzers / NsDepCop.Analyzer
- Issue severities can be configured using Visual Studio light bulb menu or .editorconfig files.
- Requires Visual Studio 2019 (16.10.0 or later).
- Dropped support for VS 2015/2017. For those, use NsDepCop v1.11.0.
- No need for the out-of-process service host any more.
- No more "Unable to communicate with NsDepCop service".
Please note that the AutoLowerMaxIssueCount feature is temporarily not supported. Do not yet upgrade to v2.0 if you're using that.
Versions
- See the [Change Log](CHANGELOG.md) for version history.
Feedback
- Please use the Issue Tracker to record bugs and feature requests.
- Or find me on twitter
More Info
- [Diagnostics Reference](doc/Diagnostics.md)
- [Troubleshooting](doc/Troubleshooting.md)
- [How to contribute?](Contribute.md)
Thanks to
- Roslyn for the best parser API.
- ReSharper for the free licence of this amazing tool.
- DotNet.Glob for the globbing library.
License
- [GPL-2.0](LICENSE)
*Note that all licence references and agreements mentioned in the NsDepCop README section above
are relevant to that project's source code only.