facebook / bistro
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 1,425 units with 17,835 lines of code in units (62.1% of code).
    • 8 very long units (971 lines of code)
    • 50 long units (3,435 lines of code)
    • 177 medium size units (5,622 lines of code)
    • 241 small units (3,556 lines of code)
    • 949 very small units (4,251 lines of code)
5% | 19% | 31% | 19% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp9% | 27% | 32% | 17% | 13%
py4% | 10% | 33% | 22% | 28%
php2% | 22% | 31% | 20% | 23%
h0% | 6% | 11% | 19% | 62%
c0% | 0% | 100% | 0% | 0%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
bistro/runners30% | 16% | 34% | 10% | 7%
build/fbcode_builder2% | 11% | 36% | 22% | 28%
web_ui/src2% | 22% | 31% | 20% | 23%
bistro/processes12% | 33% | 13% | 22% | 18%
bistro/cmake71% | 0% | 0% | 20% | 8%
bistro90% | 0% | 0% | 0% | 9%
bistro/worker19% | 10% | 53% | 11% | 5%
bistro/remote0% | 31% | 34% | 8% | 25%
bistro/server0% | 35% | 26% | 21% | 17%
bistro/scheduler0% | 43% | 42% | 6% | 6%
bistro/utils0% | 36% | 19% | 12% | 32%
bistro/thrift0% | 73% | 14% | 6% | 5%
bistro/config0% | 21% | 19% | 28% | 30%
bistro/monitor0% | 66% | 0% | 21% | 12%
bistro/statuses0% | 14% | 26% | 19% | 39%
bistro/cron0% | 9% | 40% | 30% | 19%
bistro/nodes0% | 0% | 70% | 12% | 17%
bistro/physical0% | 0% | 32% | 44% | 23%
web_ui/rsrc0% | 0% | 0% | 100% | 0%
bistro/sqlite0% | 0% | 0% | 5% | 94%
bistro/py0% | 0% | 0% | 14% | 85%
bistro/benchmark0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
145 15 5
128 13 3
127 1 0
120 16 4
120 25 1
115 8 2
109 19 1
107 17 7
96 6 0
95 22 7
93 12 9
91 11 7
91 16 5
88 23 6
82 17 7
81 20 2
80 16 0
79 7 2
78 1 1
78 1 1
78 7 0
76 16 0
76 25 4
75 17 1
75 14 9
75 1 0
73 16 1
73 19 2
72 19 2
70 17 1
70 15 2
70 11 1
69 7 2
69 13 2
67 9 0
66 9 0
64 1 2
63 1 1
62 6 3
62 22 1
61 9 0
60 17 3
59 14 2
58 20 1
57 10 0
57 10 1
57 1 2
56 14 1
55 9 6
55 3 2