aws-solutions / aws-ops-automator
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 997 units with 13,043 lines of code in units (71.8% of code).
    • 8 very long units (1,306 lines of code)
    • 37 long units (2,463 lines of code)
    • 111 medium size units (3,431 lines of code)
    • 197 small units (2,868 lines of code)
    • 644 very small units (2,975 lines of code)
10% | 18% | 26% | 21% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 18% | 26% | 21% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
code/actions20% | 28% | 26% | 13% | 10%
code/handlers11% | 27% | 22% | 17% | 21%
code/builders37% | 25% | 20% | 10% | 5%
code/configuration14% | 17% | 25% | 22% | 19%
code/testing0% | 7% | 37% | 23% | 31%
code0% | 21% | 34% | 18% | 25%
code/tagging0% | 26% | 10% | 40% | 23%
code/outputs0% | 25% | 17% | 21% | 36%
code/services0% | 5% | 22% | 39% | 32%
code/boto_retry0% | 17% | 15% | 21% | 45%
code/scheduling0% | 0% | 19% | 46% | 34%
code/metrics0% | 0% | 67% | 0% | 32%
ecs0% | 0% | 61% | 38% | 0%
code/helpers0% | 0% | 0% | 58% | 41%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _setup_common_parameters()
in source/code/builders/action_template_builder.py
305 37 1
def handle_request()
in source/code/handlers/select_resources_handler.py
216 84 1
def _create_replacement_instance()
in source/code/actions/ec2_replace_instance_action.py
156 37 1
def is_completed()
in source/code/actions/ec2_copy_snapshot_action.py
145 36 2
def is_completed()
in source/code/actions/ec2_create_snapshot_action.py
129 37 2
def _verify_configuration_item()
in source/code/configuration/task_configuration.py
122 58 2
def handle_request()
in source/code/handlers/task_tracking_handler.py
121 30 1
def execute()
in source/code/actions/ec2_copy_snapshot_action.py
112 17 1
def execute()
in source/code/actions/ec2_delete_snapshot_action.py
93 18 1
def compress_template()
in source/code/builders/cross_account_role_builder.py
91 27 1
def _handle_task_execution()
in source/code/handlers/execution_handler.py
90 21 1
def create_volume_snapshot()
in source/code/actions/ec2_create_snapshot_action.py
82 12 2
def build_tags_from_template()
in source/code/tagging/__init__.py
81 25 9
def run()
in source/code/testing/task_test_runner.py
79 16 12
def generate_templates()
in source/code/handlers/setup_helper_handler.py
79 10 1
def is_completed()
in source/code/actions/ec2_replace_instance_action.py
78 38 2
def verify_task_parameters()
in source/code/configuration/task_configuration.py
75 35 4
def handle_request()
in source/code/handlers/event_handler_base.py
75 21 2
def process_and_select_resource()
in source/code/actions/ec2_copy_snapshot_action.py
74 27 7
def configuration_item_to_task()
in source/code/configuration/task_configuration.py
73 3 2