LOGIN
Sign In or Register
Avatar
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Username
Password
Remember me

SonarQube Frequently asked questions (FAQ)

SonarQube Frequently asked questions (FAQ)

 
Is SonarQube Replacement for Checkstyle, PMD, FindBugs?
--------------------------------------------------------------
Answers - YES and NO

 
Why Yes?
Sonar will run CheckStyle, FindBugs and PMD, as well as a few other "plugins" such as Cobertura (code coverage) by default for Java projects. The main added value, however, is that it stores the history in a database. You can then see the trend. Are you improving the code base or are you doing the opposite? Only a tool with memory can tell you that.
 
Why No?
SonarQube is currently on the way to deprecate PMD, Checkstyle and Findbugs and use their own technology to analyze Java code (called SonarJava). They do it, because they don't want to spend their time fixing, upgrading (or waiting on it) those libraries (e.g. for Java 8), which for example uses outdated libraries. Well at least since SonarQube 6.3+ it seems to be that Findbugs is (at the moment) no longer supported as a plugin.
 
What is the SonarQube Plugins available which can be integrated with Eclipse, IntelliJ IDEA, Visual Studio, Visual Studio Code, and Atom?
--------------------------------------------------------------
Answer - 
SonarLint is an extension to your favorite IDE that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.
Reference
http://www.sonarlint.org/index.html
 
Where i can get the Support related to SonarQube?
--------------------------------------------------------------
Google Grops
https://groups.google.com/forum/#!forum/sonarqube
 
Facebook Groups
https://www.facebook.com/groups/devopsindia
 
Linkedin Groups
https://www.linkedin.com/groups/6727934
 
Public Forum
https://stackoverflow.com/questions/tagged/sonarqube
 
Top 10 Lessons Learned from 2 Years Work with Codehaus Sonar
--------------------------------------------------------------
http://www.sw-engineering-candies.com/blog-1/top-10-lessons-learned-from-2-years-work-with-codehaus-sonar-open-source-quality-management-platform
 
 
Configure Sonar to exclude files from Maven pom.xml
--------------------------------------------------------------

http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreFiles
https://docs.sonarqube.org/display/SONAR/Analysis+Parameters#AnalysisParameters-Exclusions/Inclusions
https://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus#NarrowingtheFocus-IgnoreCodeCoverage
https://docs.sonarqube.org/display/SONAR/Analysis+Parameters#AnalysisParameters-Exclusions/Inclusions
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner+for+Maven#AnalyzingwithSonarQubeScannerforMaven-ExcludingamodulefromSonarQubeanalysis
 
Does Sonar support multiple language in same project ex. sonar.language=java,grvy?
--------------------------------------------------------------
Starting with SonarQube 4.2, multi-language projects are supported.
 
This automatically happens when sonar.language is not set.
See sample project here: https://github.com/bellingard/multi-language-project
 
 
How to exclude the directory in SonarQube?
--------------------------------------------------------------
try something like this:
sonar.exclusions=src/java/test/**
sonar.exclusions=system/**, test/**, application/third_party/**, application/logs/**

How to Increase SonarQube Heap Size?
--------------------------------------------------------------
Whenever you get a issues like "SonarQube analysis failed java.lang.OutOfMemoryError: Java heap space", you may following options to follow.
 
Option 1 - Reduce the analyze scope by either reducing the project size(split your project in smaller sub projects/modules) or reducing the set of rules that are analyzed.
 
Option 2 – Increase the memory size that can be consumed by the JVM.  This can be done by adding the following Environment Variable:
SONAR_RUNNER_OPTS="-Xmx3062m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m"
 
e.g Linux
> export SONAR_SCANNER_OPTS="-Xmx3062m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m"
e.g Windows
> set SONAR_SCANNER_OPTS="-Xmx3062m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=128m"
 
Reference
https://docs.sonarqube.org/display/SONAR/Hardware+Recommendations
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
Rate this item
(1 Vote)
Rajesh Kumar

.

Total, Over 12 years of extensive experience in the Software Configuration Management domain having depth knowledge of DevOps, Continuous Integration and Delivery, Configuration Management, Build and Installer, Release Management and Application Management.