Code quality scanner for C#: qualor/scanner plus the .NET 8 and 10 SDKs and Roslynator
6.9K
Short description: Code quality scanner for C#: qualor/scanner plus .NET 8/10, Roslynator and SonarAnalyzer.CSharp
Categories: Developer tools, Integration & delivery, Security
The C# scanner of Qualor, the open-source, self-hosted SonarQube alternative
with no lines-of-code licence. This image is
qualor/scanner with the tooling for C# projects
added. Everything the scanner image does, this one does too; use it for repositories with C#
code, and the smaller qualor/scanner for the rest.
The same tags as qualor/scanner: the full version, such as 0.17.0, and the minor tag, such as
0.17. There is no latest tag.
Everything in qualor/scanner stays, the Go analyzers (staticcheck, go vet and gosec) and cppcheck
for C and C++ included.
/opt/qualor/share/dotnet (DOTNET_ROOT), with the
.NET CLI telemetry turned off (DOTNET_CLI_TELEMETRY_OPTOUT=1)./opt/qualor/dotnet/analyzers
(QUALOR_DOTNET_ANALYZERS).roslyn:S####), bundled next to
Roslynator. A project's own reference to SonarAnalyzer.CSharp replaces the bundled one, so there
is never a duplicate-analyzer error.qualor dotnet end on the rules release when it includes the engine (it needs the .NET SDK, so it runs only in this
image).node (uid 1000), like the scanner; about 4.4 GB (about 1.7 GB more than
qualor/scanner). It is built from the qualor/scanner image of the same tag, and released
with that tag right after it.Roslyn analyzers need the compiler's semantic model, so Qualor hooks into your own build instead of building anything itself:
qualor dotnet begin # installs an MSBuild hook for this checkout
dotnet build --no-incremental # your build: its SDK, restore, feeds and arguments
qualor dotnet end # removes the hook, reads the Roslyn logs, runs qualor scan
GitLab CI, with the component from the GitLab CI/CD catalog:
include:
- component: gitlab.com/qualor/qualor/[email protected]
inputs:
image: qualor/scanner-dotnet
image-tag: '0.17'
dotnet: true
build-command: dotnet build MySolution.sln --no-incremental
Or in a job of your own:
qualor:
image: { name: qualor/scanner-dotnet:0.17, entrypoint: [''] }
variables: { GIT_DEPTH: 0 }
script:
- qualor dotnet begin
- dotnet build MySolution.sln --no-incremental
- qualor dotnet end
after_script:
- if [ -d .qualor/dotnet ]; then qualor dotnet abort; fi
Azure Pipelines: copy
integrations/azure-devops/qualor-dotnet-docker.yml
to azure-pipelines.yml. It runs this image with docker run and needs no extension
(https://qualor.dev/docs/azure-devops).
--no-incremental matters: a project that is not recompiled writes no log. The environment
variables and exit codes are those of qualor/scanner. The full guide is at
https://qualor.dev/docs/languages-and-analyzers.
The Qualor CLI is MIT-licensed. The .NET SDK is MIT-licensed, and Roslynator is Apache-2.0.
SonarAnalyzer.CSharp 9.32 is LGPL-3.0, the last release before the SONAR Source-Available
License. This image has no sources image of its own: the complete corresponding source of the
copyleft components it carries, SonarAnalyzer.CSharp included, is
qualor/scanner-sources with the same tag,
the same one qualor/scanner uses.
The notices are in /opt/qualor/NOTICE.md and the licence texts in /opt/qualor/licenses/.
SonarQube and SonarCloud are trademarks of SonarSource SA. Qualor is an independent project and is not affiliated with, sponsored or endorsed by SonarSource. Their names are used only to describe compatibility and to compare features.
docker pull qualor/scanner-dotnet:0.18