microsoft / TypeScript-DOM-lib-generator
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 243 units with 3,387 lines of code in units (36.8% of code).
    • 1 very long units (127 lines of code)
    • 6 long units (381 lines of code)
    • 31 medium size units (898 lines of code)
    • 80 small units (1,228 lines of code)
    • 125 very small units (753 lines of code)
3% | 11% | 26% | 36% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts3% | 11% | 26% | 36% | 21%
js0% | 0% | 28% | 26% | 44%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src19% | 0% | 32% | 27% | 20%
src/build0% | 15% | 22% | 39% | 21%
src/build/bcd0% | 0% | 100% | 0% | 0%
deploy0% | 0% | 28% | 26% | 44%
src/build/webref0% | 0% | 0% | 77% | 22%
src/build/utils0% | 0% | 0% | 47% | 52%
unittests/files0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
127 20 0
export function emitWebIdl()
in src/build/emitter.ts
72 6 3
export function getExposedTypes()
in src/build/expose.ts
72 13 3
export function convert()
in src/build/widlprocess.ts
67 15 2
62 26 2
function emitProperty()
in src/build/emitter.ts
55 19 4
function emitIterator()
in src/build/emitter.ts
53 12 1
41 11 2
function mapInterfaceLike()
in src/build/bcd/mapper.ts
40 8 3
function emitMethods()
in src/build/emitter.ts
40 11 4
function convertNamespace()
in src/build/widlprocess.ts
40 6 2
function test()
in src/test.ts
39 12 0
function emitCallBackFunction()
in src/build/emitter.ts
38 7 1
function convertInterfaceCommon()
in src/build/widlprocess.ts
36 1 2
export function merge()
in src/build/helpers.ts
34 13 3
export function collectLegacyNamespaceTypes()
in src/build/legacy-namespace.ts
33 10 1
function processComments()
in src/fetch-comment.ts
33 8 1
async function updatePackageJSON()
in deploy/createTypesPackages.js
32 3 2
31 7 2
function convertOperation()
in src/build/widlprocess.ts
30 6 2