facebookresearch / neural_stpp
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 320 units with 2,892 lines of code in units (82.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (236 lines of code)
    • 4 medium complex units (161 lines of code)
    • 21 simple units (546 lines of code)
    • 294 very simple units (1,949 lines of code)
0% | 8% | 5% | 18% | 67%
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% | 8% | 5% | 18% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 20% | 3% | 18% | 57%
models/spatial0% | 0% | 9% | 15% | 74%
models/temporal0% | 0% | 14% | 19% | 66%
data0% | 0% | 0% | 58% | 41%
flow_layers0% | 0% | 0% | 30% | 69%
diffeq_layers0% | 0% | 0% | 0% | 100%
models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _main()
in train_stpp.py
236 48 5
def integrate_lambda()
in models/temporal/neural.py
45 17 7
38 14 5
def _cond_logliks()
in models/spatial/jumpcnf.py
52 13 5
def build_fc_odefunc()
in models/spatial/cnf.py
26 13 10
def EM()
in MHP.py
71 10 12
def construct_diffeqnet()
in models/temporal/neural.py
23 10 7
def forward()
in models/spatial/cnf.py
30 10 3
def __next__()
in iterators.py
18 10 1
def __init__()
in models/spatial/attncnf.py
24 8 9
def _cond_logliks()
in models/spatial/attncnf.py
41 8 5
21 7 4
def load_data()
in viz_dataset.py
15 7 2
def forward()
in models/temporal/neural.py
13 7 3
def integrate()
in models/spatial/cnf.py
30 7 9
def get_t0_t1()
in train_stpp.py
15 7 1
def forward()
in flow_layers/planar.py
21 6 8
def forward()
in flow_layers/container.py
14 6 6
def __init__()
in datasets.py
18 6 2
12 6 1