facebookresearch / bitext-lexind
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 48 units with 1,171 lines of code in units (74.3% of code).
    • 0 very long units (0 lines of code)
    • 8 long units (569 lines of code)
    • 15 medium size units (419 lines of code)
    • 9 small units (130 lines of code)
    • 16 very small units (53 lines of code)
0% | 48% | 35% | 11% | 4%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 48% | 35% | 11% | 4%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
align0% | 51% | 33% | 9% | 4%
src0% | 43% | 40% | 13% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def align_sents()
in align/models.py
98 34 4
def get_word_aligns()
in align/models.py
80 48 7
def __init__()
in align/data.py
75 25 4
68 22 6
def collect_bitext_stats()
in src/weakly_sup.py
68 22 6
def collect_bitext_stats()
in src/fully_unsup.py
68 22 6
def train()
in align/train.py
56 12 2
def train_test()
in src/weakly_sup.py
56 11 2
def get_optimal_parameters()
in src/weakly_sup.py
41 11 7
def inference()
in align/test.py
36 14 3
def test()
in align/test.py
35 6 5
def get_test_lexicon()
in src/weakly_sup.py
35 10 8
def extract_dataset()
in src/weakly_sup.py
33 16 4
def __init__()
in align/models.py
27 4 7
def iter_max()
in align/models.py
27 6 2
def embed()
in align/models.py
25 5 3
def extract_probs()
in src/weakly_sup.py
25 3 5
def eval_align()
in align/test.py
23 9 3
def extract_scores()
in align/train.py
23 4 5
def evaluate()
in align/evaluate.py
23 9 3