Skip to content
CAI
Software that uses CAICheck a score

antonkomarev/github-profile-views-counter

54.0

Weak · 19 September 2026

640

lines of production code

PHP

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a PHP-based service that tracks and displays per-user view counts via customizable, dynamically generated badges. It supports multiple storage backends, including file-based and PostgreSQL databases, while allowing users to configure badge appearance through query parameters. The application is designed for local development using Docker and follows a structured architecture with repository contracts and standardized exception handling.

Features

Introduce Docker-based local development environment

The application now supports containerized local development using Docker. This change adds configuration for an Nginx reverse proxy (listening on port 80), a PHP 8.2 FPM container with GD and PDO/PostgreSQL extensions, and a PHP-FPM pool configuration. It also includes security headers (HSTS, X-Frame-Options, etc.) and sets up the basic routing for PHP files via FastCGI.

.docker · high confidence

Behavioural changes

Introduction of repository contract and exception hierarchy

The contracts layer now defines a \CounterRepositoryInterface\ specifying methods to get and add view counts by username, replacing the previous implicit coupling. Additionally, a new \GitHubProfileViewsCounterThrowableInterface\ has been introduced to standardize exception handling, while the former \CounterImageRendererService\ class has been removed from this location as it is no longer part of the contracts.

contracts · high confidence

Refactored entry point to support dynamic badge configuration and environment-based storage

The public/index.php entry point has been rewritten to replace the hardcoded file-based repository and static image renderer with a factory-based architecture that supports dynamic badge styling, custom labels, base counts, and count abbreviation. It now parses request parameters for badge style, color, label, and base count, and uses a CounterRepositoryFactory to initialize storage, while also handling environment configuration errors gracefully by rendering error badges.

public · high confidence

Refactored view counting to support per-user storage and customizable badges

The view counting mechanism has been refactored to track views per user rather than a single global counter, using a new \CounterRepositoryInterface\ with implementations for both file-based (\CounterFileRepository\) and database-backed (\CounterPdoRepository\) storage. The file repository now uses file locking to prevent race conditions and stores individual view timestamps. Additionally, badge generation is now customizable, allowing users to specify the label, color, and style (including 'For The Badge' and abbreviated number formats) via query parameters.

src · high confidence

Dependencies

Initial release with PHP 8.1 and core dependencies

This change introduces the project's \composer.json\ and \composer.lock\ files, establishing the initial dependency set. It sets the minimum PHP version to 8.1 and includes \vlucas/phpdotenv\ (5.6.2), \webmozart/assert\ (1.11.0), and \badges/poser\ (3.1.1).

(dependencies) · high confidence

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

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 54.

Lenses

  • Code Health 100
  • Architecture 69
  • Maturity 43
  • Readiness 45
  • Security 94

Changes since last survey

  • 123 commits — 111 feature/other, 12 fixes

By area

  • (root) — 88 commits
  • public/index.php — 6 commits
  • public/database-repository.php — 5 commits
  • public/file-repository.php — 5 commits
  • contracts/CounterRepositoryInterface.php — 3 commits
  • resources/error-badge.svg — 3 commits
  • src/CounterFileRepository.php — 3 commits
  • src/BadgeImageRendererService.php — 2 commits
  • src/CounterImageRendererService.php — 2 commits
  • src/Username.php — 2 commits
  • .github/workflows — 1 commit
  • contracts/Exceptions — 1 commit
  • resources/views-count.svg — 1 commit
  • src/CounterDatabaseRepository.php — 1 commit

Notable commits

  • fix: :bug: Filter XSS injection (#31)
  • fix: Code style fix
  • fix: Fix badge URL
  • fix: Fix database table name
  • fix: Fix dynamic length
  • fix: Fix error badge size
  • fix: Fix exceptions namespace
  • fix: Fix image
  • fix: Fix text
  • fix: Fix text
  • fix: Fix undefined index warnings
  • fix: Fix undefined user agent warning (#17)
  • change: Ability to provide a base number to be added to the counter (#74)
  • change: Add "For The Badge" badge style (#45)
  • change: Add CounterRepositoryInterface
  • change: Add PDO repository (#2)
  • change: Add Procfile
  • change: Add Username Value Object (#6)
  • change: Add asserts to CounterFileRepository
  • change: Add composer.json
  • …and 103 more

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

Survey your own repository

antonkomarev/github-profile-views-counter 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 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 605c409deff5ac602ef3582bfc8a593426e5e511 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.