awslabs / sagemaker-explaining-credit-decisions
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 419 units with 4,202 lines of code in units (64.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (117 lines of code)
    • 27 simple units (670 lines of code)
    • 389 very simple units (3,415 lines of code)
0% | 0% | 2% | 15% | 81%
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% | 2% | 15% | 81%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
sagemaker_notebook_instance/containers0% | 0% | 7% | 27% | 65%
sagemaker_studio/containers0% | 0% | 7% | 27% | 65%
sagemaker/containers0% | 0% | 7% | 27% | 65%
sagemaker_notebook_instance/package0% | 0% | 0% | 9% | 90%
sagemaker_studio/package0% | 0% | 0% | 9% | 90%
sagemaker0% | 0% | 0% | 31% | 68%
sagemaker_notebook_instance0% | 0% | 0% | 32% | 67%
sagemaker_studio0% | 0% | 0% | 32% | 67%
cloudformation/solution-assistant0% | 0% | 0% | 5% | 94%
sagemaker/package0% | 0% | 0% | 3% | 96%
glue0% | 0% | 0% | 0% | 100%
sagemaker_studio/notebooks0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def predict_fn()
in sagemaker_notebook_instance/containers/model/src/explaining.py
39 14 2
def predict_fn()
in sagemaker_studio/containers/model/src/explaining.py
39 14 2
def predict_fn()
in sagemaker/containers/model/src/explaining.py
39 14 2
def get()
in sagemaker_notebook_instance/containers/dashboard/src/session_state.py
23 8 1
def get()
in sagemaker_studio/containers/dashboard/src/session_state.py
23 8 1
def get()
in sagemaker/containers/dashboard/src/session_state.py
23 8 1
def load_explanation_group()
in sagemaker_notebook_instance/containers/dashboard/src/shared.py
20 7 1
def add_to_logbook()
in sagemaker_notebook_instance/env_setup.py
16 7 2
def load_explanation_group()
in sagemaker_studio/containers/dashboard/src/shared.py
20 7 1
def add_to_logbook()
in sagemaker_studio/env_setup.py
16 7 2
def load_explanation_group()
in sagemaker/containers/dashboard/src/shared.py
20 7 1
def add_to_logbook()
in sagemaker/env_setup.py
16 7 2
def summary_plot()
in sagemaker_notebook_instance/containers/dashboard/src/pages/global_page.py
14 6 4
def dependency()
in sagemaker_notebook_instance/containers/dashboard/src/pages/global_page.py
22 6 1
def show()
in sagemaker_notebook_instance/containers/dashboard/src/pages/local_page.py
58 6 1
def env_setup()
in sagemaker_notebook_instance/env_setup.py
21 6 0
def _sort_features()
in sagemaker_notebook_instance/package/package/visuals.py
19 6 2
def log_stream()
in sagemaker_notebook_instance/package/package/sagemaker/logs.py
32 6 4
def __init__()
in cloudformation/solution-assistant/src/datasets.py
27 6 3
def summary_plot()
in sagemaker_studio/containers/dashboard/src/pages/global_page.py
14 6 4