aws-samples / end-to-end-object-detection-detectron2-sagemaker
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 22 units with 370 lines of code in units (63.7% of code).
    • 1 very long units (104 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (82 lines of code)
    • 8 small units (113 lines of code)
    • 10 very small units (71 lines of code)
28% | 0% | 22% | 30% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py28% | 0% | 22% | 30% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dataprep100% | 0% | 0% | 0% | 0%
source0% | 0% | 31% | 43% | 25%
utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in dataprep/SMGT_to_COCO.py
104 12 1
def _do_loss_eval()
in source/train.py
32 6 1
def output_fn()
in source/inference.py
27 4 2
def _setup()
in source/train.py
23 4 1
def input_fn()
in source/inference.py
18 4 2
def _save_model()
in source/train.py
17 2 0
def model_fn()
in source/inference.py
15 5 1
def get_training_world()
in source/train.py
14 2 0
def predict_fn()
in source/inference.py
13 2 2
def json_to_d2()
in source/d2_deserializer.py
13 5 2
def build_hooks()
in source/train.py
12 1 1
def d2_to_json()
in source/d2_deserializer.py
11 4 1
def _get_predictor()
in source/inference.py
10 2 2
9 1 3
def main()
in source/train.py
9 4 2
def _register_dataset()
in source/train.py
8 1 3
def _get_loss()
in source/train.py
8 4 2
def _opts_to_list()
in source/train.py
6 2 1
def after_step()
in source/train.py
6 4 1
def load_json_arr()
in utils/train_val_loss.py
6 2 1