facebookresearch / GDT
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 266 units with 3,785 lines of code in units (66.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (404 lines of code)
    • 9 medium complex units (570 lines of code)
    • 26 simple units (681 lines of code)
    • 229 very simple units (2,130 lines of code)
0% | 10% | 15% | 17% | 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% | 10% | 15% | 17% | 56%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 21% | 15% | 4% | 58%
datasets0% | 0% | 20% | 35% | 43%
src0% | 0% | 5% | 23% | 70%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main_gdt.py
181 34 1
def main()
in eval_video.py
223 30 2
def main()
in main_stica.py
130 22 0
def __getitem__()
in datasets/AVideoDataset.py
81 20 2
def __getitem__()
in datasets/HT100MDataset.py
50 18 2
def _construct_loader()
in datasets/AVideoDataset.py
79 17 1
29 15 3
def __init__()
in src/resnet.py
42 13 9
def train()
in main_stica.py
101 12 6
def valid_video()
in datasets/AVideoDataset.py
28 12 4
def forward()
in model.py
30 11 4
def valid_video()
in datasets/GDTPretrainDataset.py
20 9 2
def _construct_loader()
in datasets/GDTPretrainDataset.py
53 9 1
def color_jitter()
in datasets/video_transforms.py
18 9 4
def solve_interpolation()
in datasets/sparse_image_warp_pytorch.py
21 9 4
def get_lr()
in src/scheduler.py
12 9 1
def __getitem__()
in datasets/GDTPretrainDataset.py
53 8 2
def select_fold_hmdb51()
in datasets/AVideoDataset.py
15 8 5
def random_short_side_scale_jitter()
in datasets/video_transforms.py
27 8 4
def evaluate()
in eval_video.py
52 8 5