aws-samples / aws-saas-factory-eks-saas-workshop
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 162 units with 1,775 lines of code in units (26.2% of code).
    • 2 very long units (281 lines of code)
    • 3 long units (210 lines of code)
    • 14 medium size units (430 lines of code)
    • 24 small units (366 lines of code)
    • 119 very small units (488 lines of code)
15% | 11% | 24% | 20% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts15% | 11% | 24% | 20% | 27%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cdk/root/lib37% | 47% | 0% | 9% | 6%
cdk/eks/lib100% | 0% | 0% | 0% | 0%
services/application/apps0% | 0% | 64% | 11% | 23%
services/shared/apps0% | 0% | 40% | 34% | 25%
services/application/libs0% | 0% | 69% | 15% | 15%
client/web/application0% | 0% | 0% | 43% | 56%
client/web/admin0% | 0% | 0% | 23% | 76%
services/shared/libs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in cdk/root/lib/tenant-infra/tenant-infra-stack.ts
166 1 3
constructor()
in cdk/eks/lib/eks-stack.ts
115 1 3
constructor()
in cdk/root/lib/baseline-infra/baseline-infra-stack.ts
98 1 3
constructor()
in cdk/root/lib/admin/admin-stack.ts
57 2 3
constructor()
in cdk/root/lib/root-stack.ts
55 1 3
private async createUserPool()
in services/shared/apps/tenant-registration/src/idp-service/idp.service.ts
50 4 2
async findAll()
in services/application/apps/user/src/users/users.service.ts
44 3 2
async update()
in services/application/apps/product/src/products/products.service.ts
40 2 3
async findOne()
in services/application/apps/order/src/orders/orders.service.ts
33 3 2
async findAll()
in services/application/apps/order/src/orders/orders.service.ts
32 2 1
async getAuthInfo()
in services/shared/apps/tenant-management/src/tenants/tenants.service.ts
31 2 1
async getPlanBasedUserPool()
in services/shared/apps/tenant-registration/src/idp-service/idp.service.ts
30 4 3
async create()
in services/application/apps/user/src/users/users.service.ts
28 2 3
async findOne()
in services/application/apps/product/src/products/products.service.ts
25 3 2
async getCredentials()
in services/application/libs/auth/src/credential-vendor.ts
25 4 1
async findAll()
in services/application/apps/product/src/products/products.service.ts
24 2 1
public async getClient()
in services/application/libs/client-factory/src/client-factory.service.ts
24 2 2
private async store()
in services/shared/apps/tenant-registration/src/registration/registration.service.ts
23 1 1
async findAll()
in services/shared/apps/tenant-management/src/tenants/tenants.service.ts
21 2 0
onSubmit()
in client/web/admin/src/app/tenants/create.component.ts
20 1 0