Getting information about issues in the SonarQube 5.0 API - sonarqube

I would like some suggestions about the best way to go about interrogating the SonarQube 5.0 API. I am trying to find out the number of issues that are flagged in each of all the services that exist but am trouble finding a way to go about formulating a call for that on this version of Sonar, even in the documents.
Any suggestions would be appreciated.

Related

How to retrieve SonarQube metrics of previous build versions through the api?

How do I get the measures (like code-coverage, technical debt, complexity, nloc, ...) of a certain build version (eg. 1.0.0.20) from the api of SonarQube?
My goal is to get these information and display it along with some-other info pertaining to that version got from other sources like bitbucket.
I am able to only see the measures of the current (latest) build (eg. 1.0.0.45) version through the api/measure/component api link.
Although, I can see these measures for individual builds through the UI under the compare option. But how to get it through rest api?
SonarQube Version 5.5
Plugins:
sonar-scoverage-plugin-5.1.3.jar
sonar-scm-git-plugin-1.2.jar
sonar-scalastyle-plugin-0.0.1-SNAPSHOT.jar
sonar-javascript-plugin-2.11.jar
First of all, SonarQube 5.5 is old, you should first consider using the latest LTS (5.6) in order to be able to get feedbacks.
Versions of projects can be found by using :
api/events/index (it's replaced by api/project_analyses/search in 6.3) -> it will return you the date of analysis on which there's a version.
And in order to get measures from the past, you can use :
api/timemachine/index (it's replaced by api/measures/search_history
in 6.3) -> you'll be able to found the measures from the version you want.

How to look like Sonar Online Dashboard?

I see a big difference in the look & feel between the online dashboard (https://sonarqube.com/projects or https://sonarqube.com/governance?id=MASTER_PROJECT) and the one that we see by default on our local installation of sonar (v5.6.3).
I'm wondering about whether the online look & feel can in someway be easily applied to a local installation. It's just a matter of css/js or behind we have also a completely different HTML structure?
Any information about this will be much appreciated.
I think I've found the answer to my question. The nice-looking online demo is based on an Enterprise Grade deployment of sonar with the governance plugin.
https://www.sonarsource.com/why-us/products/plugins/governance.html
https://www.sonarsource.com/solutions/deployments/enterprise-grade/
Can't you update your install to the latest version? There have been UI changes in both version 6.0 and 6.1
http://www.sonarqube.org/sonarqube-6-0-in-screenshots/
http://www.sonarqube.org/sonarqube-6-1-in-screenshots/

Is interaction between a widget plugin and SonarQube server to do analysis possible?

Specifically, I want to run some analysis on the issues generated and rules violated. So I want to design the system to have a few click actions in the web interface of sonar and initiate the analysis in the back-end. The reason for this is that the analyses are run only during some cases and I don't want the instance with my plugin to have additional load during each run.
Also if possible could you point me in the right direction?
I couldn't find anything on here. http://docs.sonarqube.org/display/DEV/Web+API
Please note I have been searching this very recently and am also new to SonarQube.
SonarQube server is for performing analysis only. What I was looking was for the server to give the user access to control the analysis. But using independent plugins to do static analysis could work.
I solved this issue by splitting the plugin into
A plugin for doing inline analysis work (if a need for doing our own static analysis arises)
A WebApp to classify issues, listing them by projects, etc.
This approach seemed more attractive when after discussion, we decided that all functions we wanted out widget to do, our WebApp itself could do. From SonarQube version 6.2, the ruby APIs are going to be deprecated and so moving to a REST-based approach would give an enduring solution.

Sum of metrics over all Sonar projects ?

Is there any way to aggregate metrics over all projects in Sonar ? For instance, is it possible to get the total number of SLOC ?
It seems that it should be a basic feature of Sonar.
I know about the Views plugin, but I'm looking for something free. And I don't need all the features of this plugin, only aggregates over all projects, not custom views.
Since I haven't been able to find anything, I have developed a very simple Sonar plugin that does the trick using the API provided by the Sonar server. Turned out to be pretty simple.
The plugin is available here, but it has been only tested on one Sonar instance.

Sonar Issue - Version update

Sonar is an open platform to manage code quality. I have the admin access to perform the updates. Recently I tried performing a version update from 3.7.3 to 4.1.1.Unfortunately 4.1.1 is only compatible with IE9 or above. Hence I back out the changes as in our organization IE8 is the internet browser. Now 3.7.3 is not working as it is showing as database is pointing to a latest version.MySQL is used to hold the sonar data. I am completely stuck with the issue. Sonar is a very important tool for us as this can only take a code coverage metrics for the source code.
May I request you to look in to this issue and provide some help. I cannot move forward without your help.
Anticipating your help and support.
The only way to get back to a normal state is to start over from a 3.7.3 database backup.

Resources