Lines of Code Breakdown: A Compositional Analysis
Results of analyzing 10 million lines of code across the largest Open Source projects
There are a lot of tools that provide stats on lines of code (LoC). Conventional wisdom has long held that these metrics are fraught, but absent hard data, it has only been possible to gesture toward the disadvantages of relying on LoC, without statistical proof.
GitClear has previously asserted that only 5% of lines of code meaningfully evolve the repo's code base. Because it is an extraordinary claim that 95% of LoC is noise, it is beholden upon us to substantiate this claim with data. That is the purpose of this page.
The funnel below aggregates real world lines of code measurement across 150,754 commits in 58 open source repos between August 28, 2020 and November 27, 2020. On desktop, hover on a funnel step to get more details about it.
First step: All changed code lines
All changed code lines
Distinct: Ignore duplicated fragments
Effecting: Remove semantic lines
Substantive: Negate batch operations
Purposeful: Rinse commit artifacts
Meaningful lines of code
How much noise does your analysis tool let through?
Since other git stat tools (including those that profess to offer "Engineering Insights") neglect to process some or all of the steps above, the "insights" that they offer are as likely as not to be false positives or commit artifacts.