facebookresearch / bio-lm
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 81 units with 2,085 lines of code in units (82.0% of code).
    • 3 very complex units (687 lines of code)
    • 4 complex units (309 lines of code)
    • 9 medium complex units (506 lines of code)
    • 7 simple units (225 lines of code)
    • 58 very simple units (358 lines of code)
32% | 14% | 24% | 10% | 17%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py32% | 14% | 24% | 10% | 17%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
biolm44% | 17% | 11% | 5% | 21%
preprocessing0% | 7% | 61% | 27% | 3%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in biolm/run_classification.py
162 60 4
def main()
in biolm/run_sequence_labelling.py
260 56 0
def main()
in biolm/run_classification.py
265 54 0
def train()
in biolm/run_sequence_labelling.py
139 40 6
def load_and_cache_examples()
in biolm/run_classification.py
70 37 5
def reformatter()
in preprocessing/preprocess_i2b2_2010_ner.py
42 29 4
def compute_metrics()
in biolm/utils_classification.py
58 28 4
def evaluate()
in biolm/run_classification.py
80 25 4
def read_xml_file()
in preprocessing/preprocess_i2b2_2014_ner.py
58 23 3
def read_xml_file()
in preprocessing/preprocess_i2b2_2012_ner.py
65 21 3
def load_and_cache_examples()
in biolm/run_sequence_labelling.py
41 19 5
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 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 reprocess_PHI_labels()
in preprocessing/preprocess_i2b2_2014_ner.py
42 13 5
def read_examples_from_file()
in biolm/utils_sequence_labelling.py
24 9 2
def evaluate()
in biolm/run_sequence_labelling.py
55 8 7
def build_label_vocab()
in preprocessing/preprocess_i2b2_2010_ner.py
17 8 1
def main()
in preprocessing/preprocess_i2b2_2012_ner.py
21 7 2