facebookresearch / selavi
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 144 units with 2,614 lines of code in units (57.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (210 lines of code)
    • 8 medium complex units (586 lines of code)
    • 18 simple units (487 lines of code)
    • 117 very simple units (1,331 lines of code)
0% | 8% | 22% | 18% | 50%
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% | 8% | 23% | 16% | 51%
js0% | 0% | 0% | 51% | 48%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 15% | 19% | 9% | 55%
datasets0% | 0% | 32% | 23% | 43%
src0% | 0% | 31% | 26% | 41%
cluster_vis/data0% | 0% | 0% | 51% | 48%
cluster_vis0% | 0% | 0% | 23% | 76%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in finetune_video.py
210 26 2
def __getitem__()
in datasets/AVideoDataset.py
80 19 2
def _construct_loader()
in datasets/AVideoDataset.py
73 16 1
29 15 3
def main()
in main.py
152 15 0
def optimize_L_sk_gpu()
in src/sk_utils.py
54 14 4
def cluster()
in src/sk_utils.py
104 13 9
def select_fold_hmdb51()
in datasets/AVideoDataset.py
20 12 5
def train()
in main.py
74 11 6
def select_fold_ucf101()
in datasets/AVideoDataset.py
19 10 6
def match_order()
in src/sk_utils.py
40 10 7
def valid_video()
in datasets/AVideoDataset.py
20 9 2
def color_jitter()
in datasets/video_transforms.py
18 9 4
def forward()
in model.py
28 9 4
def get_model()
in src/retrieval_utils.py
47 9 3
def get_lr()
in src/warmup_scheduler.py
12 9 1
def evaluate()
in finetune_video.py
55 8 5
def random_short_side_scale_jitter()
in datasets/video_transforms.py
27 8 4
def get_data()
in cluster_vis/preprocess.py
23 7 2
def uniform_crop()
in datasets/video_transforms.py
23 7 4