facebookresearch / muss
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 333 units with 2,642 lines of code in units (69.8% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (116 lines of code)
    • 17 medium size units (495 lines of code)
    • 50 small units (720 lines of code)
    • 264 very small units (1,311 lines of code)
0% | 4% | 18% | 27% | 49%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 4% | 18% | 27% | 49%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
muss/mining0% | 15% | 30% | 22% | 31%
muss/utils0% | 0% | 16% | 28% | 54%
muss/fairseq0% | 0% | 23% | 42% | 33%
muss/resources0% | 0% | 26% | 29% | 43%
muss0% | 0% | 6% | 23% | 70%
muss/evaluation0% | 0% | 0% | 58% | 42%
scripts0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def get_all_baseline_rows()
in muss/mining/training.py
63 3 0
def get_bart_kwargs()
in muss/mining/training.py
53 2 5
def get_baseline_rows()
in muss/mining/training.py
48 3 3
def run_command()
in muss/utils/helpers.py
46 11 2
def get_transformer_kwargs()
in muss/mining/training.py
41 2 4
def get_mbart_kwargs()
in muss/mining/training.py
38 2 4
31 6 3
31 3 2
def extract()
in muss/utils/resources.py
28 5 2
def get_sentences_from_ids()
in muss/mining/nn_search.py
28 10 2
def fairseq_preprocess()
in muss/fairseq/base.py
26 5 4
def get_evaluate_kwargs()
in muss/mining/training.py
25 1 2
def get_nearest_sentence_ids()
in muss/mining/nn_search.py
23 9 6
def mix_datasets()
in muss/resources/datasets.py
22 12 3
22 6 3
def redirect_streams()
in muss/utils/helpers.py
22 9 2
def combine_results_over_db_indexes()
in muss/mining/nn_search.py
22 4 2
def train_roberta()
in muss/fairseq/roberta.py
21 1 0
21 5 2
def get_executor()
in muss/slurm.py
19 1 0