amazon-research / siam-mot
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 223 units with 2,805 lines of code in units (78.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (62 lines of code)
    • 38 medium size units (1,110 lines of code)
    • 65 small units (964 lines of code)
    • 119 very small units (669 lines of code)
0% | 2% | 39% | 34% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 2% | 39% | 34% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
siammot/data/ingestion0% | 52% | 38% | 9% | 0%
siammot/modelling/track_head0% | 0% | 24% | 43% | 31%
siammot/data0% | 0% | 55% | 32% | 12%
siammot/modelling/backbone0% | 0% | 49% | 17% | 33%
siammot/eval0% | 0% | 63% | 36% | 0%
siammot/operator_patch0% | 0% | 93% | 0% | 6%
siammot/data/adapters0% | 0% | 17% | 45% | 37%
siammot/modelling/box_head0% | 0% | 50% | 27% | 22%
siammot/engine0% | 0% | 36% | 49% | 13%
tools0% | 0% | 90% | 0% | 9%
siammot/utils0% | 0% | 48% | 36% | 15%
siammot/modelling0% | 0% | 47% | 30% | 21%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in siammot/data/ingestion/ingest_mot.py
62 12 4
def eval_clears_mot()
in siammot/eval/eval_clears_mot.py
49 9 4
def build_siam_augmentation()
in siammot/data/adapters/augmentation/build_augmentation.py
49 4 3
def sample_from_mot_csv()
in siammot/data/ingestion/ingest_mot.py
45 9 5
def _check_load_bbox()
in siammot/data/image_dataset.py
41 18 3
def generate_pos_hn_example()
in siammot/modelling/track_head/EMM/target_sampler.py
38 5 3
def forward()
in siammot/modelling/box_head/inference.py
37 14 3
def forward()
in siammot/modelling/track_head/track_solver.py
37 11 2
def do_inference()
in siammot/engine/inferencer.py
36 7 5
def train()
in tools/train_net.py
34 3 5
def forward_for_single_feature_map()
in siammot/operator_patch/rpn_patch.py
33 6 4
def filter_results()
in siammot/modelling/box_head/inference.py
32 6 3
def get_locations()
in siammot/modelling/track_head/EMM/track_core.py
32 3 5
def eval_det_ap()
in siammot/eval/eval_det_ap.py
31 16 5
def __init__()
in siammot/modelling/backbone/dla.py
31 7 15
def __init__()
in siammot/modelling/backbone/dla.py
31 3 15
def build_dataset()
in siammot/data/build_train_data_loader.py
30 4 1
def forward()
in siammot/modelling/track_head/EMM/track_core.py
30 5 6
def __call__()
in siammot/modelling/track_head/EMM/track_loss.py
28 2 7
def __init__()
in siammot/data/image_dataset.py
27 4 10