hmvictor / radar-netbeans

A SonarQube plugin for Netbeans
Other
33 stars 22 forks source link

Unexpected Exception when getting issues from server #59

Open roskens opened 7 years ago

roskens commented 7 years ago

I have a project that has a lot of sonar bugs, and this results in 20 pages of bugs. When this plugin attempts to load the 21 page, its gets a 400 Bad Request from the Sonar server, and that results in an Unexpected Exception:

javax.ws.rs.BadRequestException: HTTP 400 Bad Request
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.handleErrorStatus(ClientInvocation.java:193)
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.extractResult(ClientInvocation.java:170)
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocation.invoke(ClientInvocation.java:473)
    at org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder.get(ClientInvocationBuilder.java:169)
    at qubexplorer.server.SonarQube.getIssues(SonarQube.java:104)
    at qubexplorer.server.SonarQube.getIssues(SonarQube.java:90)
    at qubexplorer.server.SonarQube.getSummary(SonarQube.java:247)
    at qubexplorer.ui.summary.SummaryTask.execute(SummaryTask.java:45)
    at qubexplorer.ui.summary.SummaryTask.execute(SummaryTask.java:25)
    at qubexplorer.ui.task.TaskExecutor$TaskWorker.doInBackground(TaskExecutor.java:71)
    at javax.swing.SwingWorker$1.call(SwingWorker.java:295)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at javax.swing.SwingWorker.run(SwingWorker.java:334)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[catch] at java.lang.Thread.run(Thread.java:748)

This is with SonarQube 6.5, and the 3.0.1 plugin for netbeans.

roskens commented 7 years ago

If I do a call to the URL, this is the response from SonarQube:

{"errors":[{"msg":"Can return only the first 10000 results. 10500th result asked."}]}
hmvictor commented 7 years ago

Yes, the Sonar API has a limit in the number of issues that can be retrieved. So maybe it would be useful to handle this case and to show a more meaningful message to the user.

astaicu commented 6 years ago

Is there a way to get around this limitation? I would like to be able to export all the issues for a language to further categorise them. There are plenty of projects that have more than 10000 issues.

hmvictor commented 6 years ago

Hi @astaicu For remote issues, the plugin invokes the REST API provided by the SonarQube Server. I don't know of any workaround for the remote case.

In the local analysis with sonar runner these limitation should not exist.

ATakaSKY commented 6 years ago

Hey guys. Facing the same issue here. Not able to get issues beyond 10000. Even the API https://docs.sonarqube.org/pages/viewpage.action?pageId=2392181 says that cannot fetch more than 10000 issues. Is there any other tool that exposes all the issues in the API which I can make use of in my application?