aws-solutions / aws-control-tower-customizations
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 271 units with 3,663 lines of code in units (88.6% of code).
    • 1 very long units (114 lines of code)
    • 4 long units (257 lines of code)
    • 42 medium size units (1,231 lines of code)
    • 79 small units (1,188 lines of code)
    • 145 very small units (873 lines of code)
3% | 7% | 33% | 32% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 7% | 33% | 32% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source9% | 15% | 26% | 33% | 14%
source/manifest0% | 5% | 44% | 21% | 27%
source/aws/services0% | 0% | 29% | 43% | 26%
source/utils0% | 0% | 26% | 29% | 43%
source/aws/utils0% | 0% | 53% | 33% | 13%
source/metrics0% | 0% | 0% | 66% | 33%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def list_stack_instances()
in source/state_machine_handler.py
114 9 1
def service_control_policy()
in source/state_machine_router.py
82 20 2
def compare_template_and_params()
in source/manifest/sm_execution_manager.py
67 9 3
def config_deployer()
in source/config_deployer.py
57 10 1
def create_stack_instances()
in source/state_machine_handler.py
51 13 1
def list_stack_instances_account_ids()
in source/state_machine_handler.py
43 11 1
def main()
in source/state_machine_trigger.py
42 6 0
def parse_stack_set_manifest_v2()
in source/manifest/manifest_parser.py
42 8 1
def parse_stack_set_manifest_v1()
in source/manifest/manifest_parser.py
41 7 1
def describe_stack_set_operation()
in source/state_machine_handler.py
41 10 1
def send()
in source/utils/crhelper.py
39 9 7
def stack_set_state_machine_input_v2()
in source/manifest/manifest_parser.py
38 6 3
def run_execution_sequential_mode()
in source/manifest/sm_execution_manager.py
36 9 1
def get_accounts_and_regions_per_stack_set()
in source/aws/services/cloudformation.py
35 10 2
def compare_stack_instances()
in source/manifest/sm_execution_manager.py
34 3 3
def get_resource()
in source/aws/utils/boto3_session.py
33 4 1
def create_stack_instances_with_override_params()
in source/aws/services/cloudformation.py
33 5 5
def update_stack_set()
in source/aws/services/cloudformation.py
33 5 5
def get_client()
in source/aws/utils/boto3_session.py
32 4 1
def _create_key_pair()
in source/manifest/cfn_params_handler.py
32 7 6