917 GitHub stars and counting — SonarSource/sonar-dotnet is a C# project TopGit is tracking across repositories on the platform. Code analyzer for C# and VB.NET projects
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Static analysis of C# and VB.NET
languages in SonarQube server, SonarQube cloud and SonarQube for IDE code quality and security products. These Roslyn analyzers allow you to deliver code with integrated code quality and security that is safe, reliable and maintainable by helping you find and correct bugs, vulnerabilities and code smells in your codebase.
Features
480+ C# rules and 210+ VB.NET rules
Metrics (cognitive complexity, duplications, number of lines, etc.)
Import of test coverage reports from Visual Studio Code Coverage, dotCover, OpenCover, Coverlet, Altcover.
Import of third-party Roslyn Analyzers results
Support for custom rules
Useful public resources
Project homepage
Issue tracking
Nuget.org packages
SonarAnalyzer.CSharp
SonarAnalyzer.VisualBasic
Integration with SonarQube
Analyze projects with SonarScanner for .NET
Importing code coverage
SonarQube and the code coverage
Do you have a question or feedback?
Contact us on our Community Forum to provide feedback, ask for help, and request new rules or features.
Create a GitHub Issue if you've found a bug, False-Positive or False-Negative.
Get started
Building, testing and debugging the .NET analyzer
Building, testing and debugging the Java plugin
How to re-generate NuGet lock files
How to contribute
There are many ways you can contribute to the sonar-dotnet project.
When contributing, please respect our Code of Conduct.
Join the discussions
One of the easiest ways to contribute is to share your feedback with us (see give feedback) and also answer questions from our community forum.
You can also monitor the activity on this repository (opened issues, opened PRs) to get more acquainted with what we do.
Pull Request (PR)
If you want to fix an issue,
please read the Get started pages first and make sure that you follow our coding style.
We suggest avoiding the implementation of new rules, as a specification process is required first.
Before submitting the PR, make sure all tests are passing (all checks must be green).
If you did not sign the Contributor License Agreement in the past, please let us know in the PR your user handle from our Community Forum. We will arrange the signing via private message.
Note: Our CI does not get automatically triggered on the PRs from external contributors.
A member of our team will review the code and trigger the CI on demand by adding a comment on the PR (see Azure Pipelines Comment triggers docs):
/azp run Sonar.Net - It will run the full pipeline, including plugin tests and promotion
Custom Rules
To request new rules, Contact us on our Community Forum.
If you have an idea for a rule but you are not sure that everyone needs it, you can implement your own Roslyn analyzer.
You can start with this tutorial from Microsoft to write an analyzer.
All Roslyn-based issues are picked up by the SonarScanner for .NET
and pushed to SonarQube as external issues.
Also check out SonarQube Roslyn SDK to embed
your Roslyn analyzer in a SonarQube plugin, if you want to manage your rules from SonarQube.
Configuring Rules
SonarQube for IDE
The easiest way is to configure a Quality Profile in SonarQube. Use SonarQube for IDE Connected Mode to connect to SonarQube Server or Cloud.
Standalone NuGet
The rules from standalone NuGet packages can be enabled or disabled in the same way as the other analyzers based on Roslyn, by using the .globalconfig or .editorconfig files.
See: https://learn.microsoft.com/en-us/visualstudio/code-quality/use-roslyn-analyzers?view=vs-2022#set-rule-severity-in-an-editorconfig-file
If the rules are parameterized, the parameter values can be changed using SonarLint.xml additional files.
The first step is to create a new file, named SonarLint.xml, that has the following structure:
How active is development on SonarSource/sonar-dotnet?
The most recent commit recorded on SonarSource/sonar-dotnet was 1 day ago, based on the GitHub push timestamp. The repository has 246 forks — one of the better signals of community interest.
How many stars does SonarSource/sonar-dotnet have?
SonarSource/sonar-dotnet has 917 GitHub stars — refresh the page for the live number, or check github.com/SonarSource/sonar-dotnet. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is SonarSource/sonar-dotnet written in?
SonarSource/sonar-dotnet is written primarily in C#. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is SonarSource/sonar-dotnet associated with?
GitHub's repository topics for SonarSource/sonar-dotnet: "c-sharp", "code-quality", "roslyn", "sonarqube", "static-analysis", "static-analyzer", "static-code-analysis", "visual-basic". TopGit's editorial category is open-source.
Where do I read more about SonarSource/sonar-dotnet?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/SonarSource/sonar-dotnet is the definitive source.
Read full README in the tab above.
Still deciding about sonar-dotnet?
One click hands the question to an AI along with this page — see what it says about sonar-dotnet.