Codebase metrics¶
A measured snapshot of the kessai codebase and its submodules,
counted with cloc. Charts show code lines
(blank and comment lines excluded) unless stated otherwise.
Snapshot
Measured on the 1.x branch, 2026-07-31. 102 files,
7,931 lines of code, 5,520 comment lines,
1,674 blank (15,125 lines in total). See
Methodology to reproduce.
At a glance¶
| Code | Comment | Blank | Files | Production | Test |
|---|---|---|---|---|---|
| 7,931 | 5,520 | 1,674 | 102 | 5,202 | 2,729 |
Production vs test¶
kessai ships 2,729 lines of test code backing 5,202 lines of production code, a 52% test-to-production ratio.
Lines by language¶
| Language | Code | Comment | Blank | Files |
|---|---|---|---|---|
| PHP | 5,899 | 5,461 | 1,233 | 61 |
| Markdown | 1,145 | 0 | 303 | 8 |
| YAML | 547 | 54 | 15 | 24 |
| PO File | 286 | 5 | 123 | 5 |
| JSON | 25 | 0 | 0 | 2 |
| Text | 16 | 0 | 0 | 1 |
| SVG | 13 | 0 | 0 | 1 |
Composition¶
Across all languages, code is 52% of the lines, comments 36%, and blank lines 11%. The comment share reflects Drupal's docblock conventions.
By submodule¶
Production (brass) and test (steel) code per submodule, largest first.
| Submodule | Production | Test | Total |
|---|---|---|---|
| kessai (core) | 3,148 | 1,464 | 4,612 |
| kessai_worldline | 1,344 | 950 | 2,294 |
| kessai_simulator | 312 | 116 | 428 |
| kessai_views | 284 | 50 | 334 |
| kessai_audit_trail | 114 | 149 | 263 |
Test suite¶
kessai ships 17 automated test classes (142 test methods), counted by type below.
| Test type | Classes | Methods |
|---|---|---|
| Kernel | 14 | 123 |
| Functional | 3 | 19 |
| Unit | 0 | 0 |
| FunctionalJavascript | 0 | 0 |
| Total | 17 | 142 |
Architecture surface¶
What the module contains, counted across kessai and its submodules: the Drupal building blocks (services, plugins, hooks, routes, entities) that make up its public and internal API.
| Element | Count |
|---|---|
| Services | 7 |
| Event subscribers | 1 |
| Hook implementations | 4 |
| Routes | 6 |
| Permissions | 1 |
| Forms | 3 |
| Controllers | 3 |
| Content entity types | 1 |
| Config entity types | 0 |
| Config schema types | 2 |
| Plugins | 3 |
Plugins break down by type as follows, largest first:
Methodology¶
This page is generated by
scripts/generate-metrics.php,
which reads the per-file JSON from cloc and writes this file. It executes no
commands: run cloc yourself and pipe it in,
from the module root, after a change worth reflecting:
cloc --exclude-dir=node_modules --by-file --json --quiet . | php scripts/generate-metrics.php
Line counts come from cloc per file, excluding node_modules. Each file is
attributed to the nearest enclosing module (a directory with a *.info.yml);
test-support modules under a tests/ path count as their parent's test code. A
file is test code when its path contains a tests/ segment, production
otherwise.
Test classes are counted by their directory under tests/src (Unit, Kernel,
Functional, FunctionalJavascript); the method column counts test-prefixed
methods plus those annotated @test or #[Test]. The architecture surface counts
service definitions in *.services.yml (excluding aliases), route and permission
keys in *.routing.yml and *.permissions.yml, #[Hook] attributes, plugin
classes under src/Plugin/, forms and controllers under src/Form and
src/Controller, entity-type attributes in src/Entity, and top-level types in
config/schema/*.yml, all summed across the module and its submodules.
The charts are static inline SVG generated from the measured data, so they need no JavaScript or charting plugin.