aws-solutions / improving-forecast-accuracy-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 586 units with 5,947 lines of code in units (61.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (234 lines of code)
    • 29 simple units (729 lines of code)
    • 550 very simple units (4,984 lines of code)
0% | 0% | 3% | 12% | 83%
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% | 3% | 12% | 83%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cdk_solution_helper_py/helpers_cdk0% | 0% | 6% | 21% | 71%
glue/jobs0% | 0% | 9% | 7% | 83%
synthetic0% | 0% | 22% | 14% | 63%
forecast-shared/shared0% | 0% | 1% | 12% | 86%
infrastructure/forecast0% | 0% | 0% | 3% | 96%
lambdas/notification0% | 0% | 0% | 100% | 0%
cdk_solution_helper_py/helpers_common0% | 0% | 0% | 0% | 100%
lambdas/sns0% | 0% | 0% | 0% | 100%
infrastructure/quicksight0% | 0% | 0% | 0% | 100%
lambdas/createforecast0% | 0% | 0% | 0% | 100%
lambdas/createpredictor0% | 0% | 0% | 0% | 100%
lambdas/createdatasetgroup0% | 0% | 0% | 0% | 100%
lambdas/createquicksightanalysis0% | 0% | 0% | 0% | 100%
infrastructure0% | 0% | 0% | 0% | 100%
lambdas/createdatasetimportjob0% | 0% | 0% | 0% | 100%
lambdas/creategluetablename0% | 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 _detect_header()
in source/glue/jobs/forecast_etl.py
31 14 1
def status()
in source/forecast-shared/shared/Dataset/dataset_import_job.py
22 12 1
def try_bundle()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py
33 11 3
def validate_frequency()
in source/synthetic/create_synthetic_data.py
26 11 3
def _generate_data()
in source/synthetic/create_synthetic_data.py
29 11 2
def apply_input_mappings()
in source/glue/jobs/forecast_etl.py
29 11 1
def cdk_context_decorator()
in source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py
23 10 1
def ready()
in source/forecast-shared/shared/DatasetGroup/dataset_group.py
36 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 create()
in source/forecast-shared/shared/Dataset/dataset.py
30 9 1
def status()
in source/forecast-shared/shared/Predictor/predictor.py
15 9 1
def step_function_step()
in source/forecast-shared/shared/helpers.py
30 9 1
def calculate_dependencies()
in source/synthetic/create_synthetic_data.py
14 9 1
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
29 8 1
def _status_predictor_too_old()
in source/forecast-shared/shared/Predictor/predictor.py
25 8 2
def status()
in source/forecast-shared/shared/Forecast/forecast.py
21 8 1