facebookresearch / CCQA
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 41 units with 957 lines of code in units (81.7% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (183 lines of code)
    • 15 medium size units (527 lines of code)
    • 12 small units (168 lines of code)
    • 11 very small units (79 lines of code)
0% | 19% | 55% | 17% | 8%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 16% | 53% | 22% | 7%
rs0% | 24% | 59% | 6% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
python0% | 16% | 53% | 22% | 7%
rust/src0% | 24% | 59% | 6% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
fn minify()
in rust/src/main.rs
68 5 1
def text_cleanup()
in python/mhtml_to_json.py
64 1 1
def collect_question()
in python/mhtml_to_json.py
51 14 1
def vote_info()
in python/passage_retrieval_processing.py
47 18 3
def generate_structured_json()
in python/mhtml_to_json.py
46 7 4
fn transform_inside()
in rust/src/main.rs
44 15 1
def collect_answer()
in python/mhtml_to_json.py
42 11 1
def generate_passage_retrieval_files()
in python/passage_retrieval_processing.py
42 20 4
def generate_closed_book_format()
in python/closed_book_processing.py
37 16 4
fn main()
in rust/src/main.rs
37 1 0
fn inside_props()
in rust/src/main.rs
36 16 1
def update_datapoint()
in python/json_duplicate_filter.py
34 8 2
def search_tree()
in python/mhtml_to_json.py
33 16 2
def full_info()
in python/passage_retrieval_processing.py
32 15 3
def acc_sugg_info()
in python/passage_retrieval_processing.py
26 11 3
fn transform_outside()
in rust/src/main.rs
25 7 1
def generate_new_datapoint()
in python/json_duplicate_filter.py
23 3 2
fn remove_empty_nodes()
in rust/src/main.rs
23 13 1
def predict_question_language()
in python/mhtml_to_json.py
17 5 2
fn find_lang_tag()
in rust/src/main.rs
17 6 1