google / go-github

Go library for accessing the GitHub v3 API

Home Page:https://pkg.go.dev/github.com/google/go-github/v62/github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Number of files/lines of code from *github.Repository

bhargavah opened this issue · comments

Is there any way to get the total number of files & the total number of lines of code from *github.Repository.

There is a Go package that helps explore git in Go code. The Repository class in which we are speaking is here.

As per this documentation, looks like there is no direct way to get the total number of files or a total number of lines of code.

Any expert who can shed light on this or a workaround for this?

I got to know about 'total_count' field in the response schema but that is just the total count of the results returned. Not related to what we are speaking here. Cloc is probably another option but it would create a dependency to maintain this.

No, the GitHub v3 API doesn't appear to support these stats, and therefore this repo (which is a Go client for said API) also does not support them.

There are, however, a great number of alternative solutions available, including a Stack Overflow article with lots of pointers.
Check out some of these links:
https://www.google.com/search?q=github+v3+api+total+lines+of+code

Closing this issue, but feel free to comment if anyone has better advice.