Skip to content

Codebase metrics

A measured snapshot of the Domain 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-07-02. 485 files, 34,899 lines of code, 14,633 comment lines, 7,329 blank (56,861 lines in total). See Methodology to reproduce.

At a glance

Code Comment Blank Files Production Test
34,899 14,633 7,329 485 22,460 12,439

Production vs test

Domain ships 12,439 lines of test code backing 22,460 lines of production code, a 55% test-to-production ratio.

Production 22,460 · 64% Test 12,439 · 36%

Lines by language

PHP 22,698 Markdown 6,624 YAML 5,137 CSS 236 JavaScript 122 Text 39 JSON 25 Twig 18
Language Code Comment Blank Files
PHP 22,698 14,418 5,054 316
Markdown 6,624 0 2,115 43
YAML 5,137 67 77 117
CSS 236 69 69 1
JavaScript 122 65 14 4
Text 39 0 0 2
JSON 25 0 0 1
Twig 18 14 0 1

Composition

Across all languages, code is 61% of the lines, comments 26%, and blank lines 13%. The comment share reflects Drupal's docblock conventions.

Code 34,899 · 61% Comment 14,633 · 26%

By submodule

Production (brass) and test (steel) code per submodule, largest first.

domain 9,255 domain_access 3,805 domain_alias 3,462 domain_content 3,266 domain_source 3,206 domain_config_ui 2,164 domain_config 961 domain_config_language 924 domain_config_language_ui 891
Submodule Production Test Total
domain 5,070 4,185 9,255
domain_access 2,053 1,752 3,805
domain_alias 1,708 1,754 3,462
domain_content 3,003 263 3,266
domain_source 1,400 1,806 3,206
domain_config_ui 1,232 932 2,164
domain_config 430 531 961
domain_config_language 429 495 924
domain_config_language_ui 171 720 891

Test suite

Domain ships 118 automated test classes (290 test methods), counted by type below.

Kernel 29 Functional 82 FunctionalJavascript 6 Unit 1
Test type Classes Methods
Kernel 29 176
Functional 82 106
FunctionalJavascript 6 6
Unit 1 2
Total 118 290

Architecture surface

What the module contains, counted across Domain and its submodules: the Drupal building blocks (services, plugins, hooks, routes, entities) that make up its public and internal API.

Element Count
Services 72
Event subscribers 0
Hook implementations 54
Routes 19
Permissions 24
Forms 9
Controllers 5
Content entity types 0
Config entity types 2
Config schema types 44
Plugins 49

Plugins break down by type as follows, largest first:

Action 16 views 13 Validation 10 Block 5 Condition 2 EntityReferenceSelection 2 LanguageNegotiation 1

Methodology

Counts are produced with cloc from the module root, excluding node_modules:

cloc --exclude-dir=node_modules .

Production and test totals split on the test directory:

# production
cloc --exclude-dir=node_modules --not-match-d='(^|/)tests(/|$)' .
# test
cloc --exclude-dir=node_modules --match-d='(^|/)tests(/|$)' .

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, 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 JSON that cloc emits, so they need no JavaScript or charting plugin. This page is refreshed periodically.