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
3
votes
1 answer

Using the sonar plugin with eclipse

I'm trying to use Sonar to analyse my projects in Eclipse. I am currently using Maven in eclipse. I installed the Sonar Eclipse plugin as described in this link. But when I try and associate my project with Sonar, I get an error saying: project …
user1218900
  • 97
  • 1
  • 2
  • 7
3
votes
2 answers

Sonar Code Coverage Analysis Doesn't Add Up

Maybe this is due to my own misunderstanding of what in Sonar is being analyzed, but at the Component level Sonar is reporting a much higher percentage of code coverage than what appears to be possible given the results at the package level. May I…
Brett VanderVeen
  • 893
  • 1
  • 11
  • 16
3
votes
1 answer

installing phpunit/PHPUnit-3.5.5 via pear (for sonar)

I am trying to setup PHP Plugin for Sonar, and this plugin needs specific packages in specific version. So, When I am trying to install PHPUnit 3.5.5 using following command, it is installing newer version. What I do wrong? [VMWARE] root@localhost ~…
bluszcz
  • 4,054
  • 4
  • 33
  • 52
3
votes
1 answer

Why does the sonar plugin in jenkins build everything again?

I installed Jenkins on my build machine and in the Jenkins config checked the box to run sonar analysis on my maven based project. It works but if I look at the log my entire project is built twice. Once from maven and once for sonar (still using…
Usman Ismail
  • 17,999
  • 14
  • 83
  • 165
3
votes
2 answers

Bamboo + sonar.dynamicAnalysis=reuseReports = 0% Rules Compliance

Bamboo is in place to do continuous builds, but want to use Sonar for quality metrics tracking. Unit test pass/fail and Clover code coverage metrics must be captured in Bamboo. But, these same values should be sent to Sonar as well, so as to not…
orangepips
  • 9,891
  • 6
  • 33
  • 57
3
votes
1 answer

Google Cloud Dataflow's Code Coverage on the new code is not passing the threshold in SonarQube after Java 17 upgrade

Recently, I have upgraded my cloud dataflow application from Java 11 to Java 17 and its corresponding dependencies. The application works fine and even the test cases work fine. I have also upgraded my apache beam version from 2.35.0 to…
3
votes
0 answers

SchemaFactory Sonar Disable access to external entities in XML parsing - how to fix?

Sonar proposes compliant solution for SchemaFactory as follows: SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); // to be compliant, completely disable DOCTYPE…
makozaki
  • 3,772
  • 4
  • 23
  • 47
3
votes
1 answer

Hudson / Sonar report about compiler warnings

Is there a plugin to show compiler warnings in Hudson and / or Sonar?
redsofa
  • 141
  • 1
  • 5
3
votes
4 answers

Reduce Cognitive Complexity

I'm having big trouble with reducing cognitive complexity in given piece of code. Could you please give some tips on how to fix this issue? I could reduce it from 24 to 16 using switch, but it is still 16 and I have no options left protected…
GGotchaA
  • 165
  • 1
  • 1
  • 10
3
votes
2 answers

org/sonar/batch/bootstrapper/EnvironmentInformation compiled by more recent version (55), this version of Java recognises class file versions up to 52

I have installed sonar locally to run it on my java project code. My this code is using java 8. My environment variable is also set to java 8 but I have installed Java 11 on my machine and set a environment variable SONAR_JAVA_PATH in my machine…
Umair
  • 585
  • 3
  • 9
  • 21
3
votes
2 answers

How to fix SonarLint Cognitive Complexity Error for multiple If-Else conditions

I have to write a lot of conditions, but SonarLint is giving me error, asking to refactor the method to reduce its cognitive complexity. How to resolve this. I tried switch-case, but that is also giving the same error. public enum ExampleEnum { …
3
votes
1 answer

Sonar exclusions are not working which mentioned in sonar-project.properties file

I'm using GitLab CI/CD pipeline for deploying the Springboot project. I have integrated SonarQube in my project. In my sonar-project.properties file I have mentioned the sonar.coverage.exclusions. But its not excluded properly. below is my Project…
Kavi Chinna
  • 237
  • 2
  • 7
  • 18
3
votes
2 answers

File saver is deprecated. How to resolve this issue from SonarQube

Working on filesaver, while running SONAR QUBE it shows " 'fileSaver' is deprecated. use { autoBom: false } as the third argument " this.http.get(`getTemplate/${doc.id}`, { responseType: 'blob' }).subscribe( (data: any) => { …
3
votes
3 answers

SonarQube build-wrapper silently fails

I'm running the build-wrapper like so: build-wrapper-macosx-x86 --out-dir build_wrapper_output xcodebuild -project MyProject.xcodeproj -scheme All -configuration Release clean build However, when I look at the result output the json file is…
KVISH
  • 12,923
  • 17
  • 86
  • 162
3
votes
2 answers

Are these two if statements equivalent?

I am trying to reduce the function cognitive complexity required by SonarQube, I am wondering, are these two if statements equivalent? The first statement: if ( currentRef && currentRef.current && …
badm
  • 219
  • 2
  • 13
1 2 3
99
100