aws-solutions / maintaining-personalized-experiences-with-machine-learning
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 440 units with 4,401 lines of code in units (48.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (181 lines of code)
    • 28 simple units (1,051 lines of code)
    • 408 very simple units (3,169 lines of code)
0% | 0% | 4% | 23% | 72%
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% | 4% | 24% | 71%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cdk_solution_helper_py/helpers_cdk0% | 0% | 8% | 24% | 67%
scheduler/common0% | 0% | 15% | 17% | 66%
aws_lambda/shared0% | 0% | 2% | 28% | 69%
infrastructure/personalize0% | 0% | 0% | 36% | 63%
scheduler/cdk0% | 0% | 0% | 0% | 100%
cdk_solution_helper_py/helpers_common0% | 0% | 0% | 0% | 100%
aws_lambda/s3_event0% | 0% | 0% | 0% | 100%
aws_lambda/sns_notification0% | 0% | 0% | 0% | 100%
infrastructure0% | 0% | 0% | 0% | 100%
aws_lambda/create_config0% | 0% | 0% | 0% | 100%
aws_lambda/prepare_input0% | 0% | 0% | 0% | 100%
aws_lambda/create_recommender0% | 0% | 0% | 0% | 100%
aws_lambda/create_solution0% | 0% | 0% | 0% | 100%
aws_lambda/create_batch_segment_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset0% | 0% | 0% | 0% | 100%
aws_lambda/create_batch_inference_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_solution_version0% | 0% | 0% | 0% | 100%
aws_lambda/create_filter0% | 0% | 0% | 0% | 100%
aws_lambda/create_timestamp0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset_group0% | 0% | 0% | 0% | 100%
aws_lambda/create_event_tracker0% | 0% | 0% | 0% | 100%
aws_lambda/create_dataset_import_job0% | 0% | 0% | 0% | 100%
aws_lambda/create_campaign0% | 0% | 0% | 0% | 100%
aws_lambda/create_schema0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def patch_lambda()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
64 20 1
def _validate_dict()
in source/aws_lambda/shared/personalize_service.py
22 13 4
def _transact_put()
in source/scheduler/common/aws_solutions/scheduler/common/base.py
62 12 2
def try_bundle()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py
33 11 3
def cdk_context_decorator()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py
23 10 1
def copytree()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/copytree.py
16 9 4
def patch_nested()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
37 9 1
def synthesize()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py
40 9 2
def _validate_solutions()
in source/aws_lambda/shared/personalize_service.py
37 9 2
def set_workflow_config()
in source/aws_lambda/shared/sfn_middleware.py
25 9 1
def _resource_stable()
in source/aws_lambda/shared/notifiers/base.py
33 9 3
def delete()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/cleaner.py
15 8 2
def _get_metadata()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py
33 8 1
def describe()
in source/aws_lambda/shared/personalize_service.py
18 8 3
def _filter()
in source/aws_lambda/shared/personalize/service_model.py
26 8 2
def __init__()
in source/infrastructure/personalize/stack.py
391 8 5
def sync()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py
32 7 1
def _validate_schema()
in source/aws_lambda/shared/personalize_service.py
23 7 3
def resolve()
in source/aws_lambda/shared/sfn_middleware.py
19 7 2
def __init__()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solutionstep.py
20 6 4