Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New Sonar IntelliJ plugin incremental analysis and detection not working

I’d like to ask for help. I installed the plugin and successfully added the SonarQube server. I upgraded to version 4.1.2. I use IntelliJ IDEA 13.0.2. I also successfully associated the project and inspection warnings appeared. But when I fix the issue the status is not updated.

  1. How to synchronize ?

I also run inspection by name ‘SonarQube issues’. Nevertheless after running the inspection the warnings are also there, where the code was fixed. It seems to me the synchronization somehow fails. Any idea, what todo, please?

like image 338
jGuru Avatar asked Mar 07 '14 10:03

jGuru


2 Answers

What I had done in my situation.

  • Installed SonarQube 4.4.

  • Installed IntelliJ 13.1.4b (the same history was with 13.0.4).

  • Configured SonarQube intelliJ plugin (not community provided one but plugin from SonarSource). All instructions are under the link on Wiki.

  • Attached to Sonar project. Every step just as SonarSource recommends.

    This gave me mapping from Sonar onto source code. But it does not update when I simply fix the issue. But if I fix issues I then re-post project onto Sonar through mvn sonar:sonar and this gives me updated picture next time I run inspection through sonarqube plugin.

But this is not 100% what is wanted. But definitely better than nothing. Also I have imported Sonar rules through QAPlug - this is far less useful. But notable faster.

Overall this configuration allows me to make what is needed but I'd like to receive real incremental processing without publishing local changes onto Sonar server.

like image 119
Roman Nikitchenko Avatar answered Oct 13 '22 17:10

Roman Nikitchenko


Give a try to the SonarQube IntelliJ Community Plugin, it is made for fixing issues detected by jenkins on the local dev machine. Different then the official plugin you will need to do more configuration by yourself, but it gives you also the freedom to specify your local analysis script like you need.

What you need to do:

  • configure the plugin
    • setup sonar server
    • setup local analysis script

Afterwards you can run SonarQube (new issues) inspection, this will run the script and show the results in the Intellij. If you are fixing issues, you can just rerun the inspection from inside the inspections results tool window. This will rerun the script and show new results.

see also: https://github.com/sonar-intellij-plugin/sonar-intellij-plugin

like image 34
Oleg Majewski Avatar answered Oct 13 '22 18:10

Oleg Majewski