microsoft / llvm-mctoll
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 493 units with 16,182 lines of code in units (43.4% of code).
    • 33 very long units (8,507 lines of code)
    • 38 long units (2,695 lines of code)
    • 81 medium size units (2,629 lines of code)
    • 86 small units (1,290 lines of code)
    • 255 very small units (1,061 lines of code)
52% | 16% | 16% | 7% | 6%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp53% | 16% | 16% | 7% | 5%
h0% | 0% | 0% | 15% | 84%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
X8664% | 18% | 10% | 4% | 2%
ROOT46% | 13% | 21% | 10% | 7%
ARM/DAG72% | 14% | 5% | 1% | 5%
ARM9% | 28% | 29% | 17% | 15%
RISCV0% | 0% | 0% | 25% | 74%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void InstSelector::selectCode()
in ARM/DAG/InstSelector.cpp
945 356 1
615 212 1
void IREmitter::emitSpecialNode()
in ARM/DAG/IREmitter.cpp
521 65 1
460 125 2
421 109 4
375 63 3
357 172 1
356 95 6
354 73 4
bool X86MachineInstructionRaiser::raiseCallMachineInstr()
in X86/X86MachineInstructionRaiser.cpp
308 91 1
286 98 1
281 66 8
250 61 1
227 58 0
bool X86MachineInstructionRaiser::raiseMoveToMemInstr()
in X86/X86MachineInstructionRaiser.cpp
222 116 2
219 94 2
210 59 1
186 69 3
180 37 7
148 30 6