templates

13 releases measured. Default branch at 16f83743, 2026-10-19, 1 files.

Source lines
193
+58.2% in a year
Maintainability index
59.2
+1.2 in a year
Mean CC per function
3.16
Functions with CC > 20
0
of 25
Size

Lines of code, comments and blank lines left out

Maintainability index

Mean over functions, weighted by their lines. Higher is better

Cyclomatic complexity per function

Lower is better

Hard to maintain

Share of functions, and of function code, past the usual limits. Lower is better

Least maintainable functions now

Function Location MI CC Lines
getTemplate lib/templates.js:215 45.4 14 30
<anonymous> lib/templates.js:49 50.4 7 22
parseDate lib/templates.js:9 51.8 8 17
<anonymous> lib/templates.js:29 57.1 6 12
<anonymous> lib/templates.js:113 58.6 4 12
isSafeUrl lib/templates.js:173 61.0 3 9
<anonymous> lib/templates.js:129 62.6 3 9
<anonymous> lib/templates.js:77 63.0 4 8
<anonymous> lib/templates.js:87 63.0 4 8
escapeMarkdown lib/templates.js:146 66.3 3 6
link lib/templates.js:188 67.5 2 6
image lib/templates.js:194 67.5 2 6
<anonymous> lib/templates.js:97 67.8 2 6
<anonymous> lib/templates.js:105 67.8 2 6
<anonymous> lib/templates.js:232 70.9 1 5
Every measured release 13
Release Date Files Source lines Functions MI Mean CC P90 CC Max CC CC > 10 CC > 20
default branch 2026-10-19 1 193 25 59.2 3.16 7 14 1 0
v2.0.4 2026-10-08 1 193 25 59.2 3.16 7 14 1 0
v2.0.3 2026-09-28 1 193 25 59.2 3.16 7 14 1 0
v2.0.2 2026-08-12 1 122 12 58.0 3.92 7 9 0 0
v2.0.1 2026-03-27 1 122 12 58.0 3.92 7 9 0 0
v2.0.0 2024-08-20 1 122 12 58.0 3.92 7 9 0 0
v1.0.8 2024-02-18 1 123 12 58.0 3.92 7 9 0 0
v1.0.7 2023-10-31 1 123 12 58.0 3.92 7 9 0 0
v1.0.6 2023-10-20 1 123 12 58.0 3.92 7 9 0 0
v1.0.5 2023-08-29 1 123 12 58.0 3.92 7 9 0 0
v1.0.4 2023-04-10 1 123 12 58.0 3.92 7 9 0 0
v1.0.3 2022-12-29 1 123 12 58.0 3.92 7 9 0 0
v1.0.2 2022-11-18 1 114 11 58.5 4.18 7 9 0 0
v1.0.1 2022-08-11 1 114 11 58.5 4.18 7 9 0 0
How the numbers are made

Library source only: lib/, src/, workers/, bin/ and top-level source files. Tests, examples, tooling, type declarations and generated or minified files are left out.

Source lines are lines carrying code, with blank lines and comments dropped.

Cyclomatic complexity (CC) counts the independent paths through a function: 1 plus every if, loop, case, catch, ternary, && / || / ??, optional chain and default parameter. Above 10 a function is commonly considered hard to test, above 20 hard to understand.

Maintainability index (MI) is computed per function as max(0, (171 - 5.2 ln(Halstead volume) - 0.23 CC - 16.2 ln(lines)) * 100 / 171), the 0 to 100 scale Visual Studio uses, where below 20 is poor. The repository figure weights each function by its lines. Code outside any function (lookup tables, schemas, declarations) counts toward size only. MI is driven mostly by size, so read it as a trend, not a grade.

A move from JavaScript to TypeScript adds type annotations to every function, which raises the Halstead volume and lowers MI without the logic changing. Expect a step at that release.

Measured Mon, 19 Oct 2026 19:28:19 GMT.