facebookresearch / SlowFast
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 649 units with 9,566 lines of code in units (53.7% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (500 lines of code)
    • 25 medium complex units (1,349 lines of code)
    • 81 simple units (2,679 lines of code)
    • 539 very simple units (5,038 lines of code)
0% | 5% | 14% | 28% | 52%
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% | 5% | 14% | 28% | 52%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools0% | 58% | 19% | 11% | 10%
slowfast/models0% | 7% | 3% | 20% | 69%
slowfast/datasets0% | 0% | 23% | 39% | 36%
slowfast/utils0% | 0% | 12% | 24% | 62%
slowfast/visualization0% | 0% | 12% | 30% | 57%
slowfast/config0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run_visualization()
in tools/visualization.py
136 40 4
def __init__()
in slowfast/models/video_model_builder.py
162 38 2
def train()
in tools/train_net.py
122 31 1
def eval_epoch()
in tools/train_net.py
80 27 6
def __getitem__()
in slowfast/datasets/kinetics.py
149 25 2
def _images_and_boxes_preprocessing_cv2()
in slowfast/datasets/ava_dataset.py
90 22 3
def draw_video()
in slowfast/visualization/ava_demo_precomputed_boxes.py
87 21 1
def visualize()
in tools/visualization.py
72 19 1
def construct_optimizer()
in slowfast/models/optimizer.py
79 19 2
def random_crop_list()
in slowfast/datasets/cv2_transform.py
43 17 5
def __call__()
in slowfast/visualization/predictor.py
50 16 2
def compute_average_precision()
in slowfast/utils/ava_evaluation/metrics.py
30 16 2
def construct_loader()
in slowfast/datasets/loader.py
67 15 3
def __getitem__()
in slowfast/datasets/charades.py
63 15 2
def __getitem__()
in slowfast/datasets/ssv2.py
58 14 2
def _images_and_boxes_preprocessing()
in slowfast/datasets/ava_dataset.py
68 14 3
def get_class_names()
in slowfast/utils/misc.py
47 14 3
def compute_and_update_bn_stats()
in slowfast/utils/bn_helper.py
39 14 3
def rand_augment_transform()
in slowfast/datasets/rand_augment.py
33 13 2
def __getitem__()
in slowfast/datasets/ava_dataset.py
47 13 2