SonarQube Scanners run the analyzers on code. Use this tag for questions related to any of the scanners: SonarQube Scanner for CLI, Maven, Gradle, Jenkins, etc.
Questions tagged [sonarqube-scan]
1464 questions
137
votes
12 answers
How to disable warning on Sonar: Hide Utility Class Constructor?
I'm getting this warning on Sonar:
Hide Utility Class Constructor:
Utility classes should not have a public or default constructor
My class:
public class FilePathHelper {
private static String resourcesPath;
public static String…

Oomph Fortuity
- 5,710
- 10
- 44
- 89
34
votes
11 answers
Sonarqube scan error with line out of range?
[07:43:57]W: [Step 1/1] ERROR: Error during SonarQube Scanner execution
[07:43:57]W: [Step 1/1] ERROR: Line 523 is out of range in the file
src/main/java/com/company/package/File.java
(lines: 522)
For some reason Sonarqube is reporting an…

Ro.
- 1,357
- 4
- 13
- 25
33
votes
4 answers
Sonarqube is not showing code coverage after running
I'm running sonarqube with maven.
I have installed it using following way.
Using brew, I installed mysql and sonar.
When I run I get 7 critical bugs but the code coverage for 88 tests is zero
When I run it with IntelliJ's tools, I get the…

Tarun Maganti
- 3,076
- 2
- 35
- 64
29
votes
13 answers
How to solve Sonar error: Unable to load component class org.sonar.scanner.scan.ProjectLock
I have some issues while running Sonar on my netbeans' project. It's not working and i have the following error :
C:\Users\remy.fischer\Desktop\NetBeansProjects\NetBeansProjects\BinPacking\sonar-scanner-3.0.3.778-windows\bin>sonar-scanner…

Rémy Fischer
- 299
- 1
- 3
- 4
29
votes
7 answers
sonarqube analysis requires authentication when permission is anyone
sonarqube 5.5
several Java projects, all have permission set to anyone can execute analysis.
use mvn sonar:sonar to run analysis
Other projects work fine without error.
One project was found to not have the permission set. It was giving:
Not…

Ken Hargreaves
- 291
- 1
- 3
- 5
28
votes
4 answers
How to resolve "HttpException: Error 413" (SonarQube)
I've recently installed the latest version of Jenkins, SonarQube 6.0 (running on a separate server) and when the Jenkins job attempts to upload sonar scanner results to the SonarQube server, I get the following error:
'ERROR: Error during Sonar…

Mister Tommy Cat
- 325
- 1
- 3
- 8
23
votes
6 answers
How to correctly configure the property "sonar.java.binaries"?
We are using SonarQube 5.1.2 using Ant runner 2.2 and Java pluging 3.12 for the analysis. I can succesfully analyse my project. I just keep getting this error:
Java bytecode has not been made available to the analyzer. The…

Mark
- 414
- 1
- 3
- 9
22
votes
1 answer
What is the difference between coverage_exclusions vs exclusions in sonar?
What is the difference between coverage_exclusions vs exclusions in sonar? example:
"sonar": {
"exclusions": "gulpfile.js, ...",
"coverage_exclusions": "gulpfile.js, ..., server/models/*.js",
"quality_gate": "...",
"server_id":…

Sohail Si
- 2,750
- 2
- 22
- 36
21
votes
4 answers
How can we ignore some SonarQube rules in Java?
We recently started using SonarQube. We have found some rules that are suggested by SonarQube but we want to ignore them or give them a low priority and even configure the time suggested by SonarQube. For e.g
We want to avoid the rule (and/or…

WowBow
- 7,137
- 17
- 65
- 103
19
votes
4 answers
Sonarqube authorization - how to authorize with sonar-maven-plugin when sonar.forceAuthentication is enabled
I've got sonarqube 6.5 with default configs. When sonar.forceAuthentication flag is set to false, I can create and analyse project through command given below.
mvn sonar:sonar -Dsonar.host.url=https://mySonarHost/sonar -Dsonar.login=mySonarUserKey…

shha
- 281
- 2
- 3
- 7
16
votes
4 answers
Calling Optional#isPresent() in single line is reported as not called
I run SonarQube to check my code and I found a case which I don't understand the reported error.
My code is:
private static final int BASE_ID = 100_000_000;
private boolean isValidId(Id id) {
return id.asInteger().isPresent() &&…

Pablo Matias Gomez
- 6,614
- 7
- 38
- 72
15
votes
3 answers
Sonarqube scanner report upload error 500
When every I create a new project with SonarQube project properties, I get this error:
04:13:57.939 DEBUG: Upload report
04:14:11.533 DEBUG: POST 500 sonarserverurl/api/ce/submit?projectKey=Somename&projectName=Somename | time=13580ms
04:14:11.540…

Parth Mewada
- 151
- 1
- 1
- 4
15
votes
5 answers
Sonarqube integration and startSonar.bat failed Error(0x2)
Yesterday I started a new Unreal Engine Project on Visual Studio Team Service, I decided to learn by myself the art of videogames programming.
Anyway the best thing I wanted to use for this project was to integrate SonarQube in Visual Studio and get…

Davide Donadio
- 163
- 1
- 1
- 7
14
votes
1 answer
Unknown stage section "withSonarQubeEnv"
I am experimenting using Pipeline jobs with the Blue Ocean beta plugin enabled on our Jenkins server.
We have a sonarqube scanner build step configured in one of our freestyle jobs, which I now want to add a stage for in my Jenkins file.
I see from…

mindparse
- 6,115
- 27
- 90
- 191
14
votes
1 answer
NOSONAR tag to ignore an invalid issue still shows as an issue
I have the below method which is showing a sonar issue saying the method is not used anywhere.
@Provides
@ObjectMapperAnnotation
public ObjectMapper provideObjectMapper() { //NOSONAR
ObjectMapper mapper = new ObjectMapper();
…

AnOldSoul
- 4,017
- 12
- 57
- 118