We’re running SonarQube 9.2.2.xxx at our company and on a annual licenses checkup, we found out that the LOC mentioned by the license manager does not match the sum of all projects´s LOC.
On the license manager it shows that we’ve ~11M LOC and if we query each projects nloc via API we get a total of ~15M LOC.
Here’s the API endpoint that we’ve used: /api/measures/component?component={component}&branch={branch}&metricKeys=ncloc
On this query, we loop through every project and respective branches.
Typically yes, but there can be cases where the main branch is not the largest. For billing LOC count purposes, the largest branch is the one accounted for.
Hmm, that’s weird! If I query only the main branches (the LOC that appear on the project information page), I only get ~4M LOC.
API query used: /api/measures/component?component={component}&metricKeys=ncloc
It seems that some of the branches are not being taking in consideration for licensing purposes. Do you know if there’s some sort of “expiration” date? For example, if a branch is not analyzed for more than X days it stops impacting the licensing.