aws-samples / amazon-personalize-samples
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 84 units with 1,117 lines of code in units (30.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (85 lines of code)
    • 2 simple units (89 lines of code)
    • 81 very simple units (943 lines of code)
0% | 0% | 7% | 7% | 84%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 7% | 7% | 84%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
operations/filter_rotator/src0% | 0% | 58% | 0% | 41%
operations/ml_ops_ds_sdk/lambda0% | 0% | 0% | 21% | 78%
data_science/diagnose0% | 0% | 0% | 15% | 84%
operations/ml_ops/personalize-step-functions0% | 0% | 0% | 0% | 100%
data_science/offline_performance_evaluation0% | 0% | 0% | 0% | 100%
operations/lambda_examples0% | 0% | 0% | 0% | 100%
operations/streaming_events/lambdas0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def lambda_handler()
in next_steps/operations/filter_rotator/src/filter_rotator_function/filter_rotator.py
85 13 2
def compute_temporal_loss()
in next_steps/data_science/diagnose/diagnose.py
35 7 4
def lambda_handler()
in next_steps/operations/ml_ops_ds_sdk/lambda/stepfunction_create_personalize_role.py
54 6 2
def lambda_handler()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-campaign/campaign.py
38 5 2
def get_message()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/notify-delete/notify-delete.py
11 5 1
def describe_categorical()
in next_steps/data_science/diagnose/diagnose.py
12 5 2
def describe_dataframe()
in next_steps/data_science/diagnose/diagnose.py
12 5 2
def compute_distribution_shift()
in next_steps/data_science/diagnose/diagnose.py
29 5 8
def handler()
in next_steps/operations/streaming_events/lambdas/getRecommendations/getRecommendations.py
19 4 2
def create_solution()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-solution/solution.py
19 4 2
def create_filter()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-filters/filters.py
29 4 3
def average_precision()
in next_steps/data_science/offline_performance_evaluation/metrics.py
10 4 1
def dcg_at_k()
in next_steps/data_science/offline_performance_evaluation/metrics.py
10 4 3
def diagnose_items()
in next_steps/data_science/diagnose/diagnose.py
27 4 2
def lambda_handler()
in next_steps/operations/lambda_examples/event_processor.py
12 3 2
def _unixtime()
in next_steps/operations/filter_rotator/src/filter_rotator_function/template_evaluation.py
4 3 1
def take_action()
in next_steps/operations/ml_ops/personalize-step-functions/shared/python/actions.py
6 3 1
def create_schema()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/create-dataset/dataset.py
26 3 2
def get_message()
in next_steps/operations/ml_ops/personalize-step-functions/lambdas/notify/notify.py
6 3 1
def precision_at_k()
in next_steps/data_science/offline_performance_evaluation/metrics.py
6 3 2