facebookresearch / neuromorph
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 191 units with 1,299 lines of code in units (59.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (48 lines of code)
    • 3 simple units (56 lines of code)
    • 187 very simple units (1,195 lines of code)
0% | 0% | 3% | 4% | 91%
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% | 3% | 4% | 91%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
model0% | 0% | 12% | 0% | 87%
utils0% | 0% | 0% | 6% | 93%
data0% | 0% | 0% | 7% | 92%
ROOT0% | 0% | 0% | 0% | 100%
data_preprocessing/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in model/interpolation_net.py
48 11 1
def detach_cpu()
in utils/shape_utils.py
17 10 1
def batch_to_shape()
in data/data.py
14 7 1
def interpolate()
in utils/interpolation_base.py
25 6 2
def interpolate()
in utils/interpolation_base.py
23 5 2
def create_rotation_matrix()
in utils/base_tools.py
11 5 2
def interpolate()
in utils/interpolation_base.py
21 4 2
def __init__()
in model/layers_onet.py
17 4 4
def compute_loss()
in model/interpolation_net.py
43 4 5
def test()
in model/interpolation_net.py
23 4 3
def update()
in model/interpolation_net.py
13 4 3
def rot_sub()
in model/interpolation_net.py
7 4 3
def from_dict()
in utils/interpolation_base.py
4 3 2
def __init__()
in utils/interpolation_base.py
9 3 4
def __init__()
in utils/interpolation_base.py
11 3 3
def get_pred()
in model/interpolation_net.py
32 3 4
def load_self()
in model/interpolation_net.py
17 3 3
def load_chkpt()
in model/interpolation_net.py
10 3 2
def input_to_batch()
in data/data.py
8 3 1
4 3 3