aws-samples / ml-edge-getting-started
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 44 units with 589 lines of code in units (68.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 10 medium size units (298 lines of code)
    • 8 small units (118 lines of code)
    • 26 very small units (173 lines of code)
0% | 0% | 50% | 20% | 29%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 41% | 22% | 36%
cc0% | 0% | 66% | 18% | 14%
hpp0% | 0% | 82% | 0% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models/01_YoloV5/01_Pytorch/processing_cpp/src0% | 0% | 66% | 18% | 14%
models/02_YoloV4/01_Pytorch0% | 0% | 53% | 29% | 16%
models/01_YoloV5/01_Pytorch0% | 0% | 38% | 40% | 20%
models/01_YoloV5/01_Pytorch/processing_cpp/include0% | 0% | 82% | 0% | 17%
tutorials/app0% | 0% | 36% | 0% | 63%
models/03_Unet/01_Keras/source_dir0% | 0% | 29% | 0% | 70%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def non_max_suppression()
in models/02_YoloV4/01_Pytorch/utils.py
47 14 6
int main()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/test.cc
47 5 2
void Processor::nms()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
33 2 2
inline void run_inference()
in models/01_YoloV5/01_Pytorch/processing_cpp/include/dlrclient.hpp
28 8 2
def nms()
in models/02_YoloV4/01_Pytorch/utils.py
27 2 3
def predict()
in tutorials/app/edge_agent_utils.py
26 5 4
def non_max_suppression()
in models/01_YoloV5/01_Pytorch/processing.py
25 2 4
std::tuple Processor::detect()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
23 3 3
def __init__()
in models/01_YoloV5/01_Pytorch/processing.py
21 5 4
def model()
in models/03_Unet/01_Keras/source_dir/train_tf.py
21 2 0
def draw_box()
in models/01_YoloV5/01_Pytorch/processing.py
18 11 5
def preprocess_img()
in models/02_YoloV4/01_Pytorch/utils.py
15 2 2
def detect()
in models/02_YoloV4/01_Pytorch/utils.py
15 5 4
std::tuple Processor::getDetections()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
15 1 2
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
vecf Processor::prepareImage()
in models/01_YoloV5/01_Pytorch/processing_cpp/src/processor.cc
14 3 2
def get_pred()
in models/02_YoloV4/01_Pytorch/utils.py
11 1 3
def capture_data()
in tutorials/app/edge_agent_utils.py
10 2 4
def xywh2xyxy()
in models/02_YoloV4/01_Pytorch/utils.py
10 1 1