Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Get Issues with Sonar Runner" returns All Issues instead of New Issues #46

Open
Icedmang opened this issue Apr 22, 2016 · 8 comments
Open

Comments

@Icedmang
Copy link

Icedmang commented Apr 22, 2016

radar-netbeans Version 1454562877_radar-netbeans-2.5
SonarQube Server Version 5.4 (This may be the reason as it states support for Version 5.3)

Netbeans
Product Version: NetBeans IDE 8.1 (Build 201510222201)
Updates: NetBeans IDE is updated to version NetBeans 8.1 Patch 1
Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14

Configuration
Under Tools | Options -> Miscellaneous, Select SonarQube tab and choose "Analysis Mode for Runner" as "Preview".

I believe only the following Analysis Modes are available: Publish, Preview, Issues (Incremental is no longer supported) as mentioned in http://docs.sonarqube.org/display/SONAR/Analyzing+Source+Code

Preview mode performs a full analysis on the entire code base and does not send the results to the database. Typically this mode is used when you want a quick feedback about the issues that you might have introduced before pushing your modifications to the main code base. See all the possibilities in the "Pre-commit Check" documentation.

On unchanged code from a repository, I would expect to see 0 issues listed but instead see all of them as currently reported in the SonarQube dashboard

Running an analysis from the command-line using Maven seems to result in the expected result:

C:\Temp>mvn sonar:sonar -Dsonar.host.url=http://sonar -Dsonar.analysis.mode=preview -Dsonar.issuesReport.console.enable=true -Dsonar.login
=**** -Dsonar.password=****
...
[INFO]

-------------  Issues Report  -------------

  No new issue

-------------------------------------------


[INFO] ANALYSIS SUCCESSFUL
...
@Icedmang
Copy link
Author

Icedmang commented May 6, 2016

I took a look at the code and it looks like SonarRunnerResult should be taking into account the isNew field on each issue if it's Preview mode. I had to make a number of upstream changes to use SonarRunnerIssue instead of Issue to account for this information. Currently, I have modifications to a local copy of the code that filters issues on this field as that's all the information I'm interested in within Netbeans.

@Icedmang
Copy link
Author

Icedmang commented May 6, 2016

A general comment, if you plan to support multiple versions of SonarQube, can I suggest you make a decision on what you want to support whether it's the latest SonarQube or remain backwards compatible for everything. Trying to be backwards compatible with one version is going to get ugly. If you want to be backwards compatible, perhaps it's time to consider different releases

@Git-GT
Copy link

Git-GT commented Jun 20, 2016

Hi, I have the same issue, using the local analysis I would like to see only the new issue introduced by me. I tried to create a sonar-project.properties file in the project root with the parameter
sonar.timemachine.period1=previous_analysis
But it seems that the plugin doesn't care about this file. Is there some workaround to have this kind of analysis? Where is the properties file used by the radar plugin to perform the local analysis located?

@hmvictor
Copy link
Owner

Hi, @gittino The plugin does not use a properties file. At this very moment, all the information is calculated from the Netbeans Project API and passed directly to sonar runner.

@hmvictor hmvictor closed this as completed Jul 4, 2017
@Icedmang
Copy link
Author

Icedmang commented Jul 5, 2017

Hi @hmvictor, I tried version 3.0.1 and the issue still exists. Does closing mean this won't be fixed?

@hmvictor
Copy link
Owner

hmvictor commented Jul 5, 2017

I'm closing old issues and keeping the new or more relevants open to focus the development. If this stills an issue, I can reopen but since I think there are two threads in this one maybe is better to create new issues. And because there were some API changes in SonarQube in the last versions is better to see what applies now.

@hmvictor hmvictor reopened this Jul 5, 2017
@Icedmang
Copy link
Author

Icedmang commented Jul 7, 2017

@hmvictor 2 Issues meaning: 1) Get issues with Sonar Runner returning all issues. and 2) The use of properties file?

@hmvictor
Copy link
Owner

hmvictor commented Jul 7, 2017

@Icedmang

Yes, exactly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants