facebookresearch / ELI5
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 23 units with 584 lines of code in units (81.7% of code).
    • 1 very complex units (152 lines of code)
    • 2 complex units (157 lines of code)
    • 1 medium complex units (36 lines of code)
    • 4 simple units (82 lines of code)
    • 15 very simple units (157 lines of code)
26% | 26% | 6% | 14% | 26%
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
py26% | 26% | 6% | 14% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
data_creation34% | 35% | 8% | 18% | 3%
model_code0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in data_creation/download_support_docs.py
152 51 0
def main()
in data_creation/download_reddit_qalist.py
100 30 0
def download_and_process()
in data_creation/download_reddit_qalist.py
57 26 4
def select_pars()
in data_creation/select_sentences_tfidf.py
36 21 5
def post_process()
in data_creation/download_reddit_qalist.py
10 7 2
def main()
in data_creation/finalize_qda.py
20 7 0
def main()
in data_creation/select_sentences_tfidf.py
39 7 0
def gather_dump_urls()
in data_creation/download_reddit_qalist.py
13 6 2
def prepare()
in model_code/compute_rouge.py
4 5 2
def masking_tokens()
in model_code/process_data_to_source_target.py
17 4 1
def valid_comment()
in data_creation/download_reddit_qalist.py
5 4 1
def form_multitask_source_target()
in model_code/process_data_to_source_target.py
20 3 6
def read_data()
in model_code/process_data_to_source_target.py
12 2 1
def write_output()
in model_code/process_data_to_source_target.py
4 2 2
def form_source_target()
in model_code/process_data_to_source_target.py
7 2 5
def form_multitask()
in model_code/process_data_to_source_target.py
23 2 3
def form_multitask_valid()
in model_code/process_data_to_source_target.py
7 2 3
def open_data()
in model_code/compute_rouge.py
7 1 2
def rouge_calculation()
in model_code/compute_rouge.py
5 1 2
def open_files()
in model_code/pos_tag.py
6 1 3