facebookresearch / mvp
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 479 units with 5,458 lines of code in units (62.4% of code).
    • 0 very complex units (0 lines of code)
    • 6 complex units (847 lines of code)
    • 18 medium complex units (1,201 lines of code)
    • 28 simple units (816 lines of code)
    • 427 very simple units (2,594 lines of code)
0% | 15% | 22% | 14% | 47%
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% | 24% | 21% | 19% | 35%
cpp0% | 30% | 25% | 0% | 43%
h0% | 0% | 22% | 10% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models/decoders0% | 46% | 21% | 17% | 15%
data0% | 75% | 0% | 0% | 24%
models0% | 19% | 2% | 38% | 39%
extensions/mvpraymarch0% | 4% | 37% | 9% | 47%
extensions/utils0% | 0% | 13% | 0% | 86%
utils0% | 0% | 19% | 20% | 60%
models/bg0% | 0% | 48% | 0% | 51%
models/raymarchers0% | 0% | 0% | 64% | 35%
models/encoders0% | 0% | 0% | 32% | 67%
models/colorcals0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __getitem__()
in data/multiviewvideo.py
163 49 2
def forward()
in models/volumetric.py
181 48 28
def forward()
in models/decoders/mvp.py
202 47 10
def forward()
in models/decoders/nv.py
88 30 10
std::vector raymarch_backward()
in extensions/mvpraymarch/mvpraymarch.cpp
101 26 33
def __init__()
in data/multiviewvideo.py
112 26 34
def forward()
in extensions/mvpraymarch/mvpraymarch.py
71 23 13
def __init__()
in models/decoders/mvp.py
51 21 16
__global__ void raymarch_subset_backward_kernel()
in extensions/mvpraymarch/mvpraymarch_subset_kernel.h
85 21 14
std::vector raymarch_forward()
in extensions/mvpraymarch/mvpraymarch.cpp
83 20 27
def gradcheck()
in extensions/mvpraymarch/mvpraymarch.py
200 20 14
def forward()
in models/bg/mlp.py
36 18 9
80 18 12
def initmod()
in models/utils.py
22 17 3
__forceinline__ __device__ void backward()
in extensions/mvpraymarch/primtransf.h
21 16 5
def writeimage()
in utils/videowriter.py
48 14 4
def __init__()
in models/decoders/mvp.py
82 14 13
__global__ void raymarch_subset_forward_kernel()
in extensions/mvpraymarch/mvpraymarch_subset_kernel.h
66 13 14
def gradcheck()
in extensions/utils/utils.py
100 13 0
def __init__()
in models/bg/mlp.py
20 12 7