Skip to main content

Module summary

Module summary 

Source

Structs§

FileSummary
Per-file summary row.
FolderSummary
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.
Summary
Codebase summary: top files and folder rollup.

Enums§

SummaryMetric
Metric used to rank files and folders in the summary.

Functions§

compute_summary
Compute the summary from detection results.
file_complexity
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.
has_control_flow
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.
is_code
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.
is_markup
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.
span_complexity
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.