microsoft / node-jsonc-parser
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 54 units with 1,290 lines of code in units (82.2% of code).
    • 4 very long units (478 lines of code)
    • 1 long units (75 lines of code)
    • 14 medium size units (449 lines of code)
    • 11 small units (179 lines of code)
    • 24 very small units (109 lines of code)
37% | 5% | 34% | 13% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts38% | 5% | 35% | 11% | 8%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/impl39% | 6% | 36% | 9% | 7%
build0% | 0% | 0% | 100% | 0%
src0% | 0% | 0% | 62% | 37%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function scanNext()
in src/impl/scanner.ts
133 45 0
export function format()
in src/impl/format.ts
128 47 3
113 40 4
export function getLocation()
in src/impl/parser.ts
104 22 2
function scanString()
in src/impl/scanner.ts
75 19 0
export function parseTree()
in src/impl/parser.ts
48 5 3
function scanNext()
in src/impl/parser.ts
45 15 0
function parseArray()
in src/impl/parser.ts
40 12 0
function scanNumber()
in src/impl/scanner.ts
40 20 0
export function parse()
in src/impl/parser.ts
36 1 3
31 13 2
export function visit()
in src/impl/parser.ts
31 7 3
function parseObject()
in src/impl/parser.ts
30 10 0
function withFormatting()
in src/impl/edit.ts
26 9 3
function parseLiteral()
in src/impl/parser.ts
26 6 0
export function stripComments()
in src/impl/parser.ts
25 7 2
function scanHexDigits()
in src/impl/scanner.ts
25 10 2
export function createScanner()
in src/impl/scanner.ts
24 2 2
export function getNodeValue()
in src/impl/parser.ts
22 9 1
function deleteRefs()
in build/remove-sourcemap-refs.js
20 6 1