Skip to main content

Module stats

Module stats 

Source
Expand description

Counting a repo, and counting a review.

Two tallies over the same crate::language table: the working tree’s lines per language, which needs a read per file, and the diff’s churn per language, which the model already holds. Both are pure functions of what they are handed, so the caller decides which thread pays.

Structs§

LanguageChurn
One language’s share of a review.
LanguageCount
How much of one language a repo holds.
RepoStats
The whole scan: one entry per language, heaviest first, plus what it skipped.

Functions§

review_mix
What the review is written in, busiest language first. Files in no known language are left out: naming them would take a row from the languages the reader can act on.
scan
Count every path under root, grouped by language and ordered by code lines. Reads each file once; a path that is binary, oversized or unreadable is counted as skipped and never parsed.
scan_repo
Scan a checkout from its root, opening the backend here so the whole job, the index read included, happens on the caller’s thread. extra carries what git does not track yet, the status screen’s untracked files.