aws-samples / cdk-cognito-idp
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 50 units with 1,033 lines of code in units (65.2% of code).
    • 1 very long units (175 lines of code)
    • 5 long units (315 lines of code)
    • 8 medium size units (233 lines of code)
    • 14 small units (206 lines of code)
    • 22 very small units (104 lines of code)
16% | 30% | 22% | 19% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts16% | 30% | 22% | 19% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib49% | 47% | 0% | 0% | 3%
lambda0% | 32% | 25% | 32% | 8%
web0% | 0% | 50% | 26% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in lib/cognito-idp-stack.ts
175 5 3
public async handle()
in lambda/decode-verify-jwt-get.ts
86 15 1
public async userSave()
in lambda/database.ts
62 4 1
constructor()
in lib/static-site.ts
59 1 3
constructor()
in lib/cognito-rest-api.ts
57 3 3
public addResource()
in lib/resource-handler.ts
51 8 4
public async aapi()
in web/index.ts
44 7 3
public async handle()
in lambda/create-config.ts
43 4 1
public async init()
in web/index.ts
30 2 0
public async handle()
in lambda/user-post.ts
26 10 1
public async handle()
in lambda/user-delete.ts
26 7 1
22 3 0
21 4 0
public async getLoggedInUser()
in lambda/handler.ts
21 9 1
19 2 1
public failure()
in lambda/handler.ts
19 3 3
public async init()
in web/index-direct.ts
18 1 0
public async handle()
in lambda/user-get.ts
18 5 1
private userConvert()
in lambda/database.ts
17 4 1
16 2 1