amazon-research / fact-check-summarization
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 2,116 units with 23,901 lines of code in units (71.2% of code).
    • 2 very complex units (491 lines of code)
    • 15 complex units (1,681 lines of code)
    • 73 medium complex units (3,833 lines of code)
    • 178 simple units (4,789 lines of code)
    • 1,848 very simple units (13,107 lines of code)
2% | 7% | 16% | 20% | 54%
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
py2% | 7% | 16% | 20% | 54%
cpp0% | 0% | 0% | 12% | 87%
lua0% | 0% | 0% | 0% | 100%
pyx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
fairseq_cli26% | 39% | 9% | 11% | 13%
preprocess6% | 31% | 18% | 30% | 12%
fairseq0% | 11% | 19% | 18% | 50%
fairseq/data0% | 1% | 12% | 11% | 75%
fairseq/models0% | 0% | 16% | 17% | 65%
fairseq/tasks0% | 0% | 26% | 22% | 51%
fairseq/optim0% | 0% | 16% | 14% | 69%
fairseq/criterions0% | 0% | 18% | 23% | 57%
scripts0% | 0% | 21% | 34% | 43%
fairseq/modules0% | 0% | 5% | 31% | 62%
fairseq/logging0% | 0% | 0% | 19% | 80%
fairseq/clib0% | 0% | 0% | 18% | 81%
fairseq/benchmark0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in fairseq_cli/preprocess.py
304 68 1
def make_unlikelihood_dataset()
in preprocess/evaluate_hypo.py
187 52 1
def _main()
in fairseq_cli/generate.py
150 45 2
def select_unlikelihood_hypos_lm_score()
in preprocess/evaluate_hypo.py
120 43 1
def main()
in fairseq_cli/eval_lm.py
148 39 1
def generate()
in fairseq/iterative_refinement_generator.py
141 38 4
def _run_qa_gen_process_local_batch_lines()
in preprocess/sm_inference_asum.py
143 37 10
def train_step()
in fairseq/trainer.py
108 32 3
def save_checkpoint()
in fairseq/checkpoint_utils.py
73 31 4
def main()
in fairseq_cli/interactive.py
103 31 1
def _run_q_gen_process_local()
in preprocess/sm_inference_asum.py
144 30 11
def evaluate_hypo()
in preprocess/evaluate_hypo.py
143 29 7
def filter_qas_dataset_lm_score()
in preprocess/evaluate_hypo.py
81 29 1
def preprecess_QA_generation_newsqa_squad()
in preprocess/data_prepro_clean.py
92 29 5
def _filter_by_size_dynamic()
in fairseq/data/data_utils.py
39 26 4
def _run_qa_gen_process_local()
in preprocess/sm_inference_asum.py
133 26 10
def main()
in fairseq_cli/train.py
63 26 2
def build_model()
in fairseq/models/multilingual_transformer.py
91 25 3
def _run_qa_eval_process_local()
in preprocess/sm_inference_asum.py
112 25 12
def sample()
in fairseq/models/bart/hub_interface.py
32 24 8