aws-samples / aws-control-tower-reference-architectures
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 63 units with 937 lines of code in units (60.6% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (53 lines of code)
    • 5 medium size units (149 lines of code)
    • 41 small units (612 lines of code)
    • 16 very small units (123 lines of code)
0% | 5% | 15% | 65% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 15% | 65% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
AccountFactory/EnrollAccount0% | 7% | 18% | 60% | 13%
AccountFactory/BatchUpdate0% | 0% | 8% | 78% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def run_prechecks()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
53 13 1
def create_crossaccount_role()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
40 6 3
def start_enrolling_accounts()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
38 8 1
def get_sts_session()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
25 5 2
def list_all_ou()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
24 6 0
def list_all_ou()
in customizations/AccountFactory/BatchUpdate/update_pp.py
22 6 0
def get_product_id()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
20 6 0
def get_product_id()
in customizations/AccountFactory/BatchUpdate/update_pp.py
20 6 0
def get_acct_name()
in customizations/AccountFactory/BatchUpdate/update_pp.py
20 9 1
def get_provisioned_product_status()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 7 1
def search_provisioned_product_full_list()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 4 0
def get_ou_details()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 7 2
def list_all_accounts()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 6 0
def get_account_mapping()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 7 2
def get_parent_for_account()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
19 6 1
def get_ou_name()
in customizations/AccountFactory/BatchUpdate/update_pp.py
19 5 1
def list_all_accounts()
in customizations/AccountFactory/BatchUpdate/update_pp.py
19 6 0
def try_assume_role()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
18 3 3
def search_provisioned_product_full_list()
in customizations/AccountFactory/BatchUpdate/update_pp.py
18 4 0
def add_stack_instance()
in customizations/AccountFactory/EnrollAccount/enroll_account.py
17 3 3