facebookresearch / improved_vrnn
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 143 units with 3,401 lines of code in units (93.1% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (149 lines of code)
    • 5 medium complex units (279 lines of code)
    • 23 simple units (876 lines of code)
    • 114 very simple units (2,097 lines of code)
0% | 4% | 8% | 25% | 61%
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% | 4% | 8% | 25% | 61%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 15% | 7% | 20% | 56%
models0% | 0% | 8% | 27% | 63%
dataloaders0% | 0% | 0% | 35% | 64%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
149 47 1
def main()
in sample.py
78 17 1
def forward()
in models/s2s_convlstm.py
42 13 5
def prior()
in models/s2s_big_hier.py
54 12 6
def prior()
in models/s2s_big_hier_128.py
52 11 6
def prior()
in models/s2s_big_hier_v4.py
53 11 7
def __init__()
in models/vrnn_hier.py
118 10 8
def __init__()
in models/vrnn.py
118 10 8
def main()
in dataloaders/prepare_cityscapes.py
27 9 3
def posterior()
in models/s2s_big_hier.py
45 9 4
def posterior()
in models/s2s_big_hier_128.py
45 9 4
def posterior()
in models/s2s_big_hier_v4.py
46 9 5
def init_model()
in init_model.py
25 9 1
def vrnn_arch()
in models/vrnn_hier.py
28 8 5
def vrnn_arch()
in models/vrnn.py
28 8 5
def get_dataset()
in datasets.py
114 7 1
def train_step()
in train_fns.py
25 7 6
def forward()
in models/vrnn_hier.py
16 7 6
def forward()
in models/s2s_big_baseline.py
17 7 5
def forward()
in models/s2s_convlstm_baseline.py
17 7 5