cdklabs / jsii-docgen
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 251 units with 2,480 lines of code in units (77.7% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 26 medium size units (753 lines of code)
    • 63 small units (877 lines of code)
    • 161 very small units (798 lines of code)
0% | 2% | 30% | 35% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 2% | 30% | 35% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/docgen/transpile0% | 4% | 18% | 40% | 36%
src/docgen/render0% | 0% | 54% | 33% | 12%
src/docgen/view0% | 0% | 32% | 24% | 42%
src/docgen0% | 0% | 0% | 56% | 43%
src0% | 0% | 0% | 41% | 58%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public toJson()
in src/docgen/transpile/transpile.ts
52 10 0
public visitProperty()
in src/docgen/render/markdown-render.ts
45 7 1
public typeReference()
in src/docgen/transpile/transpile.ts
45 12 1
public async toJson()
in src/docgen/view/documentation.ts
43 10 1
public visitParameter()
in src/docgen/render/markdown-render.ts
40 6 1
public visitInterface()
in src/docgen/render/markdown-render.ts
35 6 1
public callable()
in src/docgen/transpile/java.ts
34 4 1
public visitClass()
in src/docgen/render/markdown-render.ts
32 5 1
private async npmCommandPath()
in src/docgen/view/_npm.ts
30 5 0
private async runCommand()
in src/docgen/view/_npm.ts
30 2 3
public visitEnumMember()
in src/docgen/render/markdown-render.ts
29 3 1
public callable()
in src/docgen/transpile/python.ts
29 5 1
function assertSuccess()
in src/docgen/view/_npm.ts
28 13 1
public type()
in src/docgen/transpile/java.ts
27 5 1
public visitStruct()
in src/docgen/render/markdown-render.ts
26 3 1
public toString()
in src/docgen/transpile/transpile.ts
26 7 1
private async createAssembly()
in src/docgen/view/documentation.ts
26 5 2
public render()
in src/docgen/render/markdown-doc.ts
25 6 1
public visitInitializer()
in src/docgen/render/markdown-render.ts
24 3 1
public visitInstanceMethod()
in src/docgen/render/markdown-render.ts
24 3 1