facebookresearch / ELI5
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 23 units with 584 lines of code in units (81.7% of code).
    • 1 very long units (152 lines of code)
    • 2 long units (157 lines of code)
    • 4 medium size units (124 lines of code)
    • 5 small units (82 lines of code)
    • 11 very small units (69 lines of code)
26% | 26% | 21% | 14% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py26% | 26% | 21% | 14% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
data_creation34% | 35% | 17% | 7% | 5%
model_code0% | 0% | 34% | 34% | 31%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in data_creation/download_support_docs.py
152 51 0
def main()
in data_creation/download_reddit_qalist.py
100 30 0
def download_and_process()
in data_creation/download_reddit_qalist.py
57 26 4
def main()
in data_creation/select_sentences_tfidf.py
39 7 0
def select_pars()
in data_creation/select_sentences_tfidf.py
36 21 5
def tag_and_write()
in model_code/pos_tag.py
26 1 5
def form_multitask()
in model_code/process_data_to_source_target.py
23 2 3
def form_multitask_source_target()
in model_code/process_data_to_source_target.py
20 3 6
def main()
in data_creation/finalize_qda.py
20 7 0
def masking_tokens()
in model_code/process_data_to_source_target.py
17 4 1
def gather_dump_urls()
in data_creation/download_reddit_qalist.py
13 6 2
def read_data()
in model_code/process_data_to_source_target.py
12 2 1
def post_process()
in data_creation/download_reddit_qalist.py
10 7 2
def make_example()
in data_creation/select_sentences_tfidf.py
9 1 5
def open_data()
in model_code/compute_rouge.py
7 1 2
def form_source_target()
in model_code/process_data_to_source_target.py
7 2 5
def form_multitask_valid()
in model_code/process_data_to_source_target.py
7 2 3
def open_files()
in model_code/pos_tag.py
6 1 3
def rouge_calculation()
in model_code/compute_rouge.py
5 1 2
def file_writer()
in model_code/pos_tag.py
5 1 2