facebookresearch / clevr-iep
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 98 units with 1,629 lines of code in units (88.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (100 lines of code)
    • 3 medium complex units (206 lines of code)
    • 17 simple units (473 lines of code)
    • 77 very simple units (850 lines of code)
0% | 6% | 12% | 29% | 52%
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% | 6% | 12% | 29% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
scripts0% | 14% | 28% | 28% | 28%
iep/models0% | 0% | 0% | 29% | 70%
iep0% | 0% | 0% | 29% | 70%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in scripts/preprocess_questions.py
100 34 1
def train_loop()
in scripts/train_model.py
131 22 3
def check_accuracy()
in scripts/train_model.py
37 12 5
def main()
in scripts/run_model.py
38 11 1
def main()
in scripts/extract_features.py
43 9 1
def run_single_example()
in scripts/run_model.py
55 9 2
def build_classifier()
in iep/models/module_net.py
28 9 9
def __getitem__()
in iep/data.py
26 9 2
def get_baseline_model()
in scripts/train_model.py
59 8 1
def tokenize()
in iep/preprocess.py
15 7 6
def build_vocab()
in iep/preprocess.py
22 7 5
def expand_embedding_vocab()
in iep/embedding.py
19 7 4
def __init__()
in iep/models/module_net.py
51 7 5
def _forward_modules_ints_helper()
in iep/models/module_net.py
28 7 5
def forward()
in iep/models/module_net.py
12 7 3
def main()
in scripts/train_model.py
46 6 1
def build_mlp()
in iep/models/baselines.py
18 6 5
def get_dims()
in iep/models/seq2seq.py
11 6 3
def before_rnn()
in iep/models/seq2seq.py
12 6 3
def is_chain()
in iep/programs.py
13 6 1