facebookresearch / Motionformer
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 499 units with 6,673 lines of code in units (61.0% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (365 lines of code)
    • 16 medium complex units (845 lines of code)
    • 64 simple units (1,795 lines of code)
    • 416 very simple units (3,668 lines of code)
0% | 5% | 12% | 26% | 54%
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% | 12% | 26% | 54%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools0% | 81% | 0% | 7% | 10%
slowfast/datasets0% | 7% | 16% | 29% | 47%
slowfast/utils0% | 0% | 10% | 20% | 69%
slowfast/visualization0% | 0% | 12% | 31% | 55%
slowfast/models0% | 0% | 16% | 38% | 45%
ROOT0% | 0% | 0% | 0% | 100%
slowfast/config0% | 0% | 0% | 0% | 100%
data/kinetics_4000% | 0% | 0% | 0% | 100%
data/kinetics_6000% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in tools/train_net.py
116 34 1
def eval_epoch()
in tools/train_net.py
100 31 6
def __getitem__()
in slowfast/datasets/kinetics.py
149 31 2
def __getitem__()
in slowfast/datasets/ssv2.py
95 23 2
def draw_video()
in slowfast/visualization/ava_demo_precomputed_boxes.py
87 21 1
def __getitem__()
in slowfast/datasets/epickitchens.py
76 21 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 __init__()
in slowfast/models/video_model_builder.py
118 16 2
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/autoaugment.py
29 13 3
def construct_loader()
in slowfast/datasets/loader.py
59 13 3
def put_fn()
in slowfast/visualization/demo_loader.py
31 12 1
def sub_to_normal_bn()
in slowfast/utils/checkpoint.py
22 12 1
def step()
in slowfast/models/adamw.py
38 12 2
def random_short_side_scale_jitter_list()
in slowfast/datasets/cv2_transform.py
29 11 4
def init_weights()
in slowfast/utils/weight_init_helper.py
21 11 3
def get_long_cycle_schedule()
in slowfast/utils/multigrid.py
61 11 2
def random_sized_crop_list()
in slowfast/datasets/cv2_transform.py
36 10 3