facebookexperimental / fb-vscode
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 19,297 units with 229,699 lines of code in units (57.4% of code).
    • 98 very long units (13,758 lines of code)
    • 396 long units (26,499 lines of code)
    • 2,217 medium size units (67,019 lines of code)
    • 3,969 small units (57,647 lines of code)
    • 12,617 very small units (64,776 lines of code)
5% | 11% | 29% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts5% | 11% | 29% | 25% | 28%
js11% | 14% | 30% | 22% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/vs6% | 10% | 28% | 25% | 29%
build/monaco25% | 13% | 27% | 13% | 20%
build27% | 0% | 48% | 8% | 14%
extensions/emmet9% | 14% | 44% | 22% | 9%
build/lib2% | 27% | 39% | 15% | 15%
extensions/html-language-features8% | 14% | 27% | 32% | 16%
extensions/json-language-features21% | 11% | 37% | 11% | 17%
build/npm32% | 24% | 20% | 18% | 3%
extensions/git0% | 12% | 34% | 26% | 26%
extensions/typescript-language-features0% | 7% | 28% | 30% | 33%
extensions/npm0% | 10% | 32% | 27% | 28%
extensions/php-language-features0% | 23% | 40% | 18% | 17%
build/azure-pipelines0% | 21% | 16% | 38% | 23%
extensions/merge-conflict0% | 15% | 39% | 17% | 27%
extensions/extension-editing0% | 24% | 28% | 17% | 29%
extensions/grunt0% | 31% | 16% | 12% | 38%
src0% | 17% | 18% | 31% | 31%
extensions/markdown-language-features0% | 3% | 25% | 35% | 35%
extensions/configuration-editing0% | 16% | 25% | 24% | 33%
extensions/jake0% | 21% | 7% | 34% | 36%
extensions/gulp0% | 20% | 7% | 35% | 36%
extensions/css-language-features0% | 0% | 49% | 27% | 23%
extensions/theme-seti0% | 0% | 47% | 45% | 6%
extensions/debug-server-ready0% | 0% | 51% | 26% | 21%
extensions/debug-auto-launch0% | 0% | 87% | 0% | 12%
extensions/php0% | 0% | 68% | 25% | 6%
build/builtin0% | 0% | 32% | 29% | 38%
extensions/git-ui0% | 0% | 0% | 94% | 5%
extensions/typescript-basics0% | 0% | 0% | 31% | 68%
extensions/json0% | 0% | 0% | 63% | 36%
extensions/python0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 50 longest units
Unit# linesMcCabe index# params
517 32 8
365 52 0
251 57 2
244 54 3
221 71 4
219 13 0
217 54 4
201 46 1
195 1 1
180 51 1
176 1 0
168 25 1
166 24 3
159 36 0
158 47 0
154 39 7
153 27 2
152 23 0
151 33 2
151 3 1
150 48 1
149 17 1
147 30 2
146 42 7
145 19 1
145 28 2
143 22 2
140 36 3
138 44 2
137 20 2
136 17 0
136 28 2
135 21 0
134 66 6
134 65 2
134 34 6
133 19 2
133 38 1
133 7 1
133 36 0
132 71 2
132 21 0
132 26 2
131 19 2
131 24 3
130 13 5
130 37 0
130 24 0
130 21 0
130 14 4