22

I've several GithHub projects and I wanted to know the metrics of these projects.

Is there a tool to generate metrics for a given GitHub project? Even very basic metrics like LOC would be enough (even though more complete metrics would be appreciated).

I just discovered that there was a great service, Caliper, doing that, but that has been closed. Is there another services of this kind?

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
  • See also https://stackoverflow.com/q/6610525/873282 – koppor Nov 24 '17 at 13:52
  • Annoying that such a useful question has been closed. How do I vote to reopen? – mark Aug 10 '18 at 11:05
  • You should have a look to repoXplorer (https://github.com/morucci/repoxplorer). This is an open source project able to compute stats for a project (a group of git repositories) as well as for a contributor and a group of contributors. It provides a REST interface and a web UI. Best is to have a look to the demo instance (ex: stats for the kubernetes project here https://repoxplorer-demo.okombu.com/project.html?pid=kubernetes) – Fbo Aug 13 '18 at 04:52
  • Also this question is related and not closed: https://stackoverflow.com/questions/6610525/how-to-generate-stats-for-a-github-project – Fbo Aug 13 '18 at 04:54

2 Answers2

26

I found two solutions:

  • ohloh: you can put your project on the site and it will analyze your source code and provide some interesting statistics
  • GitStats: a simple statistics generator for any Git repository on your computer
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
4

git log

options (some or one of)

--stat[=width[,name-width]]

Generate a diffstat. You can override the default output width for 80-column terminal by --stat=width. The width of the filename part can be controlled by giving another width to it separated by a comma.

--numstat

Similar to --stat, but shows number of added and deleted lines in decimal notation and pathname without abbreviation, to make it more machine friendly. For binary files, outputs two - instead of saying 0 0.

--shortstat

Output only the last line of the --stat format containing total number of modified files, as well as number of added and deleted lines.

Lazy Badger
  • 94,711
  • 9
  • 78
  • 110