facebookresearch / GENRE
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 72 units with 793 lines of code in units (18.9% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (62 lines of code)
    • 6 medium size units (196 lines of code)
    • 21 small units (295 lines of code)
    • 44 very small units (240 lines of code)
0% | 7% | 24% | 37% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 7% | 24% | 37% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
genre0% | 9% | 20% | 36% | 33%
scripts_mgenre0% | 0% | 55% | 23% | 21%
scripts_genre0% | 0% | 0% | 93% | 6%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
62 25 3
def create_input()
in genre/utils.py
48 7 4
def evaluate()
in scripts_mgenre/evaluate_mel.py
41 18 2
def extract_pages()
in genre/utils.py
37 7 1
def get_trie_entity()
in genre/entity_linking.py
24 5 2
def evaluate_kilt_dataset()
in scripts_mgenre/evaluate_kilt_dataset.py
24 1 0
def get_trie_mention()
in genre/entity_linking.py
22 7 2
def get_pointer_end()
in genre/entity_linking.py
20 8 2
def get()
in genre/trie.py
18 9 2
def convert_kilt_to_fairseq()
in scripts_genre/convert_kilt_to_fairseq.py
18 10 1
def get_status()
in genre/entity_linking.py
17 5 1
def get_micro_precision()
in genre/utils.py
15 5 3
def get_micro_recall()
in genre/utils.py
15 5 3
15 1 0
def prefix_allowed_tokens_fn()
in genre/entity_linking.py
15 5 2
14 2 1
def get_markdown()
in genre/utils.py
14 3 2
def weak_tp()
in genre/utils.py
14 7 2
def __init__()
in genre/trie.py
14 2 3
def clean_anchor_lang()
in scripts_mgenre/preprocess_anchors.py
14 6 2