cdklabs / cdk-generate-synthetic-examples
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 61 units with 597 lines of code in units (88.3% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (104 lines of code)
    • 5 medium size units (128 lines of code)
    • 11 small units (147 lines of code)
    • 43 very small units (218 lines of code)
0% | 17% | 21% | 24% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 17% | 21% | 24% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 17% | 21% | 24% | 36%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export async function generateMissingExamples()
in src/generate-missing-examples.ts
53 9 2
function exampleValue()
in src/generate.ts
51 14 4
async function main()
in src/cdk-generate-synthetic-examples.ts
36 2 0
24 5 1
24 8 3
23 5 3
21 8 2
export function module()
in src/module-utils.ts
18 2 1
16 3 2
importName: escapeIdentifier()
in src/module-utils.ts
16 3 2
14 1 3
function analyzeTypeName()
in src/module-utils.ts
14 3 1
12 3 0
function parameterList()
in src/generate.ts
12 2 3
12 6 4
public render()
in src/declaration.ts
11 3 0
11 3 3
11 4 1
function correctConstructImport()
in src/generate-missing-examples.ts
10 4 1
function generateFixture()
in src/generate-missing-examples.ts
10 1 1