Codebase metrics¶
A measured snapshot of the Domain Path codebase and its submodules,
counted with cloc. Charts show code lines
(blank and comment lines excluded) unless stated otherwise.
Snapshot
Measured on the 3.x branch, 2026-10-22, with cloc 2.08. 98 files,
5,883 lines of code, 2,590 comment lines,
1,402 blank (9,875 lines in total). See
Methodology to reproduce.
At a glance¶
| Code | Comment | Blank | Files | Production | Test |
|---|---|---|---|---|---|
| 5,883 | 2,590 | 1,402 | 98 | 2,963 | 2,920 |
Production vs test¶
Domain Path ships 2,920 lines of test code backing 2,963 lines of production code, a 99% test-to-production ratio.
Lines by language¶
| Language | Code | Comment | Blank | Files |
|---|---|---|---|---|
| PHP | 4,906 | 2,541 | 1,214 | 75 |
| Markdown | 463 | 0 | 181 | 6 |
| CSS | 258 | 0 | 0 | 1 |
| YAML | 218 | 49 | 7 | 12 |
| Text | 19 | 0 | 0 | 2 |
| JSON | 16 | 0 | 0 | 1 |
| SVG | 3 | 0 | 0 | 1 |
Composition¶
Across all languages, code is 60% of the lines, comments 26%, and blank lines 14%. The comment share reflects Drupal's docblock conventions.
By submodule¶
Production (brass) and test (steel) code per submodule, largest first.
| Submodule | Production | Test | Total |
|---|---|---|---|
| domain_path (core) | 2,321 | 2,038 | 4,359 |
| domain_path_pathauto | 642 | 882 | 1,524 |
Test suite¶
Domain Path ships 35 automated test classes (95 test methods), counted by type below.
| Test type | Classes | Methods |
|---|---|---|
| Functional | 17 | 21 |
| Kernel | 16 | 69 |
| FunctionalJavascript | 2 | 5 |
| Unit | 0 | 0 |
| Total | 35 | 95 |
Architecture surface¶
What the module contains, counted across Domain Path and its submodules: the Drupal building blocks (services, plugins, hooks, routes, entities) that make up its public and internal API.
| Element | Count |
|---|---|
| Services | 18 |
| Event subscribers | 0 |
| Hook implementations | 10 |
| Routes | 1 |
| Permissions | 1 |
| Forms | 2 |
| Controllers | 0 |
| Content entity types | 0 |
| Config entity types | 0 |
| Config schema types | 1 |
| Plugins | 11 |
Plugins break down by type as follows, largest first:
Methodology¶
Counts are produced with cloc, run from
the project root over the files git ls-files reports, so a checkout that has
installed vendor/, previewed the docs into site/ or pulled a
node_modules/ counts the same as the archive a release ships. The Tugboat
preview scaffolding in .tugboat/ is left out, and so is this page,
because a page that counts itself changes the tree it just
measured. The snapshot above names the cloc version,
because cloc counts differently from one version to the next.
git ls-files | grep -v -e '^docs/metrics\.md$' -e '^\.tugboat/' > files.txt
cloc --list-file=files.txt
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 each test-prefixed
method, and each further one 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. They are decorative and marked
aria-hidden: every figure one of them draws is also in the table or the
sentence beside it, so a screen reader gets the numbers rather than an image
with no name. An img role carrying no accessible name is worse than no role
at all, because it hides the labels inside the chart as well.