facebook / idb
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 697 units with 5,833 lines of code in units (10.5% of code).
    • 0 very long units (0 lines of code)
    • 14 long units (952 lines of code)
    • 47 medium size units (1,449 lines of code)
    • 83 small units (1,196 lines of code)
    • 553 very small units (2,236 lines of code)
0% | 16% | 24% | 20% | 38%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 16% | 16% | 19% | 47%
m0% | 18% | 27% | 24% | 28%
mm0% | 17% | 43% | 26% | 12%
h0% | 28% | 0% | 5% | 66%
swift0% | 0% | 21% | 7% | 70%
js0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
idb0% | 17% | 16% | 18% | 47%
idb_companion0% | 14% | 34% | 19% | 31%
Shims0% | 22% | 29% | 25% | 22%
FBControlCore0% | 13% | 22% | 26% | 37%
PrivateHeaders0% | 88% | 0% | 0% | 11%
FBDeviceControl0% | 0% | 62% | 0% | 37%
ROOT0% | 0% | 68% | 31% | 0%
website0% | 0% | 100% | 0% | 0%
FBSimulatorControl0% | 0% | 0% | 56% | 43%
XCTestBootstrap0% | 0% | 0% | 28% | 72%
Fixtures0% | 0% | 0% | 0% | 100%
fbxctest0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
96 1 2
92 9 4
90 5 0
70 8 2
69 2 2
66 1 2
64 5 2
64 5 2
62 1 2
59 8 2
58 7 2
55 1 2
55 9 2
52 14 2
50 7 2
50 11 2
48 11 3
48 9 0
45 6 1
45 8 3
43 9 2
40 6 3
38 11 1
38 18 1
37 4 2
35 1 2
33 1 2
33 7 2
33 3 4
32 2 0
31 6 2
31 7 3
31 7 3
31 6 0
30 4 4
30 6 3
30 6 3
29 1 2
29 9 1
28 6 3
27 6 2
27 5 3
26 13 4
26 3 2
26 7 1
25 1 2
24 6 1
24 4 1
24 6 2
24 5 3