I can't reproduce this problem. The only idea is that you have put by mistake a whitespace in the beginning of regular expression " ^[A-Z]...".
ruby-on-rails,ruby,ruby-on-rails-4,sonarqube
SonarQube has dropped support for Ruby. If you want to supply code styles check for your application, you take a look into following links: Ruby Style Guide. RuboCop - Ruby static code analyzer. Out of the box it will enforce many of the guidelines outlined in the community rails-style-guide. Very...
javascript,testing,sonarqube,code-coverage
Not sure to understand the question, but if it is how to feed SonarQube with the LCOV report, so you just need to provide the path - absolute or relative to the project base directory - to the LCOV report via the project property "sonar.javascript.lcov.reportPath". See http://docs.sonarqube.org/display/PLUG/JavaScript+Plugin "Code Coverage" paragraph....
The warning is telling you that it's not sure that title won't be null. A literal, however, such as your empty string, can never be null by definition. And since equals can handle null as an argument you're avoiding a potential NullPointerException by writing <literal>.equals(<somebject>). If you're not using title...
This property is deprecated since SonarQube 3.5 and no longer necessary. See http://docs.sonarqube.org/display/SONAR/Frequently+Asked+Questions#FrequentlyAskedQuestions-Failedtoanalyseaprojectasanotheranalysisonthesameprojectseemstoberunningatthesametime(SonarQube3.4only)
As already mentioned, this is due to a break in JaCoCo maven plugin code. You can (temporarily) specify the version in your jenkins maven command like: clean org.jacoco:jacoco-maven-plugin:<version>:prepare-agent install e.g. clean org.jacoco:jacoco-maven-plugin:0.7.4.201502262128:prepare-agent install This was the workaround that helped us. But like most people, I'm still waiting for the fix...
If these are showing up on issues tab only, it seems like an issue with indexing, somehow the search index seems to be corrupted. You can try to delete the ES index and see if it fixes the issue for you. The ES index is stored in <sonar-install-dir>/data/es folder.
This particular Sonarqube rule uses a regular expression to check the function name. By default it uses this expression: ^[a-z][a-zA-Z0-9]*$ The function name in your question matches this regular expression. If you want to check other things, you can alter the default regular expression yourself. (You probably have to log...
This is a common problem on case-sensitive filesystems. Rename the folder to something else, commit that, then rename it to what you want. e.g DataStorageLayer -> dataStorageLayer0tmp -> dataStorageLayer You should be able to do this now, even after the existing failed renaming. By the way, if these are java...
visual-studio-2013,tfs,sonarqube
Indeed Wangen, I do confirm that the MSBuild Runner 0.9 doesn't yet provide a way to inject some SonarQube properties and so including the "sonar.branch" property. This limitation is going to be dropped in version 1.0 of the MSBuild Runner. Nevertheless, you must be aware that the support of branches...
The naming convention is org/sonar/l10n/{plugin key}_{language}/rules/{repository key}/{rule key}.html. It was documented in http://docs.sonarqube.org/display/DEV/Internationalization at the time rule descriptions supported localization. That's not the case anymore since version 4.2, but these HTML bundles are still supported. The correct way since version 4.3 is to use the low-level API org.sonar.api.server.rule.RulesDefinition. It allows...
eclipse,eclipse-plugin,sonarqube
It's the other way round. Instead of specifying which file to analyse, you can exclude unwanted files/folders using various configurations available in SonarQube. Details available here: http://docs.sonarqube.org/display/SONAR/Analysis+Parameters...
jenkins,sonarqube,jenkins-plugins
At the job configuration level do you have the option of multiple JDK's? If it's set to default, change it to JDK7
The table rule_tags is created in version 4.2. So if it's still present when restoring your mysql backup, that means that you restored only data but not structure. Double check your command-line to restore mysql schema.
maven,groovy,sonarqube,sonarqube-5.0
Since it was a multi module project, I had to include the properties sonar.sources and sonar.tests in all the module's pom.xml file. <properties> <sonar.sources>src/main</sonar.sources> <sonar.tests>src/test</sonar.tests> </properties> ...
From the SonarQube documentation on duplications: SonarQube allows to detect "Type 2" duplications which means : structurally/syntactically identical fragments except for variations in literals and comments. So your copyright header will not be counted as duplication....
timeout,webserver,sonarqube,offline
I found my mistake: I start MySQL and SonarQube as a service with the task scheduler every time I restart my computer. Under "Settings" is one default setting called "Stop the task if it runs longer than: 3days". I disabled this option. Consequently the services should run all the time...
Not all applications use JAVA_HOME variable, so you can have JAVA_HOME pointing on your 64 bits version while you are using a 32 bits. Note: the 'Java_Home' key in the registry is not the JAVA_HOME variable. Well, one way to be sure is to uninstall the current service, with ..\windows-x86-64\UninstallNTService.bat...
It seems that the ElasticSearch index of issues is out of sync. This should be fixed by stopping the server, removing the $SQ_HOME/data/es folder and restarting the server.
Very probably the user account cofigured in sonar.properties has not eanugh rights to alter database schema. Try with another user or grant sonar more rights. GRANT ALL ON *.* TO 'sonar'@'%'; ...
This is not possible yet. But with the UI refactoring that is currently done on 5.2, this is likely that such a WS will be developed.
widget,sonarqube,sonarqube-5.0
Do you really want to create a custom plugin for this? You can display metrics over multiple projects with SonarQube widgets. Create a new Measure Filter Select components "Projects" Click on "Change columns" Select the metrics you want to see (in your case lines_covered) and click on "Close" Save the...
According to this thread sonar.fxcop.mode is no longer supported. Quoted from the thread: You can skip the execution of FxCop on a specific project by using another Quality Profile for it, that does not contain any FxCop rule. Indeed, it is important for the evolution of a project's technical debt...
I found the solution of this problem, i changed the version of the plugin LDAP to sonar-ldap-plugin-1.4 and the authentication was worked correctly.
In both cases the Jenkins plugin is using the URL that is printed at the end of analysis logs. Have you properly defined "sonar.core.serverBaseURL" in SQ Server settings?
The Java plugin is not installed. You probably forgot to copy the directory extensions/plugins when upgrading to 5.1.1.
I confirm the problem, jira ticket has been created. Thanks!
Short answer is NO Refer: Reduce log level in Sonar 2.1.x But other than this if you see logging of other sonar plugins you might, may have log level set to WARN....
android,gradle,sonarqube,sonar-runner
The (most important) property sonar.jdbc.url is missing in the sonarProperties section of your Gradle script, so no wonder why it is trying to connect to H2 (which is the default value for this property).
groovy,jenkins,sonarqube,jenkins-job-dsl
In SonarRunnerBuilder class there is a project attibute that represent the path to a file with properties for project. In the same way which you set the JDK (jdk('(Inherit From Job)')) you can set properties path. In your example, try like this: StepContext.metaClass.sonar = { -> NodeBuilder nodeBuilder = new...
I do confirm that this is not possible to bulk change the severity of a set of rules activated in a Quality Profile (whereas this is possible to bulk change the severity of a set of issues). Even if this might be useful from time to time, there is no...
This is currently not possible. But we have an open ticket about such an improvement => http://jira.sonarsource.com/browse/SONAR-5674
java,maven,sonarqube,sonarqube-5.0
Problem solved. I ended up setting up a local instance and running the maven plugin using a debugger, this allowed me to set a breakpoint at the exception. I turned out that we had a test case (file) which had a field defined by hundreds of Strings. This file has...
I found the problem and the solution. From Sonar website I see this: By default, when no coverage report is found, the JaCoCo plugin will not set any value for coverage metric. This behaviour can be overriden to force coverage to 0% in case of a lack of report by...
java,rest,annotations,jax-rs,sonarqube
If reflection is an option, you can always do something like public class Test { @PathParam("path") public Response doSomething() { return null; } public static void main(String[] args) throws Exception { Method method = Test.class.getMethod("doSomething"); Annotation annotation = method.getAnnotations()[0]; System.out.println(getValue(annotation)); } private static String getValue(Annotation annotation) throws Exception { Class<?>...
plugins,jenkins,sonarqube,sonar-runner
The reason for the problem is still unkown, but after re-installing the SonarQube plugin on Jenkins everything went back to normal. (Down-graded the plugin and updated it afterwards)
android,android-studio,sonarqube,sonar-runner
You should configure a SonarQube server to use as per the README from the plugin repository: After the installation, you first of all need to configure the connection to your Sonar server. This is done per project and/ or module. You can use a remote server or a local one...
Your server does not have enough available disk space to feed its internal Elasticsearch indices. Note that an external volume can be used by setting the property sonar.path.data (see conf/sonar.properties).
even if I do understand that this might be misleading, not having any information about dependencies/librairies/design on C# projects is expected. FYI, in SQ 5.2, all those pages and relating metrics will be dropped, see the following Jira ticket: http://jira.sonarsource.com/browse/SONAR-6553.
c++,sonarqube,metrics,sonarqube-4.5
With an isolation of the specific problematic files, I found parsing errors : com.sonar.sslr.api.RecognitionException: Parse error at line 123 column 0 failed to match all of: parametersAndQualifiers virtSpecifier ctorInitializer compoundStatement functionTryBlock parametersAndQualifiers bracedInitList It appears sonar does not support some boost instructions like this one : BOOST_CLASS_VERSION(MyClass, 0) So next...
javascript,sonarqube,surefire,sonar-runner,js-test-driver
Well, I've delved into the SonarQube's JavaScript Plugin code to debug it. Found the bug. Looks like this bug only happens on Windows. What the code does is iterates over all the test files, in my case "PersonTest.js" and "dashboard/MonkeyTest.js", and looks for the file "dashboard\MonkeyTest.js". But because "dashboard/MonkeyTest.js" does...
Short answer is : with the currently available API you can't solve your third case. Now for the more detailed answer : How does sonarqube java plugin runs its analysis for now : it works source file (aka CompilationUnit) by source file and read bytecode for symbols out of this...
c#,resharper,sonarqube,bamboo,stylecop
You cannot use an existing .DotSettings file with SonarQube's R# plugin at the moment. This feature however will be added in the upcoming release of the R# plugin, refer to http://jira.sonarsource.com/browse/SONARRSHPR-15 for details. Note: The re-use reports mode was already supported in the past (with the C# plugin version 2.x),...
service,jenkins,webserver,sonarqube,sonarqube-5.0
On Windows, the scripts are indeed different: if you haven't installed SonarQube as a service, you should read "Running SonarQube as a Service on Windows" to know how to start and stop if not, then: to start SonarQube, you have to execute the "StartSonar.bat" script: this will open a Command...
The sonar-maven-plugin is an independent project that does not follow SonarQube versioning. Correct command-line is mvn org.codehaus.mojo:sonar-maven-plugin:2.6:sonar The groupId mvn.codehaus.sonar is for internal use....
android,android-studio,sonarqube,lint,sonar-runner
This warning is shown because the xml file is not indexed by the platform. As a consequence the android lint plugin tries to report your issue but the file cannot be found on the server side. This is a current limitation of the platform that should be addressed very soon....
That's due to a bug in the plugin's parser: for the parameter list of a function declaration, it only recognizes Python 2.x syntaxes. I created the following ticket to fix it in the next version: http://jira.sonarsource.com/browse/SONARPY-122...
I'd print the java.library.path variable. The only thing I can think of is that the jpam lib is in the wrong place or there is an issue with permessions (did you check the sonarqube user can actually read that file?) UPDATE Check java.library.path in settings->system info page Move jpam lib...
java,out-of-memory,sonarqube,sonar-runner
I guess you don't really need to pass Ant objects as extension so I suggest you give a try to ForkedRunner instead of EmbeddedRunner. This would allow you to start with a clean JVM for each analysis. FYI we are currently working on improving the embedded mode to support running...
You should activate the rule S1135 ("TODO tags should be handled") of the Java plugin: http://nemo.sonarqube.org/coding_rules#rule_key=squid%3AS1135. It will raise issues on every occurrence of TODO comments.
This feature is not planned for the moment - even though it has already been discussed a couple of times. Multiple inheritance offers some good features that we can understand. Your use case is a good example. But it also brings complexity when it comes to decide what to do...
java,sonarqube,jacoco,jacoco-maven-plugin
The JaCoCo measures test coverage based on percentage of bytecode which was actually executed. Declaring static final primitive or String constant creates no bytecode to execute, it's just an entry inside the constant pool. The only bytecode you have here is an implicit default constructor, usually like this: aload_0 invokespecial...
I do confirm that this is not possible to share a dashboard only with some users or groups. When sharing a dashboard, you share it with all users.
Turns out that the MsBuild runner looks at the full path of your project to see if it's a Test project. so if your Build agent name or Build definition name or any folder leading up to your project file has the word "test" in it, all projects will be...
typescript,sonarqube,sonar-runner
Okay, I figured out how to solve this specific problem. The key sonar.language in my sonar-project.properties should be set to ts, not typescript. # Language sonar.language=ts I figured this out by looking at example project corresponding to the javascript plugin: https://github.com/SonarSource/sonar-examples/blob/master/projects/languages/javascript/javascript-sonar-runner/sonar-project.properties. Here, the language is set to js not javascript....
The new update URL is: http://downloads.sonarsource.com/eclipse/eclipse/ This will be updated on the Eclipse Marketplace....
java,maven,sonarqube,sonarqube-5.0
You have to enable your new rules on a quality profile.
plugins,views,sonarqube,sonar-runner,sonarqube-5.0
Found the solution to the first issue. I was doing a POC on using Views Portfolio plugin and it requires to regularly run "sonar-runner views" command to publish/fetch new data for Views. There was a Jenkins job which was running just "sonar-runner views" every 2 minutes and at the same...
It's not surprising that your code is treated as non-compliant - it violates Java Code Conventions. It's up to you to follow code conventions or not, but consider the fact that code written in common style is much more easier to understand. According to the Java Code Conventions if-else statements...
H2 DB upgrade is not supported. As you can see at the bottom of each page of your running SonarQube instance, H2 must be used only for testing purposes.
Same as previous message SonarQube - Unable to load the Wrapper's native library 'wrapper.dll': can you verify that you have a Java 64 bits installed, because it looks as 32 bits version.
The issue is due to some Checkstyle rules. If you remove them, this solves the problem. For further reference: http://sonarqube.15.x6.nabble.com/ArrayIndexOutOfBoundsException-while-decorating-Java-file-td5034646.html...
web-services,iis,sonarqube,sonarqube-5.0
Resolved. I had to check "Reverse rewrite host in response headers" option in IIS -> Machine -> Application Request Routing Cache -> Server Proxy Settings. ...
Depending on your version, you can mark the issue as "Won't fix" (meaning that the debt from this issue is accepted - since 5.1) or "False positive" (meaning that you think that the analysis engine is wrong - before 5.1).
You can easily achieve what you want. This is a matter of how you configure JaCoCo so it has little to do with SonarQube. For example in SonarQube Eclipse project we need that since unit tests are in a separate module. So we have configured JaCoCo to use the same...
tfs,msbuild,sonarqube,sonar-runner
@Techtwaddle is correct: the MSBuild.Runner invokes the sonar-runner. The MSBuild.Runner v0.9 does the following: fetches configuration settings from the SonarQube server; gathers information during the MSBuild phase; generates a sonar-project.properties file; invokes the sonar-runner to carry out further analysis. Some of the analysis is now performed before calling the sonar-runner....
By default, analysis in Eclipse is happening in "incremental" mode, so you don't need to specify the sonar.analysis.mode property. Also, the Eclipse plugin always report every issue found in your code, may it be a new one (= you've just introduced it) or an existing one. As described in the...
android,sonarqube,android-gradle,lint,sonar-runner
Simply add a new line to module build.gradle file, just after sonarRunner task declaration: sonarRunner { tasks.sonarRunner.dependsOn build // <- This new line sonarProperties { ...
The message Access denied for user 'sonar'@'172.23.48.129' is telling you that the user sonar cannot connect to the database schema of your SonarQube 4.1 instance from your machine (with IP address 172.23.48.129). Please check permissions for this schema, for smooth operations you should have something like: GRANT USAGE ON `sonar`.<your...
It looks like a string escaping bug. If you rename your project to remove the quote character, the page will display correctly. I have created a JIRA issue to track this, will be fixed in 5.2 (and maybe backported to 5.1.x).
It's not yet possible but it will once this ticket will be resolved : http://jira.codehaus.org/browse/SONARCS-456
android,android-studio,sonarqube,lint,sonar-runner
I should have taken a deeper look into lint-results.xml file. The error is fully explained there. In my case: <?xml version="1.0" encoding="UTF-8"?> <issues format="4" by="lint 24.1.2"> <issue id="LintError" severity="Error" message="No `.class` files were found in project "debug", so none of the classfile based checks could be run. Does the project...
Quick Answer: No - not by declaring dependencies nor by having the plugin be in charge of the lifecycles and their phases to be run prior to the plugin's goal. By mvn clean compile sonar:sonar you are instructing Maven to first run the entire clean-lifecycle with all its phases -...
Replacing default Maven logging implementation is currently not supported. Ticket created: http://jira.sonarsource.com/browse/MSONAR-122
sonarqube,lombok,sonarqube-4.5
You have to provide the 3rd party libraries you use (ie your classpath) via sonar.java.libraries property for the analyzer to be able to detect that you are using Lombok and make the correct exclusions.
The error log "Unable to start JVM: No such file or directory (2)" means that the path to java executable does not exist. Please check that /usr/java/jdk1.8.0_40/bin/java, as you configured in wrapper.conf, is correctly installed.
You can install Checkstyle and FindBugs separately, enable their rules in your profile and thus use them in your analysis. However, @SonarSource has made a concerted effort to replace such rules with 'native' rules, and if you do install these extra plugins, you will find many of their rules marked...
Yes, in Manage Jenkins > Configure System you can add as many Sonarqube installations as you want in the Sonar section. Then when you configure a job to perform the Sonar analysis you can select what instance you want to use from a drop down list.
Thank you for your feedback. There is obviously an issue regarding how the rule StringToStringCheck currently handle method invocations. The rule is new and has been introduced in java plugin 3.3. To resolve the issue and continue with the sonar analysis, simply disable rule squid:S1858 ("toString()" should never be called...
git,continuous-integration,sonarqube,code-quality
To the best of my knowledge, Sonar (and its plugins) are not capable of doing that because Sonar is a batch tool. What you are looking for is a truly incremental analysis tool that analyzes every commit in a repository. Teamscale is exactly what you are looking for. You can...
javascript,c#,css,.net,sonarqube
You need to set sonar.sourceEncoding=UTF-8 in your sonar-project.properties file for UTF-8 BOM characters to be properly taken into account. Now, I was able to reproduce the parse error on CSS files with the CSS plugin 1.2, which does not yet understand UTF-8 BOM characters. However, on C# and Javascript files,...
It looks your issue was solved just two days ago. http://jira.codehaus.org/browse/SONARJAVA-808...
I solved this by rebuilding Elastic Search indices: Stop your SonarQube server Remove the contents of the $SQ_HOME/data/es directory Start the server SonarQube will recreate indices on startup....
With the latest issue page (on version 5.1 of SonarQube) you can search issues by author. Just click on Issues in the top bar and select the author facet. Have a look on nemo to see this feature (and all my issues ;) )
web,annotations,sonarqube,sonar-runner,sonarqube-5.0
You can take a look at how this is implemented on the numerous SonarQube open-source plugins that are developed by SonarSource and the SonarQube community. For instance, on the Java plugin, you can look a some classes like AnonymousClassShouldBeLambdaCheck. You will see that the following annotations are used to declare...
It's most likely that you don't have the same set of plugins between the 2 instances. Please check the contents of the $SQ_HOME/extensions/plugins directory on both servers, if they are not the same you will have to install missing plugins using the Update Center. Also note that sharing the same...
sonarqube,sonarqube-5.0,false-positive
This can happen when the ElasticSearch index of issues is out of sync with the database. You should stop your server, remove the $SQ_HOME/data/es directory and restart the server. It might take some time, depending on the number of issues in your database, but it should solve the problem.
authentication,ldap,authorization,sonarqube
"Enable Access Control" is for authorization to access the LDAP Directory Information Tree (and not for authorization of the application). I discovered this later. For application level authorization, attributes like memberOf or isMemberOf are used. Apache Directory Server does not support the memberOf or isMemberOf attribute as on the...
android,xml,xpath,sonarqube,lint
Accidentally I have found how to do this. Steps: Log in as administrator or other user with sufficient rights. Look for XPath rule for the language, XML in this case. Press Create button near "Custom Rules" text and fill form. Do not forget to activate this custom rule in your...
I had to use a different setting. Instead of Configuration->Settings->Exclusions->Files->Source Files Exclusions I had to use Configuration->Settings->Exclusions->Issues->Ignore Issues on Multiple Criteria. In this setting, I had to set the RULE KEY PATTERN to *, and I had to set the path wildcard in the FILE PATH PATTERN, **/Migrations/. works perfectly....
gradle,sonarqube,sonar-runner,gradle-custom-plugin
I discovered that I could use project.getExtensions().sonarRunner.sonarProperties{ ... } to set the sonar properties. See example below. class MySonarPlugin implements Plugin<Project> { @Override void apply(Project project) { project.apply plugin:'sonar-runner' project.getExtensions().sonarRunner.sonarProperties { property 'sonar.host.url', 'http://mySonar.company.com' property 'sonar.jdbc.url', 'jdbc:mysql://127.0.0.1:1234/sonar' } } } ...
unit-testing,sonarqube,code-coverage,gallio,opencover
Gallio support has been removed from sonar version 4.3 .From now on you have to produce your own test results and import them in sonar. hope this helps. Please like the comment if you find it useful
I found the answer myself. Looks like I don't realize how the database works in Sonarqube. So by DEFAULT, sonarqube use H2. This is a good one, and I believe such my problem won't happened. Turned out someone from my company actually used his own MYSQL server. So, I found...
service,jenkins,sonarqube,sonarqube5.1
You will want to update the SonarQube Java plugin to a more recent version, your error comes from a deprecated API which was removed as of SonarQube 5.1 - and fixed in more recent versions of SonarQube Java (latest as of writing is 3.3).