I’m using SonarQube CE 8.9.6 and I need access through the REST API to the coverage, duped lines, bugs, vulnerabilities and tech debt ratio for a set of 22 projects.
I’m getting all the project keys in the server with /api/components/search and then filtering out the ones I don’t need. Then I’m getting the metrics I’m interested in by calling /api/measures/component, with the caveat of making one call per project key.
This approach is slow (each call takes some time) and I was wondering if there was an endpoint that returns the metrics I want for the project keys that I have, all in one call.
If not, is there an endpoint like /api/measures/component_tree that instead of returning a tree of child projects it returns a set of all projects in the instance? Then I could get the whole cake and leave out the projects I’m not interested in.
The API we’ve exposed is what we built to populate the UI. That’s why I generally tell people “to master the API, use the UI”. The place in the UI I can think of that lists metrics for multiple projects is the Projects page. A little Developer Tools snooping gets me a /api/measures/search query that might be useful…
To be clear, the APIs we truly consider internal (and thus likely to change without notice) are marked internal. The ones exposed by default are considered stable.