aws-samples / amazon-lookout-for-equipment
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 102 units with 1,945 lines of code in units (79.5% of code).
    • 1 very long units (150 lines of code)
    • 4 long units (212 lines of code)
    • 28 medium size units (902 lines of code)
    • 31 small units (441 lines of code)
    • 38 very small units (240 lines of code)
7% | 10% | 46% | 22% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py7% | 10% | 46% | 22% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
getting_started100% | 0% | 0% | 0% | 0%
utils0% | 17% | 35% | 27% | 20%
apps/cloudwatch-dashboard/lambdas/list-models0% | 26% | 40% | 29% | 3%
apps/cloudwatch-dashboard/lambdas/get-predictions0% | 50% | 25% | 12% | 11%
apps/cloudwatch-dashboard/lambdas/list-schedulers0% | 0% | 89% | 5% | 4%
apps/cloudwatch-dashboard/lambdas/scheduler-last-execution-details0% | 0% | 81% | 12% | 5%
apps/cloudwatch-dashboard/layers/lookoutequipment0% | 0% | 44% | 34% | 21%
apps/cloudwatch-dashboard/lambdas/scheduler-details0% | 0% | 58% | 38% | 3%
apps/cloudwatch-dashboard/lambdas/process-snapshot0% | 0% | 100% | 0% | 0%
apps/cloudwatch-dashboard/lambdas/plot-feature-importance0% | 0% | 77% | 22% | 0%
apps/cloudwatch-dashboard/lambdas/model-details0% | 0% | 60% | 25% | 13%
apps/cloudwatch-dashboard/lambdas/plot-ranked-signals0% | 0% | 81% | 0% | 18%
apps/cloudwatch-dashboard/synthetics0% | 0% | 29% | 42% | 28%
apps/cloudwatch-dashboard/lambdas/plot-feature-importance-legend0% | 0% | 0% | 68% | 31%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def crawlerRoleCreation()
in getting_started/RolesGeneratorL4E.py
150 5 2
def plot_histograms_v2()
in utils/lookout_equipment_utils.py
56 7 5
def get_model_dashboard_body()
in apps/cloudwatch-dashboard/lambdas/list-models/dashboards_definition.py
54 2 1
def get_model_evaluations_infos()
in apps/cloudwatch-dashboard/lambdas/get-predictions/handler.py
51 4 4
def plot_histograms()
in utils/lookout_equipment_utils.py
51 7 3
def process_dashboard_actions()
in apps/cloudwatch-dashboard/lambdas/list-schedulers/handler.py
47 2 1
def generate_html_row()
in apps/cloudwatch-dashboard/lambdas/list-schedulers/handler.py
46 5 1
def build_execution_summary()
in apps/cloudwatch-dashboard/lambdas/scheduler-last-execution-details/handler.py
46 8 3
def create_synthetics()
in apps/cloudwatch-dashboard/lambdas/list-schedulers/handler.py
45 2 1
def plot_signals()
in utils/lookout_equipment_utils.py
45 5 3
def create_synthetics()
in apps/cloudwatch-dashboard/lambdas/list-models/handler.py
44 2 1
def build_scheduler_details()
in apps/cloudwatch-dashboard/lambdas/scheduler-details/handler.py
41 2 1
def set_parameters()
in utils/lookout_equipment_utils.py
41 7 11
def generate_html_table()
in apps/cloudwatch-dashboard/lambdas/list-models/handler.py
39 4 1
def build_feature_importance()
in apps/cloudwatch-dashboard/lambdas/plot-feature-importance/handler.py
38 4 4
def delete()
in utils/lookout_equipment_utils.py
35 1 2
def build_feature_importance()
in apps/cloudwatch-dashboard/lambdas/plot-ranked-signals/handler.py
31 4 3
def get_model_details()
in apps/cloudwatch-dashboard/lambdas/model-details/handler.py
31 4 2
def generate_html_table()
in apps/cloudwatch-dashboard/lambdas/list-schedulers/handler.py
29 2 1
def lambda_handler()
in apps/cloudwatch-dashboard/lambdas/process-snapshot/lambda_function.py
29 4 2