facebookresearch / GENRE
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 72 units with 793 lines of code in units (18.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 2 medium complex units (103 lines of code)
    • 10 simple units (210 lines of code)
    • 60 very simple units (480 lines of code)
0% | 0% | 12% | 26% | 60%
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
py0% | 0% | 12% | 26% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
genre0% | 0% | 9% | 26% | 63%
scripts_mgenre0% | 0% | 35% | 18% | 46%
scripts_genre0% | 0% | 0% | 56% | 43%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
62 25 3
def evaluate()
in scripts_mgenre/evaluate_mel.py
41 18 2
def convert_kilt_to_fairseq()
in scripts_genre/convert_kilt_to_fairseq.py
18 10 1
def get()
in genre/trie.py
18 9 2
def get_pointer_end()
in genre/entity_linking.py
20 8 2
def get()
in genre/trie.py
11 8 3
def create_input()
in genre/utils.py
48 7 4
def weak_tp()
in genre/utils.py
14 7 2
def extract_pages()
in genre/utils.py
37 7 1
def get_trie_mention()
in genre/entity_linking.py
22 7 2
def clean_anchor_lang()
in scripts_mgenre/preprocess_anchors.py
14 6 2
def encode()
in scripts_mgenre/preprocess_sentencepiece.py
8 6 2
def get_micro_precision()
in genre/utils.py
15 5 3
def get_micro_recall()
in genre/utils.py
15 5 3
def prefix_allowed_tokens_fn()
in genre/entity_linking.py
15 5 2
def get_status()
in genre/entity_linking.py
17 5 1
def get_trie_entity()
in genre/entity_linking.py
24 5 2
def batch_it()
in genre/utils.py
9 4 2
def search_simple()
in genre/utils.py
11 4 3
def search_wikipedia()
in genre/utils.py
9 4 4