Questions tagged [sonarqube-scan]

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.

1464 questions
0
votes
0 answers

Code coverage reports for unit tests and integration test using jacoco

I am using jacoco maven plugin to generate a code coverage reports. I am looking for a solution, in most of the blogs both unit and integration testcases are located in same application. I would like to have my unit testcases in one application and…
user3355101
  • 231
  • 6
  • 15
-1
votes
0 answers

Could not find 'java' executable in JAVA_HOME or PATH. -sonar-scanner

When I am using java -version it gives me openjdk version "11.0.18" 2023-01-17 LTS OpenJDK Runtime Environment Zulu11.62+17-CA (build 11.0.18+10-LTS) OpenJDK 64-Bit Server VM Zulu11.62+17-CA (build 11.0.18+10-LTS, mixed mode) and $JAVA_HOME is…
-1
votes
0 answers

SonarQube shows lines of code 0 but shows coverage

I'm working on a nodeJs project with typescript that has a bitbucket pipeline configured to run sonar. However, after running it does not fill in any information other than…
-1
votes
1 answer

Sonarqube skipping some files and showing 0 lines

Sonarqube skipping some files and showing 0 lines (the files are in the same package) Sonarqube Community Edition 9.8
-1
votes
2 answers

Sonar qube while iterating in a loop

I'm using SonarQube to analyse the code. I have one method as below. Here i am checking not null condition already. if (myentities == null && !myentities.Any()) { yield return default; } else { foreach (var entity in myentities) { …
coder11 b
  • 99
  • 5
-1
votes
1 answer

Sonar error is null on at least one execution path.Why is this an issue?

I'm using SonarQube to analyse the code. I have one method as below. Headers is null on at least one execution path : public static async Task GetAsyncWithHeaders( IHttpClientFactory httpClientFactory, string apiUrl, …
coder11 b
  • 99
  • 5
-1
votes
1 answer

Sonar Scanner null pointer error while run sonar-scanner.bat file

I am getting null pointer exception after executing sonar-scanner.bat file in windows terminal for java mutliple application. I added path in sonar-scanner INFO: EXECUTION FAILURE…
-1
votes
2 answers

Sonar issue: A "NullPointerException" could be thrown; "getDataSource()" can return null. How to solve in try with resources block

This are the code try with resources block. try (Connection con = jdbcTemplate.getDataSource().getConnection(); PreparedStatement preparedStatement = con.prepareStatement(sql); Statement statement =…
Rajat
  • 161
  • 1
  • 1
  • 5
-1
votes
1 answer

Facing errors in SonarCube scan through Azure Devops pipeline

I am trying to implement sonar scan in my Scala codes which are in data bricks notebook via Azure-Devops pipeline but getting below error can somebody please help me?
venkat
  • 111
  • 1
  • 1
  • 11
-1
votes
1 answer

SonarQube server [https://sonar.example.org] can not be reached

In my situation, I have Jenkins with two nodes. One is acting as a master node, and the other nodes as a slave. Also, I have a separate instance for running on SonarQube. I have an internal Certificate Authority. I used it to sign my certificates.…
-1
votes
1 answer

Method passes an incorrect number of parameters to an SLF4J or Logj2 logging statement

Sonar reports this bug: Correctness - Method passes an incorrect number of parameters to an SLF4J or Slf4j2 logging statement. log.info("{}", e); What should i do to fix it? Thanks
Andy Xu
  • 51
  • 6
-1
votes
1 answer

unable to run sonarqube in maven project

I am having the problem given below while running "mvn sonar:sonar", since i have configured using this https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/ No plugin found for prefix 'sonar' in the current project and in the …
Abdul Qadir
  • 115
  • 1
  • 11
-1
votes
1 answer

Refactor multiple Else-if in Sonar Qube

Below code that i have has multiple else if conditions. Due to this when i run code using sonar cube it is saying "Refactor this method to reduce its Cognitive Complexity from 31 to the 15 allowed." Can Some one help me to reduce cognitive…
nik898
  • 15
  • 4
-1
votes
1 answer

Why Fields in a "Serializable" class should either be transient or serializable?

In our application, for one class(which is Serializable) sonar is complaining - Fields in a "Serializable" class should either be transient or serializable. That class is not serialized anywhere in our application. But I am not sure why it…
Rahman
  • 3,755
  • 3
  • 26
  • 43
-1
votes
1 answer

add new rules in sonarQube

I want to add new rule in sonarQube, so when I enter with an administrator profile I can’t find this button. My sonar version is sonarqube-Community-7.6. User : admin Password : admin And the URL is : http://localhost:9000/coding_rules There is…