aws-samples / ml-edge-getting-started
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 44 units with 589 lines of code in units (68.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (65 lines of code)
    • 1 simple units (28 lines of code)
    • 41 very simple units (496 lines of code)
0% | 0% | 11% | 4% | 84%
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% | 16% | 0% | 83%
hpp0% | 0% | 0% | 82% | 17%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models/02_YoloV4/01_Pytorch0% | 0% | 34% | 0% | 65%
models/01_YoloV5/01_Pytorch0% | 0% | 15% | 0% | 84%
models/01_YoloV5/01_Pytorch/processing_cpp/include0% | 0% | 0% | 82% | 17%
models/01_YoloV5/01_Pytorch/processing_cpp/src0% | 0% | 0% | 0% | 100%
tutorials/app0% | 0% | 0% | 0% | 100%
models/03_Unet/01_Keras/source_dir0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def non_max_suppression()
in models/02_YoloV4/01_Pytorch/utils.py
47 14 6
def draw_box()
in models/01_YoloV5/01_Pytorch/processing.py
18 11 5
inline void run_inference()
in models/01_YoloV5/01_Pytorch/processing_cpp/include/dlrclient.hpp
28 8 2
def predict()
in tutorials/app/edge_agent_utils.py
26 5 4
def detect()
in models/02_YoloV4/01_Pytorch/utils.py
15 5 4
int main()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/test.cc
47 5 2
def __init__()
in models/01_YoloV5/01_Pytorch/processing.py
21 5 4
def post_process()
in models/01_YoloV5/01_Pytorch/processing.py
15 4 4
def pre_process()
in models/01_YoloV5/01_Pytorch/processing.py
15 4 2
def create_tensor()
in tutorials/app/edge_agent_utils.py
9 3 2
vecf Processor::prepareImage()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
14 3 2
std::tuple Processor::detect()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
23 3 3
def draw_cv2()
in models/01_YoloV5/01_Pytorch/processing.py
9 3 5
def list_models()
in tutorials/app/edge_agent_utils.py
3 2 1
def load_model()
in tutorials/app/edge_agent_utils.py
9 2 3
def unload_model()
in tutorials/app/edge_agent_utils.py
9 2 2
def capture_data()
in tutorials/app/edge_agent_utils.py
10 2 4
def write_to_shm()
in tutorials/app/edge_agent_utils.py
6 2 2
def preprocess_img()
in models/02_YoloV4/01_Pytorch/utils.py
15 2 2
def nms()
in models/02_YoloV4/01_Pytorch/utils.py
27 2 3