Skip to content

Codebase metrics

A measured snapshot of the Audit Trail 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-02. 218 files, 30,652 lines of code, 18,130 comment lines, 4,141 blank (52,923 lines in total). See Methodology to reproduce.

At a glance

Code Comment Blank Files Production Test
30,652 18,130 4,141 218 20,243 10,409

Production vs test

Audit Trail ships 10,409 lines of test code backing 20,243 lines of production code, a 51% test-to-production ratio.

Production 20,243 · 66% Test 10,409 · 34%

Lines by language

PHP 25,719 Markdown 3,253 YAML 1,320 JavaScript 125 CSS 122 Text 91 JSON 21 SVG 1
Language Code Comment Blank Files
PHP 25,719 17,840 3,457 149
Markdown 3,253 0 575 16
YAML 1,320 166 76 43
JavaScript 125 75 8 3
CSS 122 49 25 4
Text 91 0 0 1
JSON 21 0 0 1
SVG 1 0 0 1

Composition

Across all languages, code is 58% of the lines, comments 34%, and blank lines 8%. The comment share reflects Drupal's docblock conventions.

Code 30,652 · 58% Comment 18,130 · 34%

By submodule

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

audit trail (core) 24,347 audit_trail_tsa 3,449 audit_trail_entity 1,373 audit_trail_user_auth 669 audit_trail_file 421 audit_trail_entity_paragraphs 393
Submodule Production Test Total
audit trail (core) 16,090 8,257 24,347
audit_trail_tsa 2,415 1,034 3,449
audit_trail_entity 876 497 1,373
audit_trail_user_auth 410 259 669
audit_trail_file 273 148 421
audit_trail_entity_paragraphs 179 214 393

Test suite

Audit Trail ships 50 automated test classes (409 test methods), counted by type below.

Kernel 31 Functional 8 Unit 11
Test type Classes Methods
Kernel 31 337
Functional 8 24
Unit 11 48
Total 50 409

Architecture surface

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

Element Count
Services 28
Event subscribers 0
Hook implementations 28
Routes 34
Permissions 4
Forms 29
Controllers 5
Content entity types 0
Config entity types 3
Config schema types 14
Plugins 4

Plugins break down by type as follows, largest first:

AuditTrailFilter 2 ContextContributor 2

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.