Some XPath rule work in SonarQube 4.4 - xpath

Recently I wrote some XPath Query on sonarqube 4.4. Some of them work on sonar 4.4 and some of them not. For example when I defined XPath Queries as following:
//IfStatement/statement[not(block)]
//WhileStatement/statement[not(block)]
//variableDeclarator[not(block)]
the sonar 4.4 detect the issues and when I defined XPath Queries as following:
//qualifiedIdentifier/IDENTIFIER[#tokenValue= "println"]
the sonar doesn't detect the issues. Why the reason of that?
As Fabrice explain in here this is a known bug in sonarqube 4.4 but Why some XPath queries (such as If/Statement) works on sonar 4.4 and another not?

As you pointed out this is a known issue : https://jira.codehaus.org/browse/SONAR-5575
This seems to be related to a bad escaping of the quote when inserting into the database and it explains why some XpathQueries will be persisted and some others won't.

Related

Upgrade SONAR: The results change

We launched sonar 4.5.4 in one of our application. Then, we have upgraded sonar with 6.7.5 version and we have got different results.
e.g.: the rule DLS_DEAD_LOCAL_STORE. When we passed our code with 4.5.4 version, this critical rule was not broken at all. With the new version, it appears as a new critical bug even when no changes have been implemented (last commit for this classes was made more than one year ago).
Is there any documentation about rule implementation changes per versions?
Does anyone any experience with this?
When you upgrade SonarQube you have to prepare yourself for some (big) changes. There is a large gap between 4.5.4 and 6.7.5 so, do not be surprised that checkers have been enhanced and severity revised.
It is normal and you should analyze changes before performing any application upgrade.

No matching issues found in the sonarqube 3.7.4

I'm working in the sonarqube 3.7.4. I analysed my java project and it clearly showing me the number of issues with the count. But while clicking the issues it results in "No matching issues found".
Please provide me the suggestion to fix the issues
You should upgrade to the latest LTS version of SonarQube : 4.5.6

it is possible to merge two profiles in quality sonarqube

I would like to know if you have a junction between the two profiles of quality, creating a single.
I have a project that uses the JEE technology, and it uses javascript, java and JSF.
Wanted to make a junction of quality profiles (Web + Javascript + Sonar way with Findbugs)
Is there any way to do this?
I'm using sonarqube 4.3 and sonar runner 2.4.
According for your reply
I have to call the sonar runner several times
first for Sonar way in Web perfil
second for Sonar way in JavaScript perfis
third for Sonar way with Findbugs in Java perfis
would give me an example?
You actually don't have to do this and this is not the correct way to solve your problem anyway.
As of SonarQube 4.2 you can use the multilanguage feature and your files will be automatically analyzed by the correct language plugin (detection is based on file extension).
If you are using a version prior to 4.2 you will have to run multiple analysis with the correct language set each time.

Sonar 4.1.2: php-plugin not detecting any violations

Sonarqube 4.1.2 with the latest php-plugin is not detecting any violations.
When I run the analisis with Sonar 4.2 it shows me the errors how I expected them.
Is there a bug related to the php-plugin? Can anyone confirm this behaviour?
Thanks in advance
When using SonarQube 4.1.2, could you double check the content of the PHP quality profile that you're using ? Indeed in latest versions of the PHP plugin, all rules have been rewritten so if you have also upgraded the PHP plugin perhaps you're simply doing an analysis with an empty quality profile.

how to disable some issue in sonar metrics?

It is possible turn off some issue checking in sonar projects and how to do it? I want to for example disable "Tabulation characters should not be used" or "Modifier Order".
Thank for help.
If you would like keep the rule active while excluding certain parts of your source-code, you can use features of the the switch-off violations-plugin.
The plugin was deprecated with sonarqube 4.0, as it is now possible to use integrated features described in this part of the sonarqube-documentation:
http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus
If you are using an older version of sonarqube you find the plugin here:
http://docs.codehaus.org/display/SONAR/Switch+Off+Violations+Plugin

Resources