facebookresearch / MUSE
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 65 units with 1,121 lines of code in units (78.0% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (179 lines of code)
    • 16 medium size units (472 lines of code)
    • 22 small units (334 lines of code)
    • 24 very small units (136 lines of code)
0% | 15% | 42% | 29% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 15% | 42% | 29% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/evaluation0% | 22% | 55% | 18% | 4%
src0% | 11% | 32% | 38% | 17%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_candidates()
in src/dico_builder.py
71 16 3
def get_wordanalogy_scores()
in src/evaluation/wordsim.py
56 17 4
def get_word_translation_accuracy()
in src/evaluation/word_translation.py
52 10 8
def get_sent_translation_accuracy()
in src/evaluation/sent_translation.py
50 7 11
42 18 3
def get_optimizer()
in src/utils.py
37 13 1
def sent_translation()
in src/evaluation/evaluator.py
32 8 2
def load_dictionary()
in src/evaluation/word_translation.py
31 7 3
def build_dictionary()
in src/dico_builder.py
30 14 5
def get_crosslingual_wordsim_scores()
in src/evaluation/wordsim.py
29 6 7
def load_europarl_data()
in src/evaluation/sent_translation.py
28 9 4
def build_model()
in src/models.py
27 8 2
def dist_mean_cosine()
in src/evaluation/evaluator.py
26 4 2
def eval_dis()
in src/evaluation/evaluator.py
26 5 2
def get_nn_avg_dist()
in src/utils.py
24 4 3
def get_spearman_rho()
in src/evaluation/wordsim.py
24 6 6
def monolingual_wordsim()
in src/evaluation/evaluator.py
23 8 2
22 7 3
def get_exp_path()
in src/utils.py
21 10 1
def monolingual_wordanalogy()
in src/evaluation/evaluator.py
20 7 2