facebookresearch / pytorchvideo
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 720 units with 5,941 lines of code in units (38.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (85 lines of code)
    • 6 medium complex units (215 lines of code)
    • 27 simple units (742 lines of code)
    • 686 very simple units (4,899 lines of code)
0% | 1% | 3% | 12% | 82%
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% | 1% | 3% | 12% | 82%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pytorchvideo/data0% | 8% | 0% | 20% | 71%
pytorchvideo/models0% | 0% | 7% | 6% | 86%
pytorchvideo/accelerator0% | 0% | 38% | 38% | 23%
pytorchvideo_trainer/pytorchvideo_trainer0% | 0% | 2% | 10% | 86%
pytorchvideo/layers0% | 0% | 0% | 23% | 76%
pytorchvideo/neural_engine0% | 0% | 0% | 17% | 82%
pytorchvideo/transforms0% | 0% | 0% | 3% | 96%
tutorials/video_classification_example0% | 0% | 0% | 0% | 100%
tutorials/video_detection_example0% | 0% | 0% | 0% | 100%
website/website0% | 0% | 0% | 0% | 100%
projects/video_nerf0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __next__()
in pytorchvideo/data/labeled_video_dataset.py
85 30 1
def transmute_Conv3dTemporalKernel1BnAct()
in pytorchvideo/accelerator/deployment/mobile_cpu/transmuter/transmuter_mobile_cpu.py
39 14 1
def step()
in pytorchvideo_trainer/pytorchvideo_trainer/module/optimizer.py
30 14 2
def forward()
in pytorchvideo/models/resnet.py
23 13 2
def create_module()
in pytorchvideo/models/audio_visual_slowfast.py
78 13 3
def _init_resnet_weights()
in pytorchvideo/models/weight_init.py
20 12 2
def transmute_Conv3d3x3x3DwBnAct()
in pytorchvideo/accelerator/deployment/mobile_cpu/transmuter/transmuter_mobile_cpu.py
25 11 1
def __next__()
in pytorchvideo/data/charades.py
39 10 1
def forward()
in pytorchvideo/models/resnet.py
15 9 2
def forward()
in pytorchvideo/models/head.py
26 9 3
def __next__()
in pytorchvideo/data/ssv2.py
30 9 1
def __getitem__()
in pytorchvideo/data/domsev.py
33 9 2
def forward()
in pytorchvideo/layers/accelerator/mobile_cpu/conv_helper.py
186 8 2
def _init_vit_weights()
in pytorchvideo/models/weight_init.py
12 8 2
def transmute_Conv3dPwBnAct()
in pytorchvideo/accelerator/deployment/mobile_cpu/transmuter/transmuter_mobile_cpu.py
21 8 1
def transmute_Conv3d3x1x1BnAct()
in pytorchvideo/accelerator/deployment/mobile_cpu/transmuter/transmuter_mobile_cpu.py
22 8 1
def transmute_Conv3d5x1x1BnAct()
in pytorchvideo/accelerator/deployment/mobile_cpu/transmuter/transmuter_mobile_cpu.py
22 8 1
def add_video_frames()
in pytorchvideo/data/epic_kitchen/utils.py
36 8 2
def transform_clip()
in pytorchvideo/data/epic_kitchen_forecasting.py
25 8 2
def __post_init__()
in pytorchvideo/data/utils.py
20 8 1