microsoft / vscode-textmate
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 260 units with 3,208 lines of code in units (81.3% of code).
    • 4 very long units (529 lines of code)
    • 4 long units (244 lines of code)
    • 24 medium size units (742 lines of code)
    • 52 small units (760 lines of code)
    • 176 very small units (933 lines of code)
16% | 7% | 23% | 23% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts16% | 7% | 23% | 23% | 28%
js0% | 0% | 0% | 34% | 65%
go0% | 0% | 0% | 100% | 0%
cs0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src16% | 7% | 23% | 23% | 28%
benchmark0% | 0% | 0% | 34% | 65%
test-cases/themes/go/colorize-fixtures0% | 0% | 0% | 100% | 0%
test-cases/onigtests/fixtures0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
161 42 3
137 49 2
function _parse()
in src/plist.ts
116 27 3
function scanNext()
in src/grammar.ts
115 27 0
76 20 1
62 20 3
54 12 3
function handleCaptures()
in src/grammar.ts
52 14 6
constructor()
in src/rule.ts
46 11 3
45 12 6
45 6 0
44 12 2
43 9 0
42 8 7
38 14 5
36 9 2
constructor()
in src/grammar.ts
32 6 3
public compileAG()
in src/rule.ts
31 9 3
30 9 3
public static set()
in src/grammar.ts
29 7 6