LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

sonar-scanner

SonarQube static code analysis scanner

TLDR

Run analysis
$ sonar-scanner
copy
With project key
$ sonar-scanner -Dsonar.projectKey=[myproject]
copy
Specify server
$ sonar-scanner -Dsonar.host.url=[http://localhost:9000]
copy
With authentication token
$ sonar-scanner -Dsonar.token=[token]
copy
Set source directory
$ sonar-scanner -Dsonar.sources=[src]
copy
Debug mode
$ sonar-scanner -X
copy
Specify config file
$ sonar-scanner -Dproject.settings=[sonar-project.properties]
copy

SYNOPSIS

sonar-scanner [-D property=value] [-X] [options]

DESCRIPTION

sonar-scanner performs static analysis for SonarQube/SonarCloud. It scans code for bugs, vulnerabilities, and code smells.Configuration via properties or file. sonar-project.properties defines project.Analysis results upload to server. Web interface shows findings.Multiple languages supported. Java, JavaScript, Python, and many others.CI integration automates scanning. Run on every build or pull request.

PARAMETERS

-D PROPERTY=VALUE

Set property.
-X, --debug
Debug output.
-h, --help
Show help.
-v, --version
Show version.

CONFIGURATION

sonar-project.properties

Project-level configuration file defining project key, source directories, language, and exclusion patterns.
SONAR_TOKEN
Environment variable for authentication token to SonarQube or SonarCloud.
SONAR_HOST_URL
Environment variable specifying the SonarQube server URL.

PROPERTIES

sonar.projectKey - Project identifiersonar.host.url - Server URLsonar.token - Authentication token (replaces deprecated sonar.login)sonar.sources - Source directoriessonar.language - Languagesonar.exclusions - Exclude patternssonar.inclusions - Include patternssonar.sourceEncoding - Source file encoding (default: system encoding)sonar.verbose - Enable verbose output (true/false)

INSTALL

sudo apk add sonar-scanner
copy
brew install sonar-scanner
copy

CAVEATS

Requires SonarQube/Cloud instance. Token needed for upload. Large projects take time.

HISTORY

SonarQube was created by SonarSource for continuous code quality. The scanner is the analysis client that sends data to the server.

SEE ALSO

eslint(1), phpstan(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid