deprecated=true&internal=true means show me all methods available right now … for this instance.
Use methods marked deprecated | internal at your own risk, they might disappear with the next
update or get public … you need to check the release notes with particular attention !!
And as Enterprise user you have two staging instances for testing.
WRT to find the code duplication, that’s job of the Sonarqube server CE engine !?
Otherwise to access metrics for a project … i guess it’s api/measures/component but i don’t know
the metricKey for code duplication …
you may check the code https://github.com/SonarSource/sonarqube
or use the dev tools of your browser
!! the web api documentation should have all possible values for params !!
@Rebse if you’re saying the API docs should include the list of metric keys, well… that list is not fixed. New plugins can add new metrics. Also, the out-of-the-box list is pretty long. No one wants to see that in the docs.
That’s what the metrics search service is for (example URL above).
Thanks @Rebse@ganncamp i have one feedback for API documentation . It would really be great value add if documentation also includes one examples with request and parameters the way you are showing response for any request.
Thanks @Rebse. I am able to find the duplicated_blocks using api and it returns me the number of duplicate blocks. Is there any api which return the actual duplicate code with details e.g file name with line numbers and duplicate block of code the way we can view duplicate code blocks in UI.
The use case is wants to generate a human readable report on each build which contains details about code duplication file names and line number in the same way a user is able to view on Sonarqube portal but only difference is instead of human an app needs to get those details .
In developer tools one has to click on each and every folder level in project structure to reach the code duplicate block. I was thinking there is a direct api which should returns this information.
Sonarqube has the human readable report you’re searching for.
The only use case for me would be to make it - beside more other Sonarqube metrics - available
in the IDE so developers don’t have to leave their workbench.
That would be job of the Sonarlint plugin, you may create a feature request.
WRT code duplication i’m not sure if there ain’t already some IDE feature/plugin available
especially for that.
If you want to collect those metrics for historical reasons … Got similar questions, e.g. how do
i see the issues from an analysis one year before … etc.
Don’t bother with the past, the most important is the current status of your projects.
With Enterprise edition you should use portfolios with daily/weekly/monthly reports showing
the current status and trends.
BTW this discussion moves straight away from the initial topic, better
create some new topic.