aws-samples / amazon-sagemaker-multiple-object-tracking
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 261 units with 4,416 lines of code in units (85.4% of code).
    • 6 very long units (776 lines of code)
    • 6 long units (410 lines of code)
    • 40 medium size units (1,379 lines of code)
    • 88 small units (1,209 lines of code)
    • 121 very small units (642 lines of code)
17% | 9% | 31% | 27% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py17% | 9% | 31% | 27% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
container-serving/resources/FairMOT18% | 5% | 32% | 27% | 16%
container-batch-inference/resources/FairMOT17% | 4% | 30% | 30% | 17%
container-dp/resources72% | 0% | 0% | 24% | 2%
container-dp/resources/FairMOT9% | 20% | 30% | 27% | 12%
ROOT0% | 0% | 96% | 0% | 3%
container-serving/resources0% | 0% | 63% | 18% | 18%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def train()
in container-dp/resources/train.py
167 49 0
def __init__()
in container-dp/resources/FairMOT/opts.py
137 1 1
def __init__()
in container-serving/resources/FairMOT/opts.py
133 1 1
def __init__()
in container-batch-inference/resources/FairMOT/opts.py
133 1 1
def associate_tracker()
in container-serving/resources/FairMOT/multitracker.py
103 30 5
def associate_tracker()
in container-batch-inference/resources/FairMOT/multitracker.py
103 30 5
def main()
in container-dp/resources/FairMOT/train.py
97 22 1
def get_data()
in container-dp/resources/FairMOT/jde.py
66 15 3
def __getitem__()
in container-dp/resources/FairMOT/jde.py
66 13 2
def __init__()
in container-serving/resources/FairMOT/config.py
64 33 3
def __init__()
in container-batch-inference/resources/FairMOT/config.py
64 33 3
def run_epoch()
in container-dp/resources/FairMOT/base_trainer.py
53 16 4
def __init__()
in container-dp/resources/FairMOT/jde.py
49 12 6
def load_model()
in container-serving/resources/FairMOT/model.py
48 17 6
def load_model()
in container-dp/resources/FairMOT/model.py
48 17 6
def load_model()
in container-batch-inference/resources/FairMOT/model.py
48 17 6
def random_affine()
in container-dp/resources/FairMOT/jde.py
46 4 4
def __init__()
in container-dp/resources/FairMOT/jde.py
46 12 5
def evaluation()
in container-serving/resources/FairMOT/track.py
42 5 4
def evaluation()
in container-dp/resources/FairMOT/track.py
42 5 4