aws-samples / aws-saas-factory-ref-solution-serverless-saas
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 256 units with 2,830 lines of code in units (24.2% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (365 lines of code)
    • 34 medium size units (1,025 lines of code)
    • 48 small units (664 lines of code)
    • 169 very small units (776 lines of code)
0% | 12% | 36% | 23% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 14% | 43% | 23% | 18%
ts0% | 9% | 16% | 24% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
server/Resources0% | 40% | 28% | 15% | 14%
server/layers0% | 33% | 26% | 13% | 26%
server/TenantPipeline0% | 32% | 23% | 15% | 27%
server/custom_resources0% | 44% | 17% | 25% | 13%
server/TenantManagementService0% | 0% | 72% | 18% | 8%
clients/Application0% | 0% | 18% | 26% | 54%
server/ProductService0% | 0% | 26% | 42% | 30%
clients/Admin0% | 0% | 11% | 34% | 53%
server/OrderService0% | 0% | 12% | 53% | 34%
clients/Landing0% | 0% | 40% | 0% | 60%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __getPolicyForTenantAdmin()
in server/layers/auth_manager.py
88 2 4
constructor()
in server/TenantPipeline/lib/serverless-saas-stack.ts
78 1 3
def lambda_handler()
in server/Resources/shared_service_authorizer.py
74 14 2
def lambda_handler()
in server/Resources/tenant_authorizer.py
72 9 2
def do_action()
in server/custom_resources/update_usage_plan.py
53 2 2
def create_user()
in server/TenantManagementService/user-management.py
48 4 2
def __getPolicyForTenantUser()
in server/layers/auth_manager.py
47 1 3
def update_user()
in server/TenantManagementService/user-management.py
45 5 2
def activate_tenant()
in server/TenantManagementService/tenant-management.py
42 3 2
def create_user_pool()
in server/TenantManagementService/user-management.py
42 1 2
def deactivate_tenant()
in server/TenantManagementService/tenant-management.py
41 5 2
def update_tenant()
in server/TenantManagementService/tenant-management.py
39 5 2
def register_tenant()
in server/TenantManagementService/tenant-registration.py
38 7 2
def get_users()
in server/TenantManagementService/user-management.py
37 11 2
def create_tenant()
in server/TenantManagementService/tenant-management.py
34 4 2
def disable_user()
in server/TenantManagementService/user-management.py
33 5 2
def lambda_handler()
in server/TenantPipeline/resources/lambda-deploy-tenant-stack.py
33 9 2
def create_user_pool_client()
in server/TenantManagementService/user-management.py
30 1 2
def get_user()
in server/TenantManagementService/user-management.py
28 5 2
public Configure()
in clients/Application/src/app/views/auth/auth-configuration.service.ts
28 2 0