facebookresearch / FiD
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 104 units with 1,306 lines of code in units (75.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (210 lines of code)
    • 10 simple units (256 lines of code)
    • 90 very simple units (840 lines of code)
0% | 0% | 16% | 19% | 64%
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% | 16% | 19% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 35% | 20% | 44%
src0% | 0% | 8% | 19% | 71%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
60 18 1
def train()
in train_retriever.py
68 17 9
def train()
in train_reader.py
60 13 10
def load_data()
in src/data.py
22 13 3
def forward()
in src/model.py
22 9 5
46 9 10
def evaluate()
in train_retriever.py
35 8 4
def __call__()
in src/data.py
23 8 2
def __call__()
in src/data.py
23 7 2
def main()
in passage_retrieval.py
38 6 1
def set_optim()
in src/util.py
14 6 2
def calculate_matches()
in src/evaluation.py
14 6 2
def embed_text()
in src/model.py
20 6 5
def __getitem__()
in src/data.py
21 6 2
def embed_passages()
in generate_passage_embeddings.py
24 5 4
def index_encoded_data()
in passage_retrieval.py
14 5 3
def add_passages()
in passage_retrieval.py
16 5 3
def get_options()
in src/options.py
14 5 4
def search_knn()
in src/index.py
12 5 4
def tokenize()
in src/evaluation.py
7 5 3