aws-samples / incremental-training-mlops
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 43 units with 627 lines of code in units (80.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (87 lines of code)
    • 5 simple units (200 lines of code)
    • 37 very simple units (340 lines of code)
0% | 0% | 13% | 31% | 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
py0% | 0% | 13% | 31% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
01-byoc/code0% | 0% | 17% | 27% | 54%
03-lambda-api/process_a2i_results0% | 0% | 0% | 81% | 18%
02-increment-train/invoke_endpoint_a2i0% | 0% | 0% | 0% | 100%
02-increment-train0% | 0% | 0% | 0% | 100%
01-byoc/invoke_endpoint0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_model()
in 01-byoc/code/workflow.py
87 17 4
def plot_confusion_matrix()
in 01-byoc/code/utils.py
32 9 6
def read_data()
in 01-byoc/code/dataset.py
26 8 2
def main()
in 01-byoc/code/test.py
59 7 0
def lambda_handler()
in 03-lambda-api/process_a2i_results/lambda_function.py
63 7 2
def preprocessing()
in 01-byoc/code/dataset.py
20 6 3
def main()
in 01-byoc/code/train.py
50 5 0
def prepare_model()
in 01-byoc/code/workflow.py
11 4 1
def get_optim_scheduler()
in 01-byoc/code/workflow.py
6 3 2
def _split_sampler()
in 01-byoc/code/dataloader.py
19 3 2
def get_folder_name()
in 01-byoc/code/workflow.py
8 2 1
def split_validation()
in 01-byoc/code/dataloader.py
5 2 1
def __init__()
in 01-byoc/code/dataset.py
12 2 2
def read_data()
in 01-byoc/code/dataset.py
13 2 2
def convert_to_spec()
in 01-byoc/code/dataset.py
3 2 2
def spec_to_image()
in 01-byoc/code/dataset.py
12 2 3
def __getitem__()
in 01-byoc/code/dataset.py
4 2 2
def __init__()
in 01-byoc/code/dataset.py
12 2 2
def lambda_handler()
in 02-increment-train/invoke_endpoint_a2i/lambda_function.py
32 2 2
def Adam()
in 01-byoc/code/ops.py
2 1 4