facebookresearch / bio-lm
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 81 units with 2,085 lines of code in units (82.0% of code).
    • 4 very long units (826 lines of code)
    • 10 long units (627 lines of code)
    • 7 medium size units (237 lines of code)
    • 13 small units (198 lines of code)
    • 47 very small units (197 lines of code)
39% | 30% | 11% | 9% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py39% | 30% | 11% | 9% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
biolm53% | 20% | 4% | 9% | 12%
preprocessing0% | 57% | 31% | 10% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def main()
in biolm/run_classification.py
265 54 0
def main()
in biolm/run_sequence_labelling.py
260 56 0
def train()
in biolm/run_classification.py
162 60 4
def train()
in biolm/run_sequence_labelling.py
139 40 6
def evaluate()
in biolm/run_classification.py
80 25 4
def load_and_cache_examples()
in biolm/run_classification.py
70 37 5
def main()
in preprocessing/preprocess_i2b2_2010_ner.py
66 7 5
def read_xml_file()
in preprocessing/preprocess_i2b2_2012_ner.py
65 21 3
def merge_into_words()
in preprocessing/preprocess_i2b2_2012_ner.py
61 18 2
def merge_into_words()
in preprocessing/preprocess_i2b2_2014_ner.py
61 18 2
def compute_metrics()
in biolm/utils_classification.py
58 28 4
def read_xml_file()
in preprocessing/preprocess_i2b2_2014_ner.py
58 23 3
def evaluate()
in biolm/run_sequence_labelling.py
55 8 7
def hoc_get_p_r_f_arrary()
in biolm/utils_classification.py
53 14 3
def reprocess_event_labels()
in preprocessing/preprocess_i2b2_2012_ner.py
45 14 5
def reformatter()
in preprocessing/preprocess_i2b2_2010_ner.py
42 29 4
def reprocess_PHI_labels()
in preprocessing/preprocess_i2b2_2014_ner.py
42 13 5
def load_and_cache_examples()
in biolm/run_sequence_labelling.py
41 19 5
def read_examples_from_file()
in biolm/utils_sequence_labelling.py
24 9 2
def main()
in preprocessing/preprocess_i2b2_2014_ner.py
22 7 4