Can't see updated local run report

123 views
Skip to first unread message

Isaac Troll

unread,
Nov 19, 2015, 8:50:53 AM11/19/15
to SonarQube IntelliJ Plugin
I'm trying to fun sonarqube locally to see what issues still exist in my code without having to check everything into git to have our regular sonarqube server run a scan.  Here is the setup I have done.

Installed IntelliJ 15 community Edition
Installed IntelliJ SonarQube community plugin


I pointed the sonarQube plugin to our regular sonarqube server and specified which project.

At this point when I run an inspection I can see the sonarQube listing in the inspections tab matching that of the regular sonarqube server.

I then created a local sonar script:

/projects/sonar-runner-2.4/bin/sonar-runner
and the path to my sonar-report.json is:
$WORKING_DIR/.sonar/sonar-report.json


My project has a sonar-project.properties file in it with the following:
sonar.projectKey=key
sonar.projectName=name
sonar.projectVersion=versionNumber

sonar.analysis.mode=incremental

# Set modules IDs
sonar.modules=src

# Modules inherit properties set at parent level
sonar.sources=main/java
sonar.sourceEncoding=UTF-8
sonar.language=java


sonar.host.url=our sonarqube server

When I run the sonarqube (new issues) scan the sonarqube console shows it running without issues.  I see it export the report to my project/.sonar/sonar-report.json  And I can see that less issues were found in the logs then the initial report.

However the inspections tab never shows a SonarQube(New) section.  Where Can I see a listing of what issues were found in this new run of sonarQube locally?

Thanks for any help you can give.

omayevskiy

unread,
Nov 19, 2015, 8:54:02 AM11/19/15
to SonarQube IntelliJ Plugin
You wrote: And I can see that less issues were found in the logs then the initial report.

Less issues are not new issues, they just should disappear in you editor.
You see new issues only if you introduce new not yet existing issues.

Isaac Troll

unread,
Nov 19, 2015, 8:55:27 AM11/19/15
to SonarQube IntelliJ Plugin
Ok, so there is no way with this plugin to get a full list of currently existing findings from a local scan?  Only from a scan from the server?

omayevskiy

unread,
Nov 19, 2015, 9:02:34 AM11/19/15
to SonarQube IntelliJ Plugin
The issues that you fixed should disappear from the inspections list and also not be visible any more in the editor.
Fixed issue are not visible.
All still existing issues must be shown as old issues and be visible in the inspections window and in the editor.

Isaac Troll

unread,
Nov 19, 2015, 9:05:37 AM11/19/15
to SonarQube IntelliJ Plugin
Ok.  I hadn't realized the inspections window listing would shrink as I fix things.  The project I'm working on has over 10,000 issues so its a mess to try and deal with.

One last question.  In the inspections tab if I type something its supposed to work as a find.  And there is a button for "navigate to next instance"  but it just goes to the next error, not the next error that matches my search text.

Is there an easy way to see all instances of a given rule, or to sort/filter?

Thanks for explaining how the plugin works.  I was just misunderstanding its purpose but it does make sense now.

omayevskiy

unread,
Nov 19, 2015, 9:53:03 AM11/19/15
to SonarQube IntelliJ Plugin
Sort/Filter for given rule is something that is on nice to have / todo list since too long time now.
But in mean time you can navigate throw all rule of same type by:

run inspection
in the inspections window click Expand All
each issue description contains the rule key, e.g.: [MAJOR] NPath Complexity is 769 (max allowed is 200). checkstyle:com.puppycrawl.tools.checkstyle.checks.metrics.NPathComplexityCheck 
you can now start typing in the inspections window and search for NPathComplexityCheck and use arrows up/down to navigate to next one.
Same way you can search for MAJORs, CRITICALs etc.

Isaac Troll

unread,
Nov 19, 2015, 10:18:23 AM11/19/15
to SonarQube IntelliJ Plugin
Thanks for all the help.  searching once I did expand all worked.

Although as I go through and fix things, I'm not seeing the items I fix drop from the inspection list.

Should this dropping from the list be automatic?  or do I have to re-run the regular, or local scan to have the list drop out whats been fixed?

omayevskiy

unread,
Nov 19, 2015, 10:19:34 AM11/19/15
to SonarQube IntelliJ Plugin
you need to re-run local analysis

Isaac Troll

unread,
Nov 19, 2015, 10:35:20 AM11/19/15
to SonarQube IntelliJ Plugin
Ok, then I must have something not quite setup correctly.

When I run the initial inspection it says it pulled down 9762 issues for the 1330 files.

Then when it ran the local scan it scans the 1330 files and shows 8997 issues found with no new issues.

But in the inspections tab under sonarQube issues it says there are 9614 issues.  And I tried with and without the "filter resolved issues"

And I have gone to an item in the list I know I fixed.  clicked on it to open the source and its fixed.  But the highlight for the warning is still there, just on where the error was.  Its almost like the local scan isn't updating the editor even though it scanned successfully.

Any thoughts what i'm doing wrong?

omayevskiy

unread,
Nov 19, 2015, 10:55:32 AM11/19/15
to SonarQube IntelliJ Plugin

There is a known bug that if you fix the last issue in the file, it get’s not fixed and you need to re-run on sonar server to get rid of it.

But if you still have other issues in same file, then the fixed one should be gone.

Isaac Troll

unread,
Nov 19, 2015, 11:00:27 AM11/19/15
to SonarQube IntelliJ Plugin
ok, that may account for some of it.  But in the one sample file I was using the server said there were 31 issues.

I fixed 3 of them.  

Then ran a local scan again, and inspections still show 31 issues.  The file in the editor did unhighlight the 3 error areas of code though.  So the file itself knows that the issues were fixed.  Just not the inspection tab.
Reply all
Reply to author
Forward
0 new messages