Questions tagged [sonarqube]

SonarQube is the open source platform, to continuously inspect code quality of applications. It allows developers to detect bugs and vulnerabilities as well as to decrease code smells or bad practices, in more than 20 different languages.

SonarQube was formerly known as Sonar.

SonarQube is the open source platform, to continuously inspect code quality of applications.

It allows developers to detect bugs and vulnerabilities as well as to decrease code smells, in more than 20 different languages.

Feature overview

  • Fully supports the Leak concept to make sure that the code quality of an application gets only better and better as code is added or updated over time
  • Available for more than 20 languages (including Java, C#, C/C++, Cobol, PL/SQL, ABAP, Javascript, PHP, Web, XML)
  • Built-in components for an easy integration (Maven, Ant, SVN, Git, JIRA, Mantis, Google Analytics, Redmine, Jenkins)

Resources

Tutorials & Examples

Books

11817 questions
28
votes
1 answer

In SonarQube what is the difference in meaning between the "Lines to Cover" and "Uncovered Lines" metrics?

I am looking at the Coverage report within the Measures tab of a SonarQube analysed C++ project. On that page my summary information is as follows: What are the differences between the "Lines to Cover" and "Uncovered Lines" metrics? I have looked…
TafT
  • 2,764
  • 6
  • 33
  • 51
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
28
votes
2 answers

Directory excluding in sonar-project.properties file doesn't work (for me)

I have excluded the directory in my project properties but sonar doesn't exclude it. Can anyone help me to find problem? sonar.sources=./ sonar.exclusions=./utility/Excel/**
Fatemeh Rostami
  • 1,047
  • 1
  • 15
  • 27
28
votes
3 answers

SonarQube does not start

I got a problem at SonarQube starting! In fact, it doesn't start and I don't get more informations only : --> Wrapper Started as Daemon Launching a JVM... Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org Copyright 1999-2006 Tanuki…
Simon LEDUNOIS
  • 347
  • 2
  • 4
  • 11
27
votes
4 answers

How do I ignore duplicated code report in Sonar?

SonarQube reports as "block of duplicated code" to different simple POJO class like below. In this case, A and B are different role. So, I think that I should not create abstract class. public class A{ private String xxx; // omitted other…
Neriudon
  • 377
  • 1
  • 3
  • 7
27
votes
3 answers

What is Cognitive Complexity in sonar report?

Now a days i switched to sonar reports for static code review and performance improvement. Under the rules section I found that the cognitive complexity of my methods are high. You can find cognitive complexity error in sonar as: Go to…
Akshay Paliwal
  • 3,718
  • 2
  • 39
  • 43
27
votes
1 answer

The return value of "orElseThrow" must be used

When I am scanning code with sonar lint the following code shows the bug as "The return value of "orElseThrow" must be used" itemList.stream() .filter(item -> orderItemId.equals(item.getId())) .findAny() .orElseThrow(() -> new…
Baji Shaik
  • 1,022
  • 2
  • 10
  • 14
27
votes
2 answers

integrating gitlab with sonarqube

I have GitLab CE (v8.5 at least) installed on my server. I would like to integrate it with sonarqube so that merge requests shows any issues in the comment section. Has anyone integrated these 2 systems successfully? At the moment, only sonarqube…
aver
  • 555
  • 2
  • 7
  • 21
27
votes
1 answer

GC overhead Limit exceeded while running sonar runner

I am getting OutOfMemoryException while performing sonar analysis on my project. Below is the stack trace: 14:55:55.433 DEBUG - Release semaphore on project : org.sonar.api.resources.Project@5a7b5cb8[id=1,key=myProj_web,qualifier=TRK], with key…
Yasin
  • 1,906
  • 1
  • 21
  • 37
27
votes
1 answer

Exclude folder from analysis

I look through the Internet and tried a million diferent ways, but didn't find an answer. Is there any way to exclude some folders with source files from the Sonar analysis, when I use maven to launch it (e.g. mvn sonar:sonar)?
mr.nothing
  • 5,141
  • 10
  • 53
  • 77
26
votes
2 answers

Split async method into two for code analysis?

I have code: public async Task DeleteColorSchemeAsync(ColorScheme colorScheme) { if (colorScheme == null) throw new ArgumentNullException(nameof(colorScheme)); if (colorScheme.IsDefault) throw new…
Oleg Sh
  • 8,496
  • 17
  • 89
  • 159
26
votes
2 answers

Sonar Jacoco for Kotlin Setup not generating code coverage

I'm trying to do Sonar Setup with Jacoco for Kotlin to generate Code Coverage report but it's not showing any code coverage. While checking Sonar Console it showing following error. Anyone has faced this issue before, any suggestion what could be…
CoDe
  • 11,056
  • 14
  • 90
  • 197
26
votes
4 answers

Plugin with id 'org.sonarqube' not found

I am trying to implement sonar with gradle for code-coverage measure for my project. we are using gradle-4.0.1 and sonarqube-6.4 . when I run gradle sonarqube from command line I get this error- Plugin with id 'org.sonarqube' not found. I tried…
Deepak S
  • 1,544
  • 3
  • 15
  • 33
26
votes
2 answers

Project segregation in Sonar Qube

I have a projects structure like as shown below. Cloud projects folder are having four type projects (eco-projects, evn-projects, met-projects, svn-projects) Each type of projects contains again four different projects, like for example in…
Alex Man
  • 4,746
  • 17
  • 93
  • 178
26
votes
4 answers

Sonar complaining about logging and rethrowing the exception

I have the following piece of code in my program and I am running SonarQube 5 for code quality check on it after integrating it with Maven. However, Sonar is complaining that I should Either log or rethrow this exception. What am I missing here? Am…
Nital
  • 5,784
  • 26
  • 103
  • 195