aws-solutions / aws-instance-scheduler
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 339 units with 5,193 lines of code in units (81.9% of code).
    • 2 very long units (1,185 lines of code)
    • 15 long units (1,036 lines of code)
    • 42 medium size units (1,243 lines of code)
    • 53 small units (770 lines of code)
    • 227 very small units (959 lines of code)
22% | 19% | 23% | 14% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts100% | 0% | 0% | 0% | 0%
py2% | 25% | 30% | 18% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/lib100% | 0% | 0% | 0% | 0%
source/cli/scheduler_cli72% | 0% | 20% | 0% | 6%
source/lambda/configuration0% | 37% | 23% | 16% | 22%
source/lambda/schedulers0% | 30% | 40% | 21% | 8%
source/lambda/util0% | 29% | 10% | 24% | 35%
source/lambda/requesthandlers0% | 0% | 41% | 22% | 36%
source/lambda/boto_retry0% | 0% | 25% | 15% | 58%
source/lambda0% | 0% | 54% | 0% | 45%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
constructor()
in source/lib/aws-instance-scheduler-stack.ts
1073 3 3
def build_parser()
in source/cli/scheduler_cli/scheduler_cli.py
112 1 0
def _process_account()
in source/lambda/schedulers/instance_scheduler.py
87 38 2
def _schedule_from_maint_window()
in source/lambda/schedulers/ec2_service.py
85 3 6
def _validate_schedule()
in source/lambda/configuration/config_admin.py
83 31 2
def get_desired_state()
in source/lambda/configuration/instance_schedule.py
79 47 5
def _validate_period()
in source/lambda/configuration/config_admin.py
76 26 2
def stop_instances()
in source/lambda/schedulers/ec2_service.py
76 44 2
def configuration_as_dict()
in source/lambda/configuration/scheduler_config_builder.py
68 24 1
def calculate_schedule_usage_for_period()
in source/lambda/configuration/config_admin.py
66 19 5
def get_desired_state()
in source/lambda/configuration/running_period.py
62 28 3
def configuration_from_dict()
in source/lambda/configuration/scheduler_config_builder.py
62 15 1
def _process_new_desired_state()
in source/lambda/schedulers/instance_scheduler.py
62 22 8
def send_metrics_data()
in source/lambda/util/metrics.py
62 9 2
def update_config()
in source/lambda/configuration/config_admin.py
58 16 2
def flush()
in source/lambda/util/logger.py
57 19 1
def start_instances()
in source/lambda/schedulers/ec2_service.py
53 26 2
def _build_schedule()
in source/lambda/configuration/scheduler_config_builder.py
49 17 5
def __init__()
in source/lambda/configuration/setbuilders/setbuilder.py
49 28 11
def get_schedulable_instances()
in source/lambda/schedulers/ec2_service.py
45 10 2