apple / apple-llvm-infrastructure-tools
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 460 units with 5,789 lines of code in units (76.1% of code).
    • 4 very long units (524 lines of code)
    • 17 long units (1,090 lines of code)
    • 56 medium size units (1,722 lines of code)
    • 69 small units (1,030 lines of code)
    • 314 very small units (1,423 lines of code)
9% | 18% | 29% | 17% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
h10% | 23% | 27% | 16% | 21%
cpp20% | 11% | 40% | 18% | 8%
py0% | 10% | 29% | 19% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src12% | 21% | 29% | 17% | 19%
git_apple_llvm/git_tools0% | 33% | 18% | 10% | 37%
git_apple_llvm/am0% | 0% | 43% | 22% | 33%
git_apple_llvm/pr0% | 0% | 27% | 15% | 56%
src/tools0% | 0% | 45% | 26% | 28%
git_apple_llvm/ci0% | 0% | 0% | 64% | 35%
git_apple_llvm/config0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
int commit_interleaver::merge_targets()
in src/commit_interleaver.h
177 54 2
134 50 3
109 53 0
104 40 5
def git_apple_llvm_push()
in git_apple_llvm/git_tools/push.py
94 7 5
84 20 1
77 12 4
static int main_upstream()
in src/split2mono.cpp
72 30 3
68 19 8
67 16 2
64 27 6
int commit_interleaver::interleave()
in src/commit_interleaver.h
61 11 0
61 14 3
60 15 5
58 19 10
58 22 1
int table_streams::init()
in src/data_query.h
56 29 5
54 13 5
53 12 7
52 15 4