Skip to content
CAI
Software that uses CAICheck a score

tomgi/git_stats

41.2

Weak · 6 November 2026

986

lines of production code

Ruby

with JavaScript

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

GitStats is a Ruby gem that analyzes Git repositories to generate static HTML reports detailing project activity and code statistics. It provides a command-line interface and a Ruby API to compute metrics such as author contributions, file changes, and time-based commit trends. The system renders these insights into multi-page, multi-language web views using Highstock for data visualization.

Features

Added localization support for Bulgarian, German, Polish, Spanish, Turkish, and Chinese

The application now supports multiple languages. New locale files have been added for Bulgarian (bg), German (de), Polish (pl), Spanish (es), Turkish (tr), Simplified Chinese (zh), and Traditional Chinese (zh\_tw), including specific date, time, and number formatting defaults for German, Polish, and Traditional Chinese. Users can now view reports and interface elements in these languages.

config · high confidence

GitStats gem initialized at version 1.0.17

The lib/git\_stats directory now contains the full source for the GitStats gem (version 1.0.17), providing a CLI tool to generate repository statistics. Users can generate reports via the \generate\ command, specifying options for the repository path, output directory, language (with I18n support), commit range, and comment string detection. The tool supports silent mode and validates that the target path is a valid git repository.

_lib/git\stats · high confidence

Initial release of GitStats gem with CLI and API

This change introduces the GitStats gem, a tool that browses git repositories and generates HTML statistics pages. It provides a command-line interface (via \git\_stats generate\) with options for specifying repository paths, output directories, commit ranges, and tree scopes, as well as a Ruby API for programmatic access to repository data. The release includes configuration for Travis CI testing across multiple Ruby versions, RSpec for unit testing, and integration test submodules.

(repo-wide) · high confidence

Introduction of the git\_stats CLI entry point

A new executable script named bin/git\_stats has been added to the project. This script initializes the Ruby load path to include the local lib directory and starts the GitStats command-line interface by invoking GitStats::CLI.start with the provided arguments, enabling users to run the tool directly from the command line.

bin · high confidence

New activity and repository data models for commit statistics

The git\_stats library now includes new data classes to structure repository analysis. The \Activity\ class aggregates commit timestamps to provide breakdowns by date, hour, day of week, month, and year, enabling time-based trend charts. The \Repo\ class has been expanded to expose author statistics (including lines added/deleted by author), file and line counts by date, and comment statistics (counting lines starting with \///\), while also supporting optional commit ranges and tree paths for scoped analysis.

_lib/git\_stats/git\data · high confidence

New author activity visualization with time-based breakdowns

The templates now include a new activity view that breaks down author contributions by date, hour of day, day of week, hour of week, month, year, and year-month. This is implemented via a shared partial template that renders specific charts or tables for each time granularity, allowing users to see when commits occurred throughout the week, day, or year. The UI uses Bootstrap 2.1.1 for styling and layout, including responsive design support.

templates · high confidence

New core library extensions for Ruby standard types

This change introduces a new set of core extensions for Ruby's standard library types (Enumerable, Hash, String, and Symbol) within the git\_stats library. Enumerable gains a first! method that raises an error if no element matches the block. Hash receives to\_key\_indexed\_array for converting numeric-keyed hashes to arrays, and fill\_empty\_days! to populate missing dates in time-series data with aggregated or zero values. String adds an absolute\_path helper for path resolution, and Symbol adds a t method for internationalization lookups.

_lib/git\_stats/core\extensions · high confidence

New git\_stats module for repository activity and code statistics

The git\_stats feature has been implemented, providing detailed statistics on repository activity and code changes. This includes tracking author contributions (commits, insertions, deletions, and changed lines), file-level metrics (files and lines by extension, date), and activity trends (by hour, day of week, month, and year). The module also supports comment statistics, counting lines beginning with three slashes as documentation comments, and uses the --no-rename option for git statistics to ensure consistent insertion/deletion counts across operating systems.

_git\stats · high confidence

Behavioural changes

Library renamed from Gitstats to GitStats

The library has been renamed from 'Gitstats' to 'GitStats' to avoid conflict with an existing gem. This change involves deleting the original 'lib/gitstats.rb' and 'lib/gitstats/version.rb' files and introducing a new 'lib/git\_stats.rb' entry point that defines the 'GitStats' module and loads its dependencies.

lib · high confidence

Refactored chart generation into dedicated view classes

The chart rendering logic in the stats view has been reorganized into specific classes (ActivityCharts, AuthorsCharts, RepoCharts, and Chart) to improve maintainability. This change introduces new visualizations, including activity breakdowns by hour, day of week, month, and year, as well as author-specific line insertion/deletion trends over time. The underlying chart builder now uses Highstock for date-based series, ensuring that days without commits are correctly represented on timelines rather than being omitted.

_lib/git\_stats/stats\view/charts · high confidence

Refactored stats view to use absolute paths and separate pages

The stats view rendering logic has been refactored to support use as a gem by resolving template paths as absolute paths, ensuring correct file resolution regardless of the working directory. The view now generates separate HTML pages for different sections (general, activity, authors, files, lines, comments) rather than using tabs, and includes specific support for author activity and comment statistics (counting only lines beginning with three slashes). The output directory is automatically created if it does not exist, and static assets are copied to the output path.

_lib/git\_stats/stats\view · high confidence

Test coverage

Added integration tests for Git data analysis; Added test coverage for GitStats data models and repository operations; Added test infrastructure and specifications.

Dependencies

Initial gemspec and dependency configuration for git\_stats

The project introduces the \git\_stats\ gemspec, replacing the previous \gitstats\ gemspec, and defines its runtime and development dependencies. Runtime dependencies include ActionPack and ActiveSupport (4.2), HAML (5.0), i18n (0.8), json\_pure (2.1), lazy\_high\_charts (1.5), Thor (0.20), and Tilt (2.0), with a minimum Ruby version requirement of 1.9.2. Development dependencies are set for factory\_girl (4.7), pry (0.11), rake (12.0), rspec (3.4), and simplecov (0.11). The Gemfile is updated to reference the new gemspec.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 41 → 41 (+0.1)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.2) — scores are not directly comparable.

Lenses

  • Code Health 72 → 74 (+2.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 43 → 43 (+0.0)
  • Readiness 45 → 45 (+0.0)
  • Security 97 → 98 (+0.9)
  • Accessibility 28 → 28 (+0.0)

Resolved (3)

  • Duplication of aggregation logic between Domain and View layers. Activity provides raw aggregation methods (e.g., by_date), while ActivityCharts provides identical methods (e.g., activity_by_date) that likely perform the same grouping. This violates DRY principles and creates two sources of truth for the same data transformation.
  • Inconsistent naming and scope for author-based aggregations. Repo has a method for counting commits by author, while the View layer has a method for summing commits by author by date. The naming conventions differ (commits_count vs commits_sum), and the scope (total count vs time-series sum) is not clearly distinguished by naming, leading to potential confusion about which method to use for specific reporting needs.
  • Redundant execution interfaces. Repo exposes both a direct run and a run_and_parse method, while also exposing a dedicated CommandRunner component. The CommandRunner class exists to encapsulate execution logic, but Repo duplicates this capability directly, creating confusion about whether to use the component or the direct method.

Architecture

  • Unchanged — 0 containers · 1 contexts · 0 edges

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

tomgi/git_stats was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 6 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 89f771ededd37b0684b9a2a627789ff614b5d310 — the exact code this score is about.
  • Scored under rubric-2026.11.2 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.3+preprod-60d1b390edf0.