awslabs / graphql-schema-utilities
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 48 units with 507 lines of code in units (43.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 5 medium size units (137 lines of code)
    • 15 small units (218 lines of code)
    • 28 very small units (152 lines of code)
0% | 0% | 27% | 42% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 0% | 27% | 42% | 29%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 27% | 42% | 29%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
37 4 1
33 5 4
23 6 1
function printArgs()
in src/printers.ts
23 3 2
21 2 3
20 1 2
19 5 1
19 8 1
18 3 4
function printType()
in src/printers.ts
16 7 1
function printDescription()
in src/printers.ts
16 4 3
15 3 2
function printEnum()
in src/printers.ts
14 1 1
function printFields()
in src/printers.ts
13 1 1
function constructErrorMessage()
in src/validate-schema.ts
12 1 3
12 6 1
11 2 3
function printObject()
in src/printers.ts
11 2 1
function printDirective()
in src/printers.ts
11 2 1
function breakLine()
in src/printers.ts
11 3 2