REST API vs System overview LOC

  • CE
  • We currently analyze ~160 projects, I wanted to see the LOC ration between them.
    The problem is when I use REST API it reports ~1.2M lines in total but when I take a look into the system overview there it says ~2M lines.
    What may be the reason for such a disparity?
  • queries I used:
    list of projects: api/components/search?qualifiers=TRK&pageSize=200
    for each project: api/measures/component?component={project}&metricKeys=ncloc

Are you looking at the project branches also? The License LOC includes the master and the LOC of the largest branch for each project.


Welcome to the community @Petr_Skramovsky!

It’s the largest branch of each project that counts toward your license limit. Since the web services you’re using return master information by default, I think you’re using the wrong web services to get at the information you want.

There’s a web service marked internal that pulls your current LoC-for-license-purposes: api/editions/show_license. There’s also the internal service to get the support information file: api/support/info. (The ncloc number from this response is the correct one. The others need to be caught up to the way we currently calculate LoC-for-license-purposes).