microsoft / dtslint
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 135 units with 1,905 lines of code in units (71.0% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (299 lines of code)
    • 23 medium size units (673 lines of code)
    • 41 small units (581 lines of code)
    • 66 very small units (352 lines of code)
0% | 15% | 35% | 30% | 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% | 15% | 35% | 30% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 23% | 30% | 27% | 17%
src/rules0% | 9% | 38% | 32% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
71 31 2
async function main()
in src/index.ts
65 16 0
function checkTag()
in src/rules/noRedundantJsdoc2Rule.ts
58 30 1
53 16 4
function removeTag()
in src/rules/noRedundantJsdoc2Rule.ts
52 25 2
function walk()
in src/rules/expectRule.ts
47 12 5
42 16 2
function walk()
in src/rules/npmNamingRule.ts
42 15 1
39 13 6
function main()
in src/updateConfig.ts
36 7 0
function parseAssertions()
in src/rules/expectRule.ts
34 7 1
function matchReadonlyArray()
in src/rules/expectRule.ts
34 13 2
32 8 4
export function addSuggestion()
in src/suggestions.ts
29 8 4
export function disabler()
in src/rules/npmNamingRule.ts
28 9 1
function getExpectTypeFailures()
in src/rules/expectRule.ts
27 6 4
function walk()
in src/rules/noPaddingRule.ts
27 12 1
function getSoleUse()
in src/rules/noUnnecessaryGenericsRule.ts
27 10 3
function parseOptions()
in src/rules/npmNamingRule.ts
26 10 1
25 6 5