facebookresearch / agem
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 112 units with 4,831 lines of code in units (92.8% of code).
    • 5 very complex units (1,465 lines of code)
    • 7 complex units (1,013 lines of code)
    • 15 medium complex units (745 lines of code)
    • 13 simple units (537 lines of code)
    • 72 very simple units (1,071 lines of code)
30% | 20% | 15% | 11% | 22%
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
py30% | 20% | 15% | 11% | 22%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT46% | 26% | 10% | 4% | 12%
model0% | 24% | 35% | 10% | 29%
utils0% | 0% | 14% | 36% | 48%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train_task_sequence()
in conv_split_awa_hybrid.py
310 95 17
def train_task_sequence()
in conv_split_awa.py
303 92 15
def train_task_sequence()
in conv_split_cub_hybrid.py
342 65 17
def train_task_sequence()
in conv_split_cub.py
328 63 15
def train_task_sequence()
in fc_permute_mnist.py
182 59 3
def train_task_sequence()
in conv_split_cifar.py
287 50 4
112 49 3
def main()
in conv_split_cub_hybrid.py
137 47 0
def main()
in conv_split_awa.py
130 46 0
def main()
in conv_split_awa_hybrid.py
138 46 0
def main()
in conv_split_cub.py
128 45 0
81 28 3
def main()
in fc_permute_mnist.py
78 22 0
def main()
in conv_split_cifar.py
78 21 0
def loss_and_gradients()
in model/model.py
31 21 2
def __init__()
in model/model.py
67 19 13
def plot_acc_multiple_runs()
in utils/vis_utils.py
48 18 5
def test_task_sequence()
in conv_split_cifar.py
50 16 6
def create_pathint_ops()
in model/model.py
42 16 1
def test_task_sequence()
in conv_split_awa.py
61 13 6