facebookresearch / multihop_dense_retrieval
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 304 units with 5,142 lines of code in units (78.3% of code).
    • 0 very complex units (0 lines of code)
    • 6 complex units (856 lines of code)
    • 26 medium complex units (1,217 lines of code)
    • 51 simple units (1,236 lines of code)
    • 221 very simple units (1,833 lines of code)
0% | 16% | 23% | 24% | 35%
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% | 16% | 23% | 24% | 35%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts0% | 56% | 32% | 0% | 11%
mdr/qa0% | 16% | 32% | 22% | 28%
mdr/retrieval0% | 17% | 14% | 25% | 42%
mdr/retrieval/data0% | 0% | 33% | 35% | 31%
mdr/retrieval/utils0% | 0% | 7% | 45% | 47%
submitit0% | 0% | 0% | 78% | 21%
mdr/retrieval/models0% | 0% | 0% | 0% | 100%
scripts/eval0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in mdr/retrieval/train_single.py
152 40 0
def main()
in scripts/train_momentum.py
159 39 0
def main()
in scripts/train_qa.py
152 39 0
def main()
in mdr/qa/train_ranker.py
146 38 0
def main()
in scripts/train_mhop.py
152 38 0
def __init__()
in mdr/qa/qa_dataset.py
95 30 7
def __getitem__()
in mdr/qa/qa_dataset.py
69 25 2
def qa_collate()
in mdr/qa/qa_dataset.py
30 24 2
def mhop_collate()
in mdr/retrieval/data/mhop_dataset.py
30 24 2
def unified_collate()
in mdr/retrieval/data/unified_dataset.py
28 22 2
def nq_unified_collate()
in mdr/retrieval/data/unified_dataset.py
27 21 2
def get_final_text()
in mdr/qa/utils.py
50 19 4
def predict()
in scripts/train_qa.py
137 19 5
def decomposed_errors()
in mdr/retrieval/decomposed_analysis.py
44 18 0
def mhop_collate()
in mdr/retrieval/data/sp_datasets.py
22 17 2
def _train()
in mdr/qa/qa_trainer.py
69 16 1
def combine_corpus()
in mdr/retrieval/data/data_utils.py
42 15 0
def forward()
in mdr/qa/qa_model.py
49 14 2
def analyze_results()
in mdr/retrieval/decomposed_analysis.py
23 13 0
def __init__()
in mdr/retrieval/data/encode_datasets.py
43 13 7