Count LOC logo Count LOC

Count LOC logo Count LOC



Description
- Tool for counting lines of code from github/gitlab repositories.
- Max Repo size : 300 mb, greater repos will not work.
- Default branch is auto-detected; you can select another branch using &branch=branchName
- Can ignore files or directories writing them separated by commas in the ignoreBox.
- Can edit the colors of the segments by clicking on any point of it. Segment will randomly change color as it is clicked.
- Default colors are the same as github

- Limit : 30 requests per minute. Once reached subsequent requests will result in error 429 (too many requests) until your quota is cleared.
Endpoint - Get Lines of Code from GitHub repo
This endpoint retrieves LOC from any github repo based on programming language.
HTTP Request:
curl /v1/loc?github=username/reponame
HTTP Request:
GET /v1/loc?github=username/reponame
GET /v1/loc?gitlab=username/reponame
Select branch
If you want a different branch than master
/v1/loc?SOURCE=USERNAME/REPONAME&branch=branchName
Ignore files or directories
Can ignore files or directories using param ignored
/v1/loc?SOURCE=USERNAME/REPONAME&ignored=DIRNAME1,DIRNAME2,FILENAME
example :
/v1/loc?github=octocat/Hello-World
/v1/loc?gitlab=gitlab-org/gitlab-runner
/v1/loc?github=ImageMagick/ImageMagick&branch=gh-pages
/v1/loc?github=octocat/Hello-World&ignored=www,main.go
response :
  [{
    "language": "JavaScript",
    "files": 1,
    "lines": 176,
    "blanks": 14,
    "comments": 6,
    "linesOfCode": 156
  },   
  ... more languages
  {
    "language": "Total",
    "files": 8,
    "lines": 921,
    "blanks": 148,
    "comments": 46,
    "linesOfCode": 743
  }]