Skip to content

Lines/LOC REST API #3738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ChristopheBordieu opened this issue Oct 6, 2021 · 5 comments
Closed

Lines/LOC REST API #3738

ChristopheBordieu opened this issue Oct 6, 2021 · 5 comments

Comments

@ChristopheBordieu
Copy link

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?

@vladak
Copy link
Member

vladak commented Oct 6, 2021

The first part is probably a dup of #3047, the second part I noticed myself recently.

@ChristopheBordieu
Copy link
Author

Indeed, it is.

@vladak
Copy link
Member

vladak commented Oct 6, 2021

We can also contemplate adding API endpoint just for the purpose of getting the LOC/lines.

@ChristopheBordieu
Copy link
Author

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.

@vladak
Copy link
Member

vladak commented Oct 7, 2021

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.

vladak added a commit to vladak/OpenGrok that referenced this issue Apr 19, 2023
@vladak vladak closed this as completed in 95c1e33 Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants