aws-samples / aws-serverless-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 2,172 units with 21,427 lines of code in units (21.8% of code).
    • 0 very long units (0 lines of code)
    • 24 long units (1,743 lines of code)
    • 247 medium size units (7,013 lines of code)
    • 404 small units (5,694 lines of code)
    • 1,497 very small units (6,977 lines of code)
0% | 8% | 32% | 26% | 32%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 9% | 40% | 27% | 23%
ts0% | 4% | 15% | 25% | 54%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Solution/Lab60% | 13% | 35% | 23% | 27%
Lab6/server0% | 17% | 41% | 22% | 18%
Solution/Lab50% | 11% | 36% | 24% | 28%
Lab5/server0% | 15% | 41% | 23% | 19%
Solution/Lab40% | 9% | 32% | 24% | 33%
Lab4/server0% | 11% | 43% | 25% | 20%
Solution/Lab30% | 2% | 32% | 27% | 37%
Lab3/server0% | 0% | 45% | 29% | 25%
Solution/Lab20% | 0% | 28% | 35% | 36%
Lab2/server0% | 0% | 30% | 36% | 33%
Lab5/client0% | 0% | 18% | 27% | 54%
Lab6/client0% | 0% | 18% | 27% | 54%
Lab3/client0% | 0% | 14% | 25% | 59%
Lab4/client0% | 0% | 14% | 25% | 59%
Lab2/client0% | 0% | 16% | 28% | 55%
Solution/Lab10% | 0% | 0% | 41% | 58%
Lab1/server0% | 0% | 0% | 46% | 53%
Lab1/client0% | 0% | 0% | 32% | 67%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def __getPolicyForTenantAdmin()
in Solution/Lab5/server/layers/auth_manager.py
88 2 4
def __getPolicyForTenantAdmin()
in Solution/Lab4/server/layers/auth_manager.py
88 2 4
def __getPolicyForTenantAdmin()
in Solution/Lab6/server/layers/auth_manager.py
88 2 4
def __getPolicyForTenantAdmin()
in Lab5/server/layers/auth_manager.py
88 2 4
def __getPolicyForTenantAdmin()
in Lab4/server/layers/auth_manager.py
88 2 4
def __getPolicyForTenantAdmin()
in Lab6/server/layers/auth_manager.py
88 2 4
constructor()
in Solution/Lab5/server/TenantPipeline/lib/serverless-saas-stack.ts
78 1 3
constructor()
in Solution/Lab6/server/TenantPipeline/lib/serverless-saas-stack.ts
78 1 3
constructor()
in Lab5/server/TenantPipeline/lib/serverless-saas-stack.ts
78 1 3
constructor()
in Lab6/server/TenantPipeline/lib/serverless-saas-stack.ts
78 1 3
def lambda_handler()
in Solution/Lab6/server/Resources/shared_service_authorizer.py
74 14 2
def lambda_handler()
in Lab6/server/Resources/shared_service_authorizer.py
74 14 2
def lambda_handler()
in Solution/Lab6/server/Resources/tenant_authorizer.py
72 9 2
def lambda_handler()
in Solution/Lab5/server/Resources/shared_service_authorizer.py
70 14 2
def lambda_handler()
in Lab5/server/Resources/shared_service_authorizer.py
70 14 2
def lambda_handler()
in Lab6/server/Resources/tenant_authorizer.py
70 9 2
def lambda_handler()
in Solution/Lab5/server/Resources/tenant_authorizer.py
68 9 2
def lambda_handler()
in Lab5/server/Resources/tenant_authorizer.py
68 9 2
def lambda_handler()
in Solution/Lab4/server/Resources/shared_service_authorizer.py
64 14 2
def lambda_handler()
in Lab4/server/Resources/shared_service_authorizer.py
64 14 2