3

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
slartidan
  • 20,403
  • 15
  • 83
  • 131
Saurabh
  • 95
  • 2
  • 8

1 Answers1

1

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.