awslabs / aws-sdlc-controltower-extension
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 39 units with 871 lines of code in units (39.5% of code).
    • 1 very long units (124 lines of code)
    • 2 long units (106 lines of code)
    • 13 medium size units (372 lines of code)
    • 11 small units (178 lines of code)
    • 12 very small units (91 lines of code)
14% | 12% | 42% | 20% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py14% | 12% | 42% | 20% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lambdas/custom_resources/CTE_CrossAccountCloudFormation/src21% | 9% | 36% | 19% | 12%
lambdas/stepfunctions/CTE_CreateAccountFn/src0% | 34% | 18% | 35% | 11%
lambdas/stepfunctions/CTE_InvokeCreateAccountFn/src0% | 0% | 100% | 0% | 0%
lambdas/stepfunctions/CTE_SignalCfnResponseFn/src0% | 0% | 100% | 0% | 0%
lambdas/stepfunctions/CTE_GetAccountStatusFn/src0% | 0% | 71% | 28% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def lambda_handler()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/main.py
124 23 2
def create_update_stack()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
55 7 8
def lambda_handler()
in lambdas/stepfunctions/CTE_CreateAccountFn/src/main.py
51 1 2
def wait_all_stacks()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
38 9 1
def update_parameters()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
35 19 2
def list_stacks()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
32 4 1
def retry_v2()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/helper.py
32 6 4
def lambda_handler()
in lambdas/stepfunctions/CTE_GetAccountStatusFn/src/main.py
30 3 2
def lambda_handler()
in lambdas/stepfunctions/CTE_InvokeCreateAccountFn/src/main.py
29 3 2
def send()
in lambdas/stepfunctions/CTE_InvokeCreateAccountFn/src/cfnresponse.py
28 7 7
def send()
in lambdas/stepfunctions/CTE_SignalCfnResponseFn/src/cfnresponse.py
28 7 7
def send()
in lambdas/stepfunctions/CTE_CreateAccountFn/src/cfnresponse.py
28 7 7
def send()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfnresponse.py
28 7 7
def boto3_client()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/client_session_helper.py
22 6 5
def lambda_handler()
in lambdas/stepfunctions/CTE_SignalCfnResponseFn/src/main.py
21 5 2
def boto3_session()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/client_session_helper.py
21 6 3
def determine_stack_failure_event()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
20 4 2
def search_provisioned_products()
in lambdas/stepfunctions/CTE_CreateAccountFn/src/helper.py
19 4 2
def disable_termination_protection()
in lambdas/custom_resources/CTE_CrossAccountCloudFormation/src/cfn_helper.py
19 5 2
def scan_provisioned_products()
in lambdas/stepfunctions/CTE_CreateAccountFn/src/helper.py
18 5 2