facebookresearch / talkthewalk
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 129 units with 1,662 lines of code in units (65.2% of code).
    • 0 very long units (0 lines of code)
    • 5 long units (342 lines of code)
    • 17 medium size units (525 lines of code)
    • 25 small units (372 lines of code)
    • 82 very small units (423 lines of code)
0% | 20% | 31% | 22% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 20% | 31% | 22% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
ttw/models0% | 20% | 32% | 20% | 26%
ttw0% | 19% | 19% | 24% | 37%
scripts0% | 39% | 44% | 0% | 16%
ttw/train0% | 0% | 49% | 50% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def forward()
in ttw/models/language.py
88 13 6
def evaluate()
in scripts/evaluate_location.py
87 17 9
def beam_search()
in ttw/models/beam_search.py
65 27 4
def __init__()
in ttw/data_loader.py
51 13 7
def __init__()
in ttw/data_loader.py
51 11 8
def get_orientation_keys()
in ttw/data_loader.py
45 13 3
def forward()
in ttw/models/language.py
44 10 3
def __init__()
in ttw/data_loader.py
37 14 7
def forward()
in ttw/models/discrete.py
36 6 3
def epoch()
in ttw/train/predict_location_generated.py
36 6 8
def eval_epoch()
in ttw/train/predict_location_discrete.py
34 10 6
def prediction_upperbound()
in scripts/compute_upperbound.py
34 15 8
def forward()
in ttw/models/landmark_classification.py
33 10 2
def get_configurations()
in scripts/split_dataset.py
32 10 1
def process()
in scripts/compute_upperbound.py
30 9 9
def __init__()
in ttw/models/language.py
27 4 6
def forward()
in ttw/models/discrete.py
26 7 3
def show_samples()
in ttw/models/language.py
24 10 8
def __init__()
in ttw/models/language.py
22 1 12
def forward()
in ttw/models/continuous.py
22 7 3