Per-folder rollup. Files are counted in their direct parent directory only
(no cumulative ancestor totals), so every file contributes to exactly one
folder row and rows are directly comparable.
The complexity of a file’s code: one path per function, or one for the
whole file where the language has no function marker the scan can trust,
plus one per branch. Prose, data and markup have no paths: an “if” in a
README or an HTML attribute is a word, and a lock file full of ||
version ranges is not code.
False for prose and data formats, whose “if” and || are words and
version ranges rather than branches. One half of is_code: a format
that can never have a branch can never have complexity above zero.
Whether a format counts as the project’s code: prose and data
(has_control_flow) and markup (is_markup) do not. This one test
decides where complexity can be above zero, and through that which files
are health::compute’s “code files”; a format-level duplication
breakdown leaves the same formats out.
Markup, stylesheets, declarative schemas and the templating languages
built on top of markup: a duplicated template or style rule repeating is
not the maintenance problem duplicated programming logic is, so it does
not count toward the health score’s duplication share at all — the same
treatment prose and data files get, just decided per clone rather than
per file, since a .svelte or .vue file’s markup and style blocks are
tokenized separately from its script block. The other half of
is_code: whole files in these formats have no complexity either — the
“if” in an HTML attribute and the “and” in a media query are words, not
branches.
The complexity of the code from byte start to byte end of a file with
these tokens, such as one function: one path plus one per branch in it.
The branches of a function nested in the span count too. 0 for prose,
data and markup.