FAQ Database Discussion Community


PMD plugin fails after upgrading Sonarqube to 4.5.4

java,ant,sonarqube,pmd
I am upgrading my existing SonarQube 3.7.4 installation to the new LTS release 4.5.4. I'd like to reuse my ruleset and I am using the sonarqube ant task (as before) to analyze my projects. After upgrading the sonar installation and the ant task to 2.2 without changing anything else I'm...

Jenkins doesn't refactor folder names, SonarQue gives response

java,git,jenkins,sonarqube
So I am using a continous integration path (IDE -> Github -> Jenkins -> SonarQube) and I had to refactor some package names (the first character was uppercase, not as it should be) to lowercase. However, sonarqube now gets stuck on the foldernames that Jenkins uses. See, I had a...

How to update project using gradle automatically when executing sonar-runner?

android,sonarqube,android-gradle,lint,sonar-runner
I am using: Android Studio 1.2 SonarQube 5.1 ...and I want to force the project build of Android app before passing SonarQube, maybe modifying gradle configuration file. I have added the next lines to build.gradle file: apply plugin: "sonar-runner" sonarRunner { sonarProperties { property "sonar.host.url", "http://localhost:9000" property "sonar.analysis.mode", "incremental" property...

Using Jenkins plugin for SonarQube with two different installs and getting unexpected url for the new one

sonarqube,jenkins-plugins
Got two SonarQube install behind a Nginx proxy, slowly upgrading. Old 4.1 one and a new 4.5 LTS one. For the 4.1 the url returned is the public facing url in the build result. For the 4.5 the url is the internal url for the build result. The Jenkins plugin...

Is it always safe to define sonar.forceAnalysis=true for SonarQube analysis?

sonarqube,sonar-runner
When parallel SonarQube analyses are started, all but one will be rejected / fail with error: The project is already being analysed. I learned on this mailing list entry that it is possible to override this check by adding --define sonar.forceAnalysis=true to my Apache Maven command. Thus (to repeat the...

SonarQube not running on CentOS

sonarqube,virtual-machine
I'm currently trying to install sonarqube on my VM which runs CentOS. I'm just running ./sonar.sh start or ./sonar.sh console but I get the following error: Spawning intermediate process... Spawning daemon process... --> Wrapper Started as Daemon Using tick timer. server listening on port 32000. Command[0] : /usr/java/jdk1.8.0_40/bin/java Command[1] :...

Creating a custom code analysis rule for a custom grammar, and test it: howto?

java,sonarqube
Based on the minimal C parser example, and using the following dependencies: compile(group: "org.codehaus.sonar.sslr", name: "sslr", version: "1.20"); compile(group: "org.codehaus.sonar.sslr", name: "sslr-testing-harness", version: "1.20"); compile(group: "org.codehaus.sonar.sslr", name: "sslr-examples", version: "1.20"); I have created a completely useless grammar with completely useless tokens and run a completely useless main() which works fine...

Running SonarQube on internal Web Server

web-services,iis,sonarqube,sonarqube-5.0
I am trying to make Sonarqube working on a virtual machine, IP 192.168.0.150, running on a production server (Win Server 2012 R2). I need also to access it from the Internet. Thus, I created a new website in IIS on the Physical server enabling the reverse proxy and redirecting everything...

Sonar not start After Installtion

sonarqube,sonarqube-4.5
I fresh installed Sonar 4.5.1 as per http://docs.sonarqube.org/display/SONAR/Installing. But after completing the installation displays the following error: org.jruby.rack.RackInitializationException: An error has occurred, all later migrations canceled: ActiveRecord::JDBCError: Error on rename of '.\sonar\#sql-624_2f8.frm' to '.\sonar\rules_profiles.frm' (Errcode: 13 - Permission denied): ALTER TABLE `rules_profiles` DROP `used_profile` from...

Is it a bug in SonarQube's JavaScript plugin that it doesn't pick up Surefire test results of tests that are in a subdirectory?

javascript,sonarqube,surefire,sonar-runner,js-test-driver
I have a Surefire results directory with 2 files: TEST-Chrome_4202311135_Windows.dashboard.MonkeyTest.xml and TEST-Chrome_4202311135_Windows.PersonTest.xml. Thus, my tests have the following directory structure: -tests -PersonTest.js -dashboard -MonkeyTest.js When I run Sonar Runner it picks up PersonTest.js but it says that dashboard/MonkeyTest.js doesn't exist: 18:24:58.747 WARN - Test result will not be saved for...

SonarQube reports no dependencies, 0 Tangle index, for C# solution with 12K+ classes?

c#,sonarqube
We recently setup SonarQube analysis jobs for our main .Net applications, 6 of them totally 4.4 million lines of code and some 35K+ classes between them. We are getting lots of interesting information but the design analysis does not seem to be working at all. The tangle index is zero...

Sonar Equals Avoid Null Violation

java,sonarqube
Fixing sonar violations and got a warning " Equals Avoid Null: String literal expressions should be on the left side of an equals comparison." for: if (title != null && !title.equals("")) { //rest of loop } I changed it to: if(!("").equals(title) && title != null){ //rest of loop } Is...

SonarQube rules getting disabled on startup

sonarqube
I initially setup a Sonar server on my development machine but later created a server on the official Linux machine, with the intent to stop using the dev one. During this transition i may have had both servers run at the same time (pointing to the same Sonar database). Now...

SonarQube Nitpicking? - “Right curly brace and next ”else“, ”catch“ and ”finally“ keywords should be located on the same line”

java,sonarqube
I run popular Java Code Quality tool SonarQube and was observing its suggestions. I see that it reported below issue with 'Major' severity, You could see compliant and non-compliant piece of code for that rule as below, if(something) { executeTask(); } else if (somethingElse) { // **Compliant** doSomethingElse(); } else...

Naming convention rules does not seem to properly work when the default regular expression is overridden in SonarQube (Python)

python,sonarqube
Naming convention rules does not seem to properly work when the default regular expression is overridden (Python) ...

Does SonarQube count comment blocks in duplicated code?

sonarqube
Simple question. SonarQube has a duplicate code scanner. Does it examine comment blocks in this algorithm? If I have 1000 source files with the same copyright header, will it detect these as duplicated code?

Custom sonar plugin and widget, display the same sonar measure from multiple projects

widget,sonarqube,sonarqube-5.0
I have sonar 5.1 set up with multiple projects lets say project A and project B, and have ran analysis on both. I am able to import my coverage and test result files into both and every thing looks fantastic. What I would like to do is to pull the...

Can SonarQube fetch Data from a Git Repository?

git,sonarqube,bitbucket
I have a SonarQube Instance running on my Debian 7 machine, and now I want that every time I push something in my git repository (BitBucket), the SonarQube Server automatically starts the scan from my repo. Is this possible? And how? Thanks...

SONAR in Jenkins - “can't find \bin\java.exe” (2015)

jenkins,sonarqube,jenkins-plugins
For some reason Sonar can't find the java.exe. Don't have in my JAVA_HOME semicolon... ERROR: JAVA_HOME exists but does not point to a valid Java home folder. No "\bin\java.exe" file can be found there. env variable: JAVA_HOME=C:\Program Files\Java\jdk1.7.0_71 of course I have under this folder the "\bin\java.exe"... When I take...

SonarQube 5.1 Adding Custom Rule for java

java,maven,sonarqube,sonarqube-5.0
I have implemented Sonar Java Plug-in(Maven) following the example here : https://github.com/SonarSource/sonar-examples/tree/master/plugins/java-custom-rules. Copied the generated sonar-plugin in /extensions/plugins directory. Restarted the SonarQube server and ran the analysis using the mvn sonar:sonar. I can see the new Rules being added in Rules tab but no issues are being logged and also...

Can I get the projects links via the SonarQube Web Service API

sonarqube
We want to get the project links (Home, Continuous integration,...) via the SonarQube Web Service API. The links belong to the CoreProperties - https://github.com/SonarSource/sonarqube/blob/master/sonar-plugin-api/src/main/java/org/sonar/api/CoreProperties.java Is it possible to read them via the API?...

How to analyze code from other class than currently analyzed in SonarQube?

java,plugins,sonarqube
Case: I'm writing SonarQube rule that needs to check if manually created object is being closed. When it's not, issue should be raised. Let's assume that part related to determining if object is created manually (or not) is easy and not relevant. For purpose of this example it'll be...

Sonar: Create new rule for Android Lint

android,xml,xpath,sonarqube,lint
I am using SonarQube 5.1 in order to collect all Java and Lint errors for Android apps. Almost every important issue is already caught by Sonar using Lint plugin, but I have found at least one issue not included: <issue id="GradleOverrides" severity="Warning" message="This `minSdkVersion` value (`14`) is not used; it...

Configure Jenkin's SonarQube section using Job-DSL

groovy,jenkins,sonarqube,jenkins-job-dsl
Using Job-DSL we can configure a C# project in Jenkins. The SonarQube tasks is giving us a hard time. StepContext.metaClass.sonar = { -> NodeBuilder nodeBuilder = new NodeBuilder() stepNodes << nodeBuilder.'hudson.plugins.sonar.SonarRunnerBuilder' { jdk('(Inherit From Job)') usePrivateRepository(false) } } How to set the path to the sonar-project.properties config file, using the...

SonarQube P2 repository has gone forever

eclipse-plugin,sonarqube,p2
Codehaus is shutting down its services, including the Eclipse Plugin of SonarQube. Does anyone know whether there is already a replacement for the P2 repository http://dist.sonar-ide.codehaus.org/eclipse/ ? Thanks...

SonarQube 5.1 too busy due to ElasticSearch

sonarqube
I have recently migrated from SonarQube 3.7.2 to SonarQube 5.1. Update was successfull and I was able to run analysis. However now I cannot reach the server and from log it seems ElasticSearch is slowly eating away my disk space. I tried to restart the server and to delete the...

sonar ERROR Timeout trying to lock table “PROJECT_MEASURES”; SQL statement:

plugins,views,sonarqube,sonar-runner,sonarqube-5.0
I'm using SonarQube 5.1 (using default Database H2) with Gradle 2.3/4. In SonarQube, I'm using a trial version for Views portfolio management plugin which (combines SonarQube project's metrics across as a component and lets you create views like all projects under a given team, department, manager, all app projects, all...

Why sonar metrics are sometimes wrong?

c++,sonarqube,metrics,sonarqube-4.5
My sonar metrics are sometimes wrong on : number of comments number of classes number of lines number of code lines For example, when I click on the metric number of classes, I see some files with correct count number of classes, but I see some files with all metrics...

Logging error when executing Maven SonarQube plugin

maven,logging,sonarqube
I've been facing an issue with Maven SonarQube plugin (v2.6) when Maven version is recent (strictly larger than 3.1). Here is what I run: mvn clean verify -Psonar mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar -Psonar The first invocation makes sure sources are compiled and JaCoCo agent is prepared. The interesting part comes, when the...

“LintError” found processing android lint report

android,android-studio,sonarqube,lint,sonar-runner
I have generated Lint file results (generally named lint-results.xml) and configured properly android project in Android Studio to run sonar (using sonar-runner). When I execute sonar-runner I get the next errors: INFO 13:49:02.776 > 13:49:02.776 INFO - Sensor [email protected] INFO 13:49:02.832 > 13:49:02.832 INFO - Processing android lint report: C:\Code\Android\Project\app\lint-results.xml...

Sonarqube ghost projects in issues

sonarqube,sonar-runner
I am currently configuring a sonarqube instance with version of 5.1 and after several analyzes there are ghost projects appearing in issues tab on main page. Currently there is only one project that is being analyzed with same identifier and when i check database for those projects there is only...

SonarQube analysis failure after Java Plugin upgrade (3.2 -> 3.3)

java,sonarqube
Today we upgraded SonarQube Java plugin from 3.2 to 3.3 (http://docs.sonarqube.org/display/PLUG/Java+Plugin). Now the analysis end with failure: 13:59:10 [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project ingbol: SonarQube is unable to analyze file : '/var/lib/jenkins/workspace/ing_trunk_sonar/sources/cib-actions/src/main/java/com/company/cib/corpo/struts/actions/IngCcsRightsAction.java': org.sonar.java.model.expression.MethodInvocationTreeImpl cannot be cast to...

SonarQube: Get all Issues of a particular user

version-control,sonarqube
I am able to get the name of the developer who committed the culprit line when directly viewing the file, but is it possible to get all issues of a particular developer in a central location? The email address the developer uses to log in to the system is the...

Send existing LCOV file to SonarQube

javascript,testing,sonarqube,code-coverage
Because of the way my project is built, I can't use SonarQube to run coverage on my project. I have my JavaScript coverage all working with Karma and other tools. These tools output a valid LCOV file. Everything else I've found requires you to have SonarQube run the coverage and...

Technical debt on custom web rule in sonarqube 5.1

web,annotations,sonarqube,sonar-runner,sonarqube-5.0
I am facing issue in technical debt with custom web rules. I have web plugin but no technical debt is assigned to rules. I want code or annotation through which i can assign some constat/issue value to each rule and can calculate debt from that. I used following anotations while...

Sonarqube Provide link in widget description

sonarqube
I want to provide the link to my widget's documentation in the description. Right now, I put the link in the @Description annotation and it's shown as plain text. Is there a way to make the link clickable? Maybe a @Link annotation?...

Sonarqube 5.2 / Checkstyle plugin 2.3 : Enabling SummaryJavadocCheck makes the analysis failed

java,sonarqube
I recently change my SONARQUBE configuration: Before: SonarQube 5.1 Java plugin 3.0 PMD plugin 2.3 Checkstyle plugin 2.2 FindBugs plugin 3.2 Issue Assign plugin 1.6 After: SonarQube 5.1 Java plugin 3.3 PMD plugin 2.4.1 Checkstyle plugin 2.3 FindBugs plugin 3.2 Issue Assign plugin 1.6 On new configuration I have enabled...

Relationship between SonarQube Runner and SonarQube.MSBuild.Runner

tfs,msbuild,sonarqube,sonar-runner
Regarding the announcement of SonarQube integration with MSBuild and Team Build, can anyone advise on the relationship between SonarQube Runner and SonarQube.MSBuild.Runner? I'm unclear whether SonarQube.MSBuild.Runner replaces SonarQube Runner or whether it sits on top of it.

sonarqube typescript plugin: “You must install a plugin that supports the language”

typescript,sonarqube,sonar-runner
I'm trying to setup SonarQube to analyse my TypeScript project using this plugin: https://github.com/Pablissimo/SonarTsPlugin However, I'm encountering an error like: > C:\sonarqube\sonar-runner-2.4\bin\sonar-runner.bat ... INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 3.006s Final Memory: 18M/613M INFO: ------------------------------------------------------------------------ ERROR:...

Scanning Ruby on Rails Projects with SonarQube

ruby-on-rails,ruby,ruby-on-rails-4,sonarqube
I want to check my ruby on Rails app with sonarqube. I've added the Web plugin which should run with ruby now I got this error during sonarqube exectution? whats going wrong? app/controllers/course_statistics_controller.rb java.lang.NullPointerException: null at org.sonar.plugins.web.checks.sonar.UnsupportedTagsInHtml5Check.isUnsupportedTag(UnsupportedTagsInHtml5Check.java:77) ~[na:na] at org.sonar.plugins.web.checks.sonar.UnsupportedTagsInHtml5Check.startElement(UnsupportedTagsInHtml5Check.java:71) ~[na:na] at...

Sonarqube 5.1 TFS sonar msbuild runner with branches

visual-studio-2013,tfs,sonarqube
We have just started using Sonarqube 5.1 integrated in TFS build as described on this page http://www.sonarqube.org/announcing-sonarqube-integration-with-msbuild-and-team-build/ We have one main branch, and two development branches for the same project. What is the recommended strategy for handling this? I want to be able to see analyze result trends over time...

Upgrade H2 from sonarqube 4.5.1 to 5.1.1

sonarqube,upgrade,h2
Today I have installed Sonarqube 5.1.1. Not having a lot of data/projects I'm using the H2 db embedded in Sonarqube. Following the steps in the Upgrading page of the Sonarqube documentation I have the process up and running but without any data. Copying the \data\es folder from the old installation...

SonarQube - Temp directory is not writable

sonarqube,sonarqube-5.0
I'm installing SonarQube v5.0.1. I'm running Windows Server 2012 64-bit, Java 1.8 64-bit, and the SonarQube windows-x86-64 wrapper. SonarQube keeps throwing the following error: WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\ java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\ at...

Sonar test coverage does not include indirect classes

java,sonarqube
If I have the below classes (A and B) which are each in a separate module and I create a test for A.doSomething(), Sonar will complain about 0% coverage on B.doSomething() although it is being testing indirectly in TestA. Using Ecclema coverage plugin for eclipse, I can see B.doSomething() is...

SonarQube doesn't show any issues with Maven project

java,maven,sonarqube
I was using Sonar two weeks ago and It worked fine. Now, when I run sonar, without having changed the project, it shows me 0 issues, 0% technical debt, etc .. ( 20-30 issues were found two weeks ago and the project didn't have changed) This is the result of...

max_allowed_packet, I don't have MySQL

mysql,sonarqube,sonarqube-5.0
I'm trying to run sonar-runner.bat, when it almost finished analyzing, it's written max_allowed_packet more than something something. So it fails. Through deep search, everyone said that i should configer my.ini file inside MySQL folder. But, I don't have MySQL Installed. Log: Error: unable to execute sonar error: caused by: unable...

Single Jenkins instance using multiple Sonar instances

java,jenkins,sonarqube
Is it possible to configure Jenkins to use multiple Sonar instances? Currently we are using one Sonar instance for legacy projects (Java 6) and a new Sonar instance for Java 8...

SonarQube Lombok Getter recognition

sonarqube,lombok,sonarqube-4.5
I am using SonarQube 4.5.4 with java plugin 3.1. As I know this sonar-java version supports lombok partially (Getter and Setter annotations) starting from 2.8 (http://jira.codehaus.org/browse/SONARJAVA-73). But in my case it still reports field with lombok.Getter as squid:S1068 Unused private fields should be removed: @Getter private String userName; Do you...

Is it possible to see per commit impact in Sonar?

git,continuous-integration,sonarqube,code-quality
I need to see history of commits and how those impacted sonar metrics. Using git. So far I found only SCM stats plugin which doesn't show much. EDIT: I'm looking for a plugin or functionality that will give me a batch impact history, so say I perform Sonar analysis twice,...

SonarQube 5.1 analysis fail with StackOverflowError

java,maven,sonarqube,sonarqube-5.0
I recently upgraded to the newest SonarQube 5.1, but now, my maven builds have begun failing and I'm unable to determine what file is causing the error. The maven project is a multi module project. SonarQube version 5.1 maven goal executed with "mvn sonar:sonar" (version 2.6 is used and the...

Sonar false overall coverage (jacoco)

java,sonarqube,jacoco
I'm running Jacoco and Sonar on multimodule Java8 project. I have unit tests in each of the modules and to save resources I collect all 'integration tests' into one "integration-tests-runner" and run them all there (wrapping them with before and after tests). When measuring coverage UT generates exec file per...

“IllegalArgumentException” in SonarQube Community plugin

android,android-studio,sonarqube,sonar-runner
Recently, when I try to analyze code in Android Studio (Analyze > Inspect Code) I always obtain this error: 11:35:28 IllegalArgumentException: Argument for @NotNull parameter 'sonarServerName' of org/intellij/sonar/persistence/SonarServers.get must not be null In other projects it works fine. When IllegalArgumentException link is clicked, this screen is shown: Obviously, I don't...

sonar maven analysis only picks .java file

maven,groovy,sonarqube,sonarqube-5.0
I am trying to run a sonar maven analysis on my multilanguage project which contains many languages like *.java, *.groovy, *.js etc. I have installed all the languages plugin in my sonar and configured my pom sonar.sources parameter as src/main,src/test but still it picks up only java files. In the...

SonarQube 5.1 PAM - no jpam in java.library.path

sonarqube,pam,nativelibrary
I'm unable to use PAM plugin on SonarQube 5.1 on Debian 8 (64bit). I did setup according to https://github.com/SonarCommunity/sonar-pam and still getting following error during login: Java::JavaLang::UnsatisfiedLinkError (no jpam in java.library.path): java.lang.ClassLoader.loadLibrary(ClassLoader.java:1886) java.lang.Runtime.loadLibrary0(Runtime.java:849) java.lang.System.loadLibrary(System.java:1088) net.sf.jpam.Pam.<clinit>(Pam.java:51) org.sonar.plugins.pam.PamConfiguration.newInstance(PamConfiguration.java:61)...

Custom roslyn-based inspections in Sonarqube

.net,sonarqube,roslyn
I want to make custom inspections for Sonarqube using the new roslyn based code analyser. Is that possible?

How do I set task properties in a Gradle Plugin

gradle,sonarqube,sonar-runner,gradle-custom-plugin
I am creating a gradle plugin to apply the sonar-runner plugin and default many of the values such as the sonar host URL and the sonar JDBC URL. I cannot figure out how to set the properties though. When I set this up in build.gradle I use: apply plugin: 'sonar-runner'...

How can I integrate ReSharper's Dotsettings File in SonarQube?

c#,resharper,sonarqube,bamboo,stylecop
I have a C# Project with a ReSharper Dotsettings file. I want to configure Sonar so that it uses my Dotsettings file. In my Dottsettings file i disabled many Rules. How can I integrate this file in SonarQube? This is my sonar-project.properties file (just the ReShaper part): #ReSharper sonar.resharper.mode= sonar.resharper.dotSettings.path=MyProject/ReSharper7-Coding-Style.dotsettings...

integration coverage results not shown in sonar

maven,jenkins,sonarqube,jacoco,surefire
I am trying to get integration test statistics in my sonar instance. After a lot of searching I still haven't found out what I am doing wrong. I use profiles to skip (IT) tests and that seems to work for me. In jenkins I have got my goals for my...

Analysis fails on SonarQube 4.1 with java.sql.SQLException but succeeds on 4.5

sonarqube,sonarqube-4.0
Running sonar-runner on a sonar-example project against my SonarQube 4.1 instance fails. In the stack trace, I noticed that it gives the following error: Caused by: java.sql.SQLException: Access denied for user 'sonar'@'172.23.48.129' That ip is my local machines IP. My SonarQube server is on a different box. My sonar-runner.properties and...

Analyze Maven pom with SonarQube

maven,sonarqube
Can I analyze pom files correctness using Sonar? (like the maven enforcer plugin rules)

SonarQube LDAP authentication is not working

authentication,ldap,authorization,sonarqube
Presently, connecting to Apache Directory Server 2.0 from SonarQube 5.0.1. Have given the following entries in sonar.properties file: # LDAP configuration # General Configuration sonar.security.realm=LDAP sonar.security.savePassword=false ldap.url=ldap://10.53.67.11:30389 # User Configuration ldap.user.baseDn=o=TechMahindra ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login})) ldap.user.realNameAttribute=cn ldap.user.emailAttribute=mail # Group Configuration...

JaCoCo SonarQube incompatible version 1007

sonarqube,jacoco
I'm using SonarQube for code quality control and suddenly builds that would otherwise pass can't be analyzed and fails. [INFO] [00:00:03.630] Analysing /mySuperProject/target/jacoco.exec -> java.io.IOException: Incompatible version 1007 When I invoke maven build with debug switch, this cause is revealed Caused by: java.io.IOException: Incompatible version 1007. at org.jacoco.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:127) at org.jacoco.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:107)...

Upgrade SonarQube issues

service,jenkins,webserver,sonarqube,sonarqube-5.0
I'm having issues installing my instance of SonarQube 4.4 to 5.1. The instructions say to stop the SonarQube server, match up a couple files (back up DB, copy plugins, etc.), and then restart the sonar server for the updated version. My problem is I'm not sure how to start/stop the...

SonarQube Quality Gates: TODO comments

jenkins,sonarqube
Using SonarQube's Quality Gates, is there a possibility to count the number of TODO comments in the code so that I can make the Jenkins build fail when there are too many TODOs?

How to exclude a directory from the code analysis?

sonarqube,code-analysis
There have been some questions about this, but none of them solves my problem. I use SonarQube to do code analysis on one of my projects, which contain a Migrations directory. I would like to exclude all the source files in that directory from the code analysis. In the projects...

When a rule parameter is set to an erroneous value, there's no error message when you click on “Activate”

sonarqube
On SonarQube 5.1, when a rule parameter is set to an erroneous value, there's no error message when you click on "Activate" and the rule does not get activated.

SonarRunner: Unable to find file warning

android,android-studio,sonarqube,lint,sonar-runner
I have configured an Android sample app project in order to detect Lint errors and include them into SonarQube server. Everything works fine but when I explicitly introduce an error in AndroidManifest.xml (deleting the allowBackup line), the sonar-runner execution shows the next warning: 16:33:57.681 WARN - Unable to find file...

Failed sonar migration because table already exists

sonarqube
I am trying to upgrade Sonarqube from 3.7.4 to 4.5.4 I've updated all the plugins and the new application starts as expected. I then go to the /setup URL where I am prompted to start the DB migration. This fails with the following error: ActiveRecord::JDBCError: Table 'rule_tags' already exists: I've...

“Fail to execute ES search request” popup alert in SonarQube web UI after upgrading from 4.5.1 to 5.1

configuration,sonarqube
when I click on an issue in SonarQube web UI to see details, I get this red popup: Fail to execute ES search request '{"size":1000,"query":{"bool":{"must":[{"term":{"fileUuid":"9c1ae181-f5c3-47da-8fad-3716aca54b6d"}},{"range":{"line":{"from":1,"to":1000,"include_lower":true,"include_upper":true}}}]}},"sort":[{"line":{"order":"asc"}}]}' on indices '[sourcelines]' on types '[sourceline]' and the source code or issue details are not shown. we started getting this after upgrading from Sonar 4.5.1...

Sonarqube Javascript rule “Function names should comply with a naming convention” doesn't work with functions declared in variables

javascript,sonarqube
I started using Sonarqube a few days ago, but I have a question about the Javascript rule "Function names should comply with a naming convention". Some of my developers do not respect naming conventions for naming functions, most of time they define functions like this: onTextfieldChange1111111: function(field, newValue, oldValue, eOpts)...

(Java) if statement optimization

java,rest,annotations,jax-rs,sonarqube
Need to optimize this code : import java.lang.annotation.Annotation; import java.lang.reflect.Method; import javax.ws.rs.CookieParam; import javax.ws.rs.FormParam; import javax.ws.rs.HeaderParam; import javax.ws.rs.MatrixParam; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; ... private String valueParam(Annotation a) { String value = ""; if (a.annotationType() == QueryParam.class) { value = ((QueryParam) a).value(); } else if (a.annotationType() == PathParam.class) {...

SonarQube 5.0.1 - Error declaring a false-positive issue

sonarqube,sonarqube-5.0,false-positive
I've a "Failed" message displayed when I declare a "false-positive" issue from the Web UI of Sonarqube (5.0.1). A 400 error is returned with this response : "Transition from state RESOLVED does not exist: falsepositive" But the issue is declared "unresolved" in the web ui (both on global issues and...

Sonarqube can't resolve issue

sonarqube,sonarqube-5.0
I'm using SonarQube 5.1 to analyse a C#/Typescript project. All is working fine, except the issues seem to do what they want. First, I have a much higher number of issues (4000) in the issue search, while the dashboard shows 1700 issues. Furthermore, I can't close many issues, I get...

Sonar successful authentication without password

ldap,sonarqube
I'm working on LDAP authentication support for Sonar. Users can authenticate using Blank password (No password) Or Correct password. If a wrong password entered, authentication fails. Sonar should not allow any login with a blank password even when this authentication depends on an external system like LDAP, could you help...

Sonarqube Eclipse plugin not working in incremental analysis mode

sonarqube,sonarqube5.1
I have installed sonareclipse plugin 3.4 in eclipse Juno version. I have set sonar.analysis.mode=incremental in preview analysis properties. But when I analyze the project in eclipse it shows all the issues and not just new issues. SonarQube server version is 5.1. Can you please help me here?...

Categorize measures in SonarQube

sonarqube,measures
I want to categorize specific metrics I have in SonarQube to fit my needs. In detail: I built a Gatling Plugin for SonarQube that reads the stats which Gatling writes and puts them into SonarQube Metrics. Now I want to categorize my measures according to the requests I did with...

sonar-maven-plugin 5.1.1 not found

maven,sonarqube
I've just installed the latest version of SonarQube (5.1.1) and when I try to run the sonar:sonar target, I get an error: Embedded error: Unable to build project for plugin 'org.codehaus.sonar:sonar-maven-plugin': POM 'org.codehaus.sonar:sonar-maven-plugin' not found in repository: Unable to download the artifact from any repository org.codehaus.sonar:sonar-maven-plugin:pom:5.1.1 I've checked here: http://mvnrepository.com/artifact/org.codehaus.sonar/sonar-maven-plugin...

SonarRunner Unrecognized option: views

plugins,jenkins,sonarqube,sonar-runner
We are running an "Invoke Standalone SonarQube Analysis" build step on Jenkins with following configurations: Target: views JDK: (Inherited from Job) sonar-runner-2.4 General infos: SonarQube Version: 4.3 Jenkins Version: 1.606 SonarQube Plugin (in Jenkins): 2.2 Until a few days ago everything works fine, but since then the build is always...

SonarQube catch 22 with serializable lists

java,sonarqube
At first I had a class along the lines of: public class MyClass implements Serializable { private List<Role> roles; } SonarQube pointed out that List, a member of a serializable class, is not serializable itself. Fair enough, I'll switch to a serializable implementation of List like ArrayList. public class MyClass...

How can analyze single file in sonar eclipse plugin?

eclipse,eclipse-plugin,sonarqube
posible do that in sonar eclipse plugin? currently I see only can analyze project. Thanks,...

How to execute Unit Test with Sonar Qube 5.0.1

unit-testing,sonarqube,code-coverage,gallio,opencover
I was able to execute Unit test with lower version of Sonarqube but then i upgraded to SonarQube 5.0.1. Then suddenly my Gallio was not working. I found in some blocks that support for gallio was not available in sonarqube 5.0.1 Is there any other way to run unit test...

SonarQube - How to change severity of mulitple rules in bulk

sonarqube
I want to change the severity of mulitple rules in a quality profile in bulk. At the moment there are ca. 20 rules with "Blocker" severity and I want to set them all to "Critical". Because we created a new quality gate for blocker rule violations and this rules should...

How to specify SonarQube rule description as a markdown/html resource file instead of using annotation?

plugins,sonarqube
I have my custom rule, let's say with AEM-1 key. So, as it is done here, I make my AEM-1.html resource file with some simple html content and it does not get's picked up by SonarQube 5.1. It refuses to start, because no description is provided for the rule. I...

Working with SonarQube rules

sonarqube
I am new to SonarQube and using SonarQube 5.1. I read from somewhere that it is a replacement for FindBugs and CheckStyle. So does it mean it internally runs FindBugs and CheckStyle? But I counldn't find any FindBugs and CheckStyle plugins inbuilt. From where does Sonar take the rules?

SonarQube web server goes down after three days

timeout,webserver,sonarqube,offline
Installation: SonarQube 5.0 MySql-5.6.23 My question is about SonarQube web server: When the SonarQube web server isn't used for more than three days and I try to reach my SonarQube web server after this time, I get the error message: "We're sorry, but something went wrong. Please try back in...

Pass sonar's PT_RELATIVE_PATH_TRAVERSAL in java

java,sonarqube,path-traversal
I've got two issues sonar is sad about. First one in a line of code with relative path traversal issue which looks like this: File f = new File(MY_DIR + filename); Where filename is a parameter I've got from a request. The second line is about an absolute path traversal...

Unable to delete the persistit_tempvol file after Executing sonar Embedded Runner from Java

java,out-of-memory,sonarqube,sonar-runner
I have a set of project's on which I need to execute Sonar. Once I execute sonar task and it publishes the result it deletes all the files in the directory .sonartemp except the file persistit_tempvol. This file is locked by Java SE runtime and I am unable to delete...

Multiple inheritance for Quality Profiles

sonarqube
I see a need for multiple inheritance for Quality Profiles to avoid unnecessary manual work when we upgrade. For example we would like to inherit all rules from "Sonar Way" and from "Android Lint" and restore the built-in profiles after each upgrade, making sure we are always up to date....

SonarQube analysis reports error “Unable to parse file” for all Python3 source files

maven,python-3.x,sonarqube
Some background: I am using a tiny / dummy pom.xml to facilitate SonarQube analysis for Python3 source code. All Python3 source files are triggering this SonarQube error... Sample error message (with the entire source code of the file): [ERROR] [23:13:30.135] Unable to parse file: /home/kca/saveme2/git/kevinarpe-rambutan3/rambutan3/RTestUtil.py [ERROR] [23:13:30.135] Parse error at...

SonarQube - Unable to load the Wrapper's native library 'wrapper.dll'

sonarqube,sonarqube-5.0
I'm installing SonarQube v5.0. I'm running Windows Server 2012 64-bit (a virtual OS), Java 1.8 64-bit, and the SonarQube windows-x86-64 wrapper. SonarQube, whether run via StartSonar.bat using Command Prompt as Administrator or as a Windows Service, keeps throwing the following warning: WARNING - Unable to load the Wrapper's native library...

How to restrict access to dashboards by user/group permissions?

sonarqube
We develop software for different customers and use a single instance sonarqube. We have created one dashboard per customer which contains all its projects. Up to now just our developers used the system and everything was fine. Now we would like to give our customers access to sonarqube so they...

Sonar fails to connect to mysql, running from gradle

android,gradle,sonarqube,sonar-runner
I have a sonar configuration that looks like this: sonar.jdbc.username=sonar sonar.jdbc.password=sonar sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncod$ sonar.jdbc.driverClassName=com.mysql.jdbc.Driver sonar.jdbc.validationQuery=select 1 sonar.web.host=127.0.0.1 sonar.web.context=/sonar sonar.web.port=9000 And when running this from my gradle script, which looks like this: sonarProperties { property "sonar.projectKey", "sonar-example" property "sonar.projectName", "sonar example" property...

TFS with SonarQube, no product projects, only test projects

sonarqube,tfsbuild,tfs2013
I have installed SonarQube on my local development machine by following installation guide: SonarQube Installation Guide for Existing TFS Environment.pdf. The build is succesfull. The project is added to the dashboard. But there was only testcoverage data. I have 4 projects in my solution, 2 of them are unittest projects....

How to reuse fxcop.xml in SonarQube

jenkins,sonarqube,fxcop
We have FxCop analysis being run by Nant/Jenkins. A SonarQube C# analysis is then triggered, and executed successfully. We'd like to reuse fxcop.xml result file from Jenkins for Sonar's analysis. We tried this configuration with no luck: sonar.fxcop.mode=reuseReport sonar.fxcop.reportsPaths=fxcop.xml SonarQube is asking for path to FxCopCmd.exe. If specified, Sonar is...

SonarQube: Issues for one project are not displayed

sonarqube
In my SonarQube installation for one project the issues overview can't be displayed, it always shows "Still working..." at the top. See http://didge.my-wan.de/sonar/component_issues/index?id=net.troja.eve%3Aproducersaid When I navigate to the files directly I can see all the issues! Only the overview doesn't work. Any suggestions? PS: I change to logging to debug,...

CssSquidSensor and JavaScriptSquidSensor both fail with parse errors when Byte Order Marks are present

javascript,c#,css,.net,sonarqube
We are attempting to analyze our .Net projects with SonarQube. These projects contain both CSS and JavaScript in addition to C#. I think we have our projects configured correctly, both the CssSquidSensor and the JavaScriptSquidSensor execute for each project but they fail to parse our css and js files due...

Sonar Runner default logging level

sonarqube
Is it possible to change the default logging level of a sonar runner from INFO to WARN or similar? Our nightly SonarQube analysis is blowing the Team City logs out with huge amounts of entries. According to the source, the logging is standard slf4j but when i've tried to reconfigure...

How to add static member variables Jacoco Test Coverage?

java,sonarqube,jacoco,jacoco-maven-plugin
I have a class as following: public class XConstants { public static final int A_TYPE = 1; public static final int B_TYPE = 2; } I am using both variables in my tests but when I examine the test coverage with Jacoco it shows %0 test coverage for this class....

Build failure due to Sonar plugin

service,jenkins,sonarqube,sonarqube5.1
My build keeps failing on Jenkins because of this error: ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at...

Is there a way to simplify this maven command for sonar?

maven,sonarqube
I'm running the following sonar command with maven: mvn clean compile sonar:sonar I'd like to just run: mvn sonar:sonar (ie have the sonar task trigger the clean and compile steps) Is there a way to express this as a dependency in maven?...