aws-samples / sagemaker-run-notebook
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 208 units with 2,915 lines of code in units (58.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (165 lines of code)
    • 24 simple units (669 lines of code)
    • 179 very simple units (2,081 lines of code)
0% | 0% | 5% | 22% | 71%
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% | 8% | 28% | 62%
ts0% | 0% | 0% | 39% | 60%
tsx0% | 0% | 0% | 5% | 94%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 27% | 31% | 41%
sagemaker_run_notebook/container0% | 0% | 81% | 0% | 18%
sagemaker_run_notebook0% | 0% | 1% | 28% | 70%
labextension/src0% | 0% | 0% | 100% | 0%
sagemaker_run_notebook/server_extension0% | 0% | 0% | 27% | 72%
labextension/src/components0% | 0% | 0% | 5% | 94%
container0% | 0% | 0% | 100% | 0%
labextension/src/models0% | 0% | 0% | 0% | 100%
labextension/src/util0% | 0% | 0% | 0% | 100%
labextension/src/widgets0% | 0% | 0% | 0% | 100%
labextension/src/style0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def which()
in setupbase.py
24 16 3
33 15 1
def run()
in setupbase.py
33 13 1
def run_notebook()
in sagemaker_run_notebook/container/execute.py
54 12 0
def list_rules()
in sagemaker_run_notebook/cli.py
21 11 1
17 10 3
def _get_files()
in setupbase.py
17 10 2
def describe_runs()
in sagemaker_run_notebook/run_notebook.py
20 10 4
def recursive_mtime()
in setupbase.py
13 9 2
def _get_data_files()
in setupbase.py
18 9 2
def create_lambda()
in sagemaker_run_notebook/run_notebook.py
38 9 2
def _iexplode_path()
in setupbase.py
11 8 1
def run_notebook()
in sagemaker_run_notebook/cli.py
39 8 1
def create_infrastructure()
in sagemaker_run_notebook/create_infrastructure.py
39 8 3
def post()
in sagemaker_run_notebook/server_extension/handlers.py
31 8 1
def describe_run()
in sagemaker_run_notebook/run_notebook.py
45 8 2
def run_notebook()
in container/execute.py
36 7 0
def _create_s3_bucket_if_it_does_not_exist()
in sagemaker_run_notebook/utils.py
25 7 3
function activate()
in labextension/src/index.ts
87 7 6
def find_packages()
in setupbase.py
8 6 1