aws / sagemaker-training-toolkit
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 158 units with 1,457 lines of code in units (63.5% of code).
    • 1 very complex units (142 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (176 lines of code)
    • 13 simple units (350 lines of code)
    • 140 very simple units (789 lines of code)
9% | 0% | 12% | 24% | 54%
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
c46% | 0% | 30% | 12% | 10%
py0% | 0% | 7% | 26% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/sagemaker_training/c46% | 0% | 30% | 12% | 10%
src/sagemaker_training0% | 0% | 7% | 27% | 65%
ROOT0% | 0% | 0% | 0% | 100%
src/sagemaker_training/cli0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int jsmn_parse()
in src/sagemaker_training/c/jsmn.c
142 73 5
static int jsmn_parse_string()
in src/sagemaker_training/c/jsmn.c
51 23 5
def _watch()
in src/sagemaker_training/intermediate_output.py
23 22 4
static int jsmn_parse_primitive()
in src/sagemaker_training/c/jsmn.c
40 13 5
def __init__()
in src/sagemaker_training/environment.py
62 11 4
def _write_spmatrix_to_sparse_tensor()
in src/sagemaker_training/recordio.py
28 10 3
def _decode()
in src/sagemaker_training/mapping.py
11 10 1
def _write_numpy_to_dense_tensor()
in src/sagemaker_training/recordio.py
21 9 3
def to_cmd_args()
in src/sagemaker_training/mapping.py
17 8 1
def _create_command()
in src/sagemaker_training/mpi.py
68 8 1
def download_and_extract()
in src/sagemaker_training/files.py
21 8 2
def to_env_vars()
in src/sagemaker_training/mapping.py
17 7 1
def train()
in src/sagemaker_training/trainer.py
49 7 0
def check_error()
in src/sagemaker_training/process.py
29 7 6
def __str__()
in src/sagemaker_training/errors.py
26 6 1
def _wait_for_workers()
in src/sagemaker_training/smdataparallel.py
14 6 1
def install()
in src/sagemaker_training/entry_point.py
10 6 3
int gethostname()
in src/sagemaker_training/c/gethostname.c
39 6 2
def _upload_to_s3()
in src/sagemaker_training/intermediate_output.py
11 5 4
def _orted_process()
in src/sagemaker_training/mpi.py
7 5 0