facebookresearch / simmc2
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 67 units with 1,254 lines of code in units (48.0% of code).
    • 1 very complex units (373 lines of code)
    • 1 complex units (74 lines of code)
    • 1 medium complex units (79 lines of code)
    • 13 simple units (309 lines of code)
    • 51 very simple units (419 lines of code)
29% | 5% | 6% | 24% | 33%
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
py29% | 5% | 6% | 24% | 33%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
mm_dst/gpt2_dst/scripts59% | 0% | 0% | 14% | 25%
mm_dst/utils0% | 36% | 0% | 6% | 56%
disambiguate0% | 0% | 40% | 44% | 15%
utils0% | 0% | 0% | 47% | 52%
mm_dst/gpt2_dst/utils0% | 0% | 0% | 61% | 38%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in model/mm_dst/gpt2_dst/scripts/run_language_modeling.py
373 59 0
def evaluate_frame()
in model/mm_dst/utils/evaluate_dst.py
74 31 3
def main()
in model/disambiguate/train_model.py
79 14 1
def evaluate_model()
in model/disambiguate/train_model.py
26 9 5
def get_indexed_data()
in model/disambiguate/dataloader.py
32 9 2
def parse_flattened_result()
in model/mm_dst/gpt2_dst/utils/convert.py
35 8 1
def prepare_xlm_input()
in model/mm_dst/gpt2_dst/scripts/run_generation.py
16 8 4
def prepare_xlm_input()
in model/mm_dst/gpt2_dst/scripts/run_retrieval.py
16 8 4
def main()
in model/disambiguate/format_disambiguation_data.py
29 8 1
def evaluate_response_retrieval()
in model/utils/retrieval_evaluation.py
32 8 3
def evaluate_disambiguation()
in model/utils/disambiguator_evaluation.py
21 8 3
def main()
in model/utils/visualize_bboxes.py
27 8 1
def load_and_cache_examples()
in model/mm_dst/gpt2_dst/scripts/run_language_modeling.py
16 7 3
def main()
in model/mm_dst/gpt2_dst/scripts/format_retrieval_results.py
27 6 1
def _rotate_checkpoints()
in model/mm_dst/gpt2_dst/scripts/run_language_modeling.py
19 6 3
def evaluate_from_json()
in model/mm_dst/utils/evaluate_dst.py
13 6 2
def adjust_length_to_model()
in model/mm_dst/gpt2_dst/scripts/run_generation.py
8 5 2
def adjust_length_to_model()
in model/mm_dst/gpt2_dst/scripts/run_retrieval.py
8 5 2
def prepare_ctrl_input()
in model/mm_dst/gpt2_dst/scripts/run_generation.py
11 4 4
def prepare_ctrl_input()
in model/mm_dst/gpt2_dst/scripts/run_retrieval.py
11 4 4