facebookresearch / curiosity
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 117 units with 1,800 lines of code in units (58.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (443 lines of code)
    • 10 simple units (368 lines of code)
    • 100 very simple units (989 lines of code)
0% | 0% | 24% | 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
py0% | 0% | 24% | 20% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
curiosity0% | 0% | 24% | 20% | 54%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def text_to_instance()
in curiosity/reader.py
97 15 3
def text_to_instance()
in curiosity/baseline_reader.py
102 15 3
def text_to_instance()
in curiosity/baseline_reader.py
102 15 3
def score()
in curiosity/stats.py
36 13 2
def _read()
in curiosity/reader.py
20 11 2
def train()
in curiosity/stats.py
43 11 2
def train()
in curiosity/stats.py
43 11 2
def __init__()
in curiosity/baseline_models.py
93 10 20
def score()
in curiosity/stats.py
24 10 2
def text_to_instance()
in curiosity/reader.py
36 9 3
def gen_configs()
in curiosity/cli.py
77 8 2
def score()
in curiosity/stats.py
32 8 2
def score()
in curiosity/stats.py
32 8 2
def decode()
in curiosity/paraphrase_models.py
18 7 3
def __call__()
in curiosity/metrics.py
15 6 4
def predict_json()
in curiosity/predictors.py
16 6 2
def train()
in curiosity/stats.py
25 6 2
def __init__()
in curiosity/baseline_reader.py
17 5 7
def __init__()
in curiosity/baseline_reader.py
17 5 7
def forward()
in curiosity/baseline_models.py
103 4 7