Lines of code, per language

Feature Request

On the Administration -> System page I can see the LOC for the entire SonarQube instance, thats great, especially if we are considering buying a licensed version.

However, I would really like the addition of LOC per language. E.g

TotalLOC: 1,000,000
whereof:
   Javascript: 600,000
   CSS: 14,000
   Java: 280
   XML: 300,000

Reasoning:

If we right now have 5,200,000 lines of code, and out of those 1,800,000 are just XML we could just disable the XML plugin and get a lower license fee.

I give the XML plugin as an example since there is only one rule enabled as default, and people use (large) xml files as testdata and the analysis gets a bit unneccessary.

Sure there are other benefits as well, you can see the percentage of code by language for the entire organisation which would help in hiring and educating staff.

Hi,

It’s not quite what you’re asking for, but you can find this information in the System Info file you can download from Administration > System. It’s the last element in the list. Look for “nclocByLanguage”.

 
Ann

1 Like

That works just as well. I just want to see the numbers. Didn’t know you got more information by downloading the json.

Thanks :slight_smile:

Any chance it is possible to get the nclocByLanguage data via the API? I’m hoping to track our overall language trends outside of the sonarqube instance.

Hi @JordanSussman,

If you can see it in the UI there’s a web service that feeds it. :smiley:

Developer Tools is truly your friend here.

 
HTH,
Ann