facebookresearch / BLINK
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 285 units with 4,720 lines of code in units (49.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (350 lines of code)
    • 10 medium complex units (898 lines of code)
    • 28 simple units (971 lines of code)
    • 245 very simple units (2,501 lines of code)
0% | 7% | 19% | 20% | 52%
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% | 7% | 19% | 20% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
elq/biencoder0% | 38% | 0% | 23% | 37%
elq/vcg_utils0% | 100% | 0% | 0% | 0%
blink/crossencoder0% | 0% | 62% | 8% | 29%
blink/candidate_ranking0% | 0% | 35% | 27% | 37%
blink/biencoder0% | 0% | 30% | 20% | 49%
blink/candidate_retrieval0% | 0% | 17% | 45% | 36%
blink0% | 0% | 20% | 12% | 67%
scripts0% | 0% | 35% | 17% | 47%
blink/common0% | 0% | 0% | 13% | 86%
blink/indexer0% | 0% | 0% | 37% | 62%
elq/common0% | 0% | 0% | 0% | 100%
elq0% | 0% | 0% | 0% | 100%
elq/index0% | 0% | 0% | 0% | 100%
elq/candidate_ranking0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def entity_linking_tp_with_overlap()
in elq/vcg_utils/measures.py
47 40 2
def main()
in elq/biencoder/train_biencoder.py
303 31 1
def main()
in blink/crossencoder/train_cross.py
180 17 1
def main()
in blink/candidate_ranking/train.py
202 16 1
def extract_questions()
in scripts/create_BLINK_benchmark_data.py
69 16 1
def main()
in blink/biencoder/train_biencoder.py
150 15 1
def eval()
in blink/candidate_retrieval/dataset.py
25 14 3
def evaluate()
in blink/crossencoder/train_cross.py
59 14 7
def main()
in blink/main_solr.py
65 12 1
def get_candidates()
in blink/candidate_generation.py
41 11 2
def main()
in blink/candidate_retrieval/perform_and_evaluate_candidate_retrieval_multithreaded.py
66 11 1
def get_data_for_key()
in blink/candidate_retrieval/data_ingestion.py
41 11 2
def read_conll_file()
in blink/candidate_retrieval/dataset.py
57 10 2
def find_coref()
in blink/candidate_retrieval/dataset.py
16 10 3
def __load_test()
in blink/main_dense.py
28 10 4
def get_sent_context()
in blink/candidate_retrieval/utils.py
33 9 3
def get_list_of_mentions()
in blink/candidate_retrieval/utils.py
80 9 1
def candidate_generation_recall_at()
in blink/candidate_retrieval/evaluator.py
26 9 3
def eval_precision_bm45_dataloader()
in blink/candidate_ranking/utils.py
17 9 5
def evaluate()
in blink/candidate_ranking/evaluate.py
96 9 2