GitHubリポジトリを解析すると様々な情報が得られます。誰が一番協力しているかであったり、どういった言語が使われているか、いつから更新が止まっているかなど興味深い情報が多いです。 今回紹介するGitinspectorもそんなツールの一つです。自分のはもちろん、オープンソースのプロジェクトで使ってみると良いでしょう。

Gitinspectorの使い方

Gitinspectorはコマンドを実行するだけで使えます。

CLIとして実行すると次のような情報が出てきます。

$ gitinspector 
Statistical information for the repository 'ncmb-ruby-client' was gathered on 2016/09/05.                                                                                                     
The following historical commit information, by author, was found:

Author                     Commits    Insertions      Deletions    % of changes
Administrator                    3            64              9            6.93
Atsushi Nakatsugawa              9           723            158           83.67
tily                             2            49              1            4.75
tyfkda                           4            43              6            4.65

Below are the number of rows from each author that have survived and are still intact in the current revision:

Author                     Rows      Stability          Age       % in comments
Administrator                42           65.6         20.7                0.00
Atsushi Nakatsugawa         582           80.5         10.3                3.09
tily                         41           83.7         16.7                0.00
tyfkda                       34           79.1         17.8                0.00

これは貢献度を測れます。さらにHTMLでの出力もサポートしています。

さらに歴史の長いプロジェクトではグラフが細かく見られます。

さらに疑わしい(行数が多い?)コードの一覧も。

Gitinspectorを使って自社のGitリポジトリを解析してみても面白いかも知れません。コード量がそのまま貢献しているとは言えませんが、gitinspectorを通して読み取れる情報は多そうです。

GitinspectorはPython製のオープンソース・ソフトウェア(GPL v3)です。

Repository statistics for django ejwa/gitinspector: The statistical analysis tool for git repositories