facebookresearch / VMZ
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 256 units with 5,007 lines of code in units (58.9% of code).
    • 1 very complex units (472 lines of code)
    • 2 complex units (336 lines of code)
    • 9 medium complex units (838 lines of code)
    • 14 simple units (686 lines of code)
    • 230 very simple units (2,675 lines of code)
9% | 6% | 16% | 13% | 53%
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
cc47% | 16% | 11% | 11% | 12%
py0% | 5% | 11% | 14% | 69%
h0% | 0% | 47% | 14% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ops28% | 9% | 26% | 12% | 22%
pt/vmz/func0% | 34% | 0% | 10% | 55%
c2/tools0% | 0% | 25% | 22% | 51%
c2/lib/utils0% | 0% | 45% | 12% | 41%
pt/vmz/datasets0% | 0% | 24% | 0% | 75%
pt/vmz/common0% | 0% | 0% | 16% | 83%
pt/vmz/models0% | 0% | 0% | 32% | 67%
utilities/model_conversion0% | 0% | 0% | 9% | 90%
c2/lib/models0% | 0% | 0% | 0% | 100%
pt/tools0% | 0% | 0% | 0% | 100%
c2/data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
cc
void AVDecoder::decodeLoop()
in ops/av_decoder.cc
472 122 6
164 41 17
def train_main()
in pt/vmz/func/train.py
172 28 1
132 23 0
def Train()
in c2/tools/train_net.py
210 19 1
def AddVideoInput()
in c2/lib/utils/model_helper.py
96 16 3
116 15 10
def GetFlopsAndParams()
in c2/lib/utils/model_helper.py
48 15 2
def get_dataset()
in pt/vmz/datasets/data.py
33 12 3
85 11 7
71 11 13
cc
bool LogSpectrum::Init()
in ops/LogMels.cc
47 11 0
bool AVInputOp::Prefetch()
in ops/av_input_op.h
62 9 0
42 9 0
def ExtractFeatures()
in c2/tools/extract_features.py
186 8 1
def r2plus1d_34()
in pt/vmz/models/r2plus1d.py
38 7 4
def r2plus1d_152()
in pt/vmz/models/r2plus1d.py
38 7 4
cc
50 7 6
cc
27 7 0
def getTrainingGPUs()
in c2/lib/utils/model_helper.py
21 7 2