opengrok
opengrok copied to clipboard
Lines/LOC REST API
Hi,
Since OG 1.7.0, Lines and LOC are available for files and directories at any level starting from repository root (.../xref/PROJECT/repo[/...]).
-
Are these data available from a REST API request targetting any path? I found nothing regarding this in REST API doc (https://opengrok.docs.apiary.io/#). Would it be possible to implement a new request for this?
-
At project level (.../xref/PROJECT), the Lines and LOC are not accumulated and available. Is it something that could be set?
The first part is probably a dup of #3047, the second part I noticed myself recently.
Indeed, it is.
We can also contemplate adding API endpoint just for the purpose of getting the LOC/lines.
My users' use case is to know the # of Lines/LOC at repo level and also actually per language types. So, if you provide an API resource providing directly this info at any path, it answers my users' first need. For the language type reporting, no idea if this is something feasible/you have already thought to.
The per-language time reporting I don't think this can be done reasonably. Perhaps if there is a API to get the LOC/line numbers one can use the search API and then traverse all the documents that match certain criteria and compute the sum. The search API itself can actually provide the numbers as well since they are stored in the index.