facebookresearch / robust_cvd
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 972 units with 12,448 lines of code in units (67.9% of code).
    • 1 very complex units (240 lines of code)
    • 4 complex units (647 lines of code)
    • 36 medium complex units (2,259 lines of code)
    • 71 simple units (2,274 lines of code)
    • 860 very simple units (7,028 lines of code)
1% | 5% | 18% | 18% | 56%
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
py4% | 0% | 15% | 14% | 66%
cpp0% | 12% | 26% | 23% | 37%
h0% | 0% | 0% | 12% | 87%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT15% | 0% | 16% | 14% | 52%
lib0% | 13% | 27% | 23% | 35%
loss0% | 0% | 38% | 0% | 61%
loaders0% | 0% | 51% | 23% | 25%
optimizer0% | 0% | 38% | 44% | 17%
lib/core0% | 0% | 3% | 15% | 80%
raft0% | 0% | 22% | 0% | 77%
raft/core0% | 0% | 5% | 29% | 64%
monodepth/midas_v20% | 0% | 18% | 0% | 81%
utils0% | 0% | 0% | 10% | 89%
monodepth0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def fine_tune()
in depth_fine_tuning.py
240 64 2
228 43 1
199 43 1
void GridDepthXform::cubicGather()
in lib/DepthMapTransform.cpp
81 26 4
139 26 3
118 25 2
def dynamic_mask_generation()
in dynamic_mask_generation.py
111 23 1
def __getitem__()
in loaders/video_dataset.py
67 23 2
81 21 2
73 20 1
43 19 2
void DepthVideo::load()
in lib/DepthVideo.cpp
121 19 1
void XformDescriptor::parse()
in lib/DepthMapTransform.cpp
87 19 1
82 19 3
char cnpy::map_type()
in lib/core/cnpy.cpp
21 18 1
101 17 1
80 17 1
73 17 2
def scene_flow_loss()
in loss/scene_flow_loss.py
87 16 4
def geometry_consistency_loss()
in loss/consistency_loss.py
97 16 4