facebookresearch / DPR
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 345 units with 3,177 lines of code in units (55.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (331 lines of code)
    • 31 simple units (754 lines of code)
    • 309 very simple units (2,092 lines of code)
0% | 0% | 10% | 23% | 65%
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% | 10% | 23% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 25% | 25% | 48%
dpr/data0% | 0% | 9% | 24% | 65%
dpr/utils0% | 0% | 0% | 40% | 59%
dpr/indexer0% | 0% | 0% | 19% | 80%
dpr0% | 0% | 0% | 42% | 57%
dpr/models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def validate_average_rank()
in train_dense_encoder.py
94 23 1
def main()
in dense_retriever.py
120 22 1
def _linearize_table()
in dpr/data/biencoder_data.py
42 16 3
def read_nq_tables_jsonl()
in dpr/data/tables.py
39 14 2
def read_nq_tables_jsonl()
in dpr/data/biencoder_data.py
36 12 1
def iterate_ds_data()
in dpr/utils/data_utils.py
45 10 2
def _get_gold_ctx_dict()
in dpr/data/reader_data.py
26 10 1
def parse()
in dpr/data/tables.py
21 10 1
def parse()
in dpr/data/biencoder_data.py
21 10 1
def index_data()
in dpr/indexer/faiss_indexers.py
27 10 3
def move_to_cuda()
in dpr/utils/model_utils.py
15 9 1
def move_to_device()
in dpr/utils/model_utils.py
15 9 2
def iterate_ds_data()
in dpr/utils/data_utils.py
19 9 2
def download()
in dpr/data/download_data.py
38 9 2
def calc_questions_overlap()
in dpr/data/tables.py
34 9 3
def get_positions()
in dpr/data/biencoder_data.py
20 9 3
def __getitem__()
in dpr/data/biencoder_data.py
19 9 2
def validate_and_save()
in train_dense_encoder.py
19 9 4
def has_answer()
in dpr/data/qa_validation.py
17 8 4
28 8 2