microsoft / dts-gen
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 36 units with 503 lines of code in units (76.0% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (71 lines of code)
    • 7 medium size units (212 lines of code)
    • 9 small units (128 lines of code)
    • 19 very small units (92 lines of code)
0% | 14% | 42% | 25% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 14% | 42% | 25% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib0% | 15% | 37% | 27% | 19%
browser0% | 0% | 90% | 0% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function getResult()
in lib/index.ts
71 19 0
async function getIndex()
in lib/definitely-typed.ts
48 15 2
(function()()
in browser/browser.ts
40 1 1
36 12 1
function visit()
in lib/index.ts
24 9 1
22 6 2
function getTSConfig()
in lib/definitely-typed.ts
21 1 1
21 1 0
18 4 3
17 11 1
16 5 1
15 5 2
14 5 1
function loadString()
in lib/definitely-typed.ts
13 4 1
13 4 2
async function run()
in lib/definitely-typed.ts
11 2 4
11 3 2
10 1 1
8 1 1
7 1 1