facebookresearch / accentor
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 29 units with 961 lines of code in units (65.8% of code).
    • 2 very complex units (334 lines of code)
    • 3 complex units (390 lines of code)
    • 2 medium complex units (114 lines of code)
    • 1 simple units (31 lines of code)
    • 21 very simple units (92 lines of code)
34% | 40% | 11% | 3% | 9%
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
py34% | 40% | 11% | 3% | 9%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT34% | 40% | 11% | 3% | 9%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in gen_predict.py
164 55 0
def main()
in run_multiple_choice.py
170 51 0
def main()
in gen_delex.py
172 48 0
def train()
in run_multiple_choice.py
109 46 4
def main()
in run_language_modeling.py
109 29 0
def load_and_cache_examples()
in run_multiple_choice.py
48 16 5
def evaluate()
in run_multiple_choice.py
66 15 5
def __init__()
in utils_multiple_choice.py
31 8 1
def bleuscorer()
in utils.py
7 4 2
def get_dataset()
in run_language_modeling.py
8 3 3
def select_field()
in run_multiple_choice.py
8 3 2
def set_seed()
in run_generation.py
5 2 1
def set_seed()
in run_multiple_choice.py
6 2 1
def _create_examples()
in utils_multiple_choice.py
12 2 3
def _mp_fn()
in run_language_modeling.py
2 1 1
def clean()
in gen_parlai_data.py
2 1 1
def clean()
in gen_arranger_input.py
2 1 1
def simple_accuracy()
in run_multiple_choice.py
2 1 2
def __init__()
in utils_multiple_choice.py
6 1 6
def __init__()
in utils_multiple_choice.py
4 1 0