facebookresearch / dpr-scale
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 176 units with 1,825 lines of code in units (58.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (209 lines of code)
    • 8 simple units (208 lines of code)
    • 165 very simple units (1,408 lines of code)
0% | 0% | 11% | 11% | 77%
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% | 11% | 11% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dpr_scale/transforms0% | 0% | 70% | 0% | 29%
dpr_scale/optim0% | 0% | 70% | 0% | 29%
dpr_scale0% | 0% | 0% | 25% | 74%
dpr_scale/task0% | 0% | 0% | 22% | 77%
dpr_scale/utils0% | 0% | 0% | 0% | 100%
dpr_scale/datamodule0% | 0% | 0% | 0% | 100%
dpr_scale/data_prep0% | 0% | 0% | 0% | 100%
dpr_scale/models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def forward()
in dpr_scale/transforms/dpr_transform.py
70 23 3
def forward()
in dpr_scale/transforms/dpr_transform.py
73 22 3
def step()
in dpr_scale/optim/madgrad.py
66 12 3
def _eval_epoch_end()
in dpr_scale/task/dpr_task.py
57 8 3
def ngrams()
in dpr_scale/eval_dpr.py
13 7 5
def entity_groups()
in dpr_scale/eval_dpr.py
17 7 1
def has_answers()
in dpr_scale/eval_dpr.py
16 7 4
def evaluate_retrieval()
in dpr_scale/eval_dpr.py
30 7 4
def quality_checks_qids()
in dpr_scale/msmarco_eval.py
12 7 2
def main()
in dpr_scale/msmarco_eval.py
41 7 0
def compute_metrics()
in dpr_scale/msmarco_eval.py
22 6 2
def main()
in dpr_scale/run_retrieval_multiset.py
43 5 2
def initialize_state()
in dpr_scale/optim/madgrad.py
9 5 1
def get_lines()
in dpr_scale/utils/ccnews_stats.py
7 5 2
def process_json_line()
in dpr_scale/utils/ccnews_stats.py
12 5 1
def __iter__()
in dpr_scale/utils/utils.py
28 5 1
def main()
in dpr_scale/data_prep/prep_conv_datasets.py
14 5 2
def setup()
in dpr_scale/task/dpr_task.py
21 5 2
def training_step()
in dpr_scale/task/dpr_task.py
32 5 3
def _parse_line()
in dpr_scale/datamodule/dpr.py
6 4 2