cdklabs / decdk
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 62 units with 894 lines of code in units (94.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (84 lines of code)
    • 12 medium size units (381 lines of code)
    • 17 small units (258 lines of code)
    • 32 very small units (171 lines of code)
0% | 9% | 42% | 28% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts0% | 9% | 42% | 28% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 9% | 42% | 28% | 19%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function deserializeValue()
in src/declarative-stack.ts
84 28 5
42 11 2
41 11 2
function methodSchema()
in src/jsii2schema.ts
40 10 2
36 10 2
33 7 2
constructor()
in src/declarative-stack.ts
31 6 3
function deconstructType()
in src/declarative-stack.ts
31 9 3
export function isConstruct()
in src/jsii2schema.ts
30 8 1
function invokeMethod()
in src/declarative-stack.ts
27 10 3
26 8 2
public define()
in src/jsii2schema.ts
23 4 2
function isSerializableType()
in src/jsii2schema.ts
21 7 2
19 2 2
function deconstructStaticMethod()
in src/declarative-stack.ts
19 8 3
function deconstructGetAtt()
in src/declarative-stack.ts
19 4 3
function printWarnings()
in src/cdk-schema.ts
18 6 2
18 6 2
function deconstructInterface()
in src/declarative-stack.ts
17 5 4
async function main()
in src/decdk.ts
16 2 0