Skip to content

SonarSource/sonar-scanning-examples

Repository files navigation

Sonar Scanning Examples

This repository showcases basic examples of usage and code coverage for SonarScanners.

Sonar's Clean Code solution helps developers deliver high-quality, efficient code standards that benefit the entire team or organization.

Examples

Various Languages

SonarScanner for various languages

Scan all the languages available or change directory to a language folder to scan just that language.

Ant

Scanning an Ant project is no different than scanning a plain Java (no build tool) project. Ant is used to build the project, but not to run the scan. Instead, the SonarScanner CLI is used.

SonarScanner for Ant is now deprecated. Please migrate to the SonarScanner CLI.

Gradle

If you have a Gradle project, we recommend the use of SonarScanner for Gradle or the equivalent gradle sonar task in your CI pipeline.

Maven

If you have a Maven project, we recommend the use of SonarScanner for Maven or the equivalent mvn org.sonarsource.scanner.maven:sonar-maven-plugin:sonar goal in your CI pipeline.

DotNet/C#

If you have a .NET project, we recommend the use of SonarScanner for .NET or the equivalent SonarScanner for .NET on your CI pipeline.

Swift

SonarScanner - Swift Code Coverage

C/C++/Objective-C

NOTE: All SonarScanner examples for C, C++ and Objective-C can be found here.

  • SonarSource sample C and C++ projects with SonarCloud or SonarQube analysis configured
  • C and C++ projects for different CI pipelines and build systems configured for Linux, Windows, and Mac

License

Copyright 2016-2026 SonarSource.

Licensed under the GNU Lesser General Public License, Version 3.0

About

Shows how to use the Scanners

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published