Skip to content

Codebase metrics

A measured snapshot of the PDV 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. 378 files, 28,199 lines of code, 13,414 comment lines, 5,555 blank (47,168 lines in total). See Methodology to reproduce.

At a glance

Code Comment Blank Files Production Test
28,199 13,414 5,555 378 20,947 7,252

Production vs test

PDV ships 7,252 lines of test code backing 20,947 lines of production code, a 35% test-to-production ratio.

Production 20,947 · 74% Test 7,252 · 26%

Lines by language

PHP 22,450 YAML 2,288 Markdown 1,674 PO File 1,456 CSS 115 Text 111 JSON 48 HTML 19 JavaScript 19 SVG 19
Language Code Comment Blank Files
PHP 22,450 13,191 4,297 257
YAML 2,288 111 150 83
Markdown 1,674 1 406 17
PO File 1,456 11 674 10
CSS 115 86 22 5
Text 111 0 3 2
JSON 48 0 0 1
HTML 19 0 0 1
JavaScript 19 13 2 1
SVG 19 1 1 1

Composition

Across all languages, code is 60% of the lines, comments 28%, and blank lines 12%. The comment share reflects Drupal's docblock conventions.

Code 28,199 · 60% Comment 13,414 · 28%

By submodule

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

pdv (core) 19,149 pdv_client 2,603 pdv_webform 2,443 pdv_server_api 1,647 pdv_test_console 695 pdv_audit_trail 468 pdv_eca 270 pdv_message 241 pdv_vault 238 pdv_mail 192 pdv_client_audit_trail 118 pdv_client_api 59
Submodule Production Test Total
pdv (core) 15,111 4,038 19,149
pdv_client 1,644 959 2,603
pdv_webform 1,370 1,073 2,443
pdv_server_api 907 740 1,647
pdv_test_console 695 0 695
pdv_audit_trail 419 49 468
pdv_eca 160 110 270
pdv_message 152 89 241
pdv_vault 238 0 238
pdv_mail 119 73 192
pdv_client_audit_trail 73 45 118
pdv_client_api 59 0 59

Test suite

PDV ships 76 automated test classes (429 test methods), counted by type below.

Kernel 68 Functional 2 Unit 6
Test type Classes Methods
Kernel 68 393
Functional 2 9
Unit 6 27
Total 76 429

Architecture surface

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

Element Count
Services 52
Event subscribers 7
Hook implementations 15
Routes 61
Permissions 6
Forms 45
Controllers 17
Content entity types 5
Config entity types 3
Config schema types 11
Plugins 8

Plugins break down by type as follows, largest first:

MasterKeyWrap 2 ECA 2 WebformElement 1 WebformHandler 1 KeyInput 1 KeyType 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.