facebookresearch / TimeSformer
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 473 units with 6,564 lines of code in units (65.7% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (392 lines of code)
    • 21 medium complex units (928 lines of code)
    • 57 simple units (1,535 lines of code)
    • 391 very simple units (3,709 lines of code)
0% | 5% | 14% | 23% | 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
py0% | 5% | 14% | 23% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools0% | 49% | 18% | 2% | 29%
timesformer/models0% | 4% | 7% | 17% | 70%
timesformer/datasets0% | 0% | 28% | 31% | 39%
timesformer/utils0% | 0% | 13% | 26% | 60%
timesformer/visualization0% | 0% | 0% | 51% | 48%
timesformer/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 train()
in tools/train_net.py
90 28 1
def eval_epoch()
in tools/train_net.py
80 27 6
def load_pretrained()
in timesformer/models/helpers.py
86 27 11
def __getitem__()
in timesformer/datasets/kinetics.py
127 23 2
def visualize()
in tools/visualization.py
74 19 1
def __getitem__()
in timesformer/datasets/ssv2.py
79 18 2
def resume_checkpoint()
in timesformer/models/helpers.py
34 18 5
def random_crop_list()
in timesformer/datasets/cv2_transform.py
43 17 5
def compute_average_precision()
in timesformer/utils/ava_evaluation/metrics.py
30 16 2
def get_class_names()
in timesformer/utils/misc.py
47 14 3
def compute_and_update_bn_stats()
in timesformer/utils/bn_helper.py
39 14 3
def build_model_with_cfg()
in timesformer/models/helpers.py
41 14 9
def uniform_crop_2crops()
in timesformer/datasets/transform.py
35 13 4
def load_state_dict()
in timesformer/models/helpers.py
27 13 2
def perform_wrong_prediction_vis()
in tools/visualization.py
40 12 3
def sub_to_normal_bn()
in timesformer/utils/checkpoint.py
22 12 1
def concatenate()
in timesformer/utils/ava_evaluation/np_box_list_ops.py
33 12 2
def get_dicts()
in timesformer/models/features.py
10 12 3
def adapt_model_from_string()
in timesformer/models/helpers.py
45 12 2