No information anymore of ncloc and nclocByLanguage in api/system/info

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube 9.9 LTS

  • how is SonarQube deployed: zip, Docker, Helm

  • what are you trying to achieve
    Get information about language usage. In the ‘earlier’ versions I could get this information from the api/system/info metrics.
    The metrics: ncloc and nclocByLanguage

  • what have you tried so far to achieve this

Is there an other api call to get these metrics?

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!


I know some data reporting got moved around (edited/dropped?) right before the LTS. I can find this in the Support Information File (Administration → Support), but I haven’t been able to figure out which API calls to use to get that directly, even if you don’t have support. Are you on a commercial edition? Do you have that page?


Hello Ann,

No we have a Developer Edition.
And there is no information at Administration → Support.

“This instance is not supported. Please contact SonarSource to get support”

We use the ncloc and nclocByLanguage metrics in our dashboard for monitoring


Hi Bert,

Thanks for the detail. Do you mind sharing why LoC by language is important enough to show in your dashboard? Sorry, but it’s not obvious to me.

I’ve pinged internally so try to dig up the information, but I’m not sure what success I’ll have with that.


Hi Ann,

Thanks for asking around with your colleagues.

We want to see which languages are used and how much LoC they have.
It’s just for reporting purpose.

It has always been available in the api/system/info metrics.
I can’t find anything in the release notes that these metrics were deprecated.


Hi Ann,

I can find that in version 9.7 the ‘Statistics’ field has been removed from response. ( Changelog in api/system/info )
Is there an other way to get these statistics from the system.

Regards Bert


I’m still waiting to hear back from my internal ping. And you’re not going to like the only answer I have.

This data is still available at the project/branch level.

The api/projects/license_usage service will tell you which is the largest branch for each project. You can then iterate the projects to query for the ncloc_language_distribution for those branches.


1 Like

Hi Ann,

Thanks for your reply. And it’s an answer. :slight_smile:
I hope the ‘internal ping’ wil come with a final answer: where to get the overall information about the usage of the different languages.
I wil look if I can use your info for now.