facebookresearch / GloRe
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 146 units with 1,818 lines of code in units (77.7% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (113 lines of code)
    • 8 medium complex units (482 lines of code)
    • 15 simple units (290 lines of code)
    • 122 very simple units (933 lines of code)
0% | 6% | 26% | 15% | 51%
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% | 6% | 26% | 15% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
train0% | 23% | 6% | 20% | 48%
network0% | 0% | 59% | 0% | 40%
ROOT0% | 0% | 78% | 13% | 8%
data0% | 0% | 13% | 20% | 66%
dataset/Kinetics/scripts0% | 0% | 0% | 51% | 48%
dataset/HMDB51/scripts0% | 0% | 0% | 58% | 41%
script0% | 0% | 0% | 0% | 100%
dataset0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def fit()
in train/model.py
113 30 6
def train_model()
in train_model.py
96 20 20
def __init__()
in network/resnet50_3d_gcn_x5.py
92 19 4
def __init__()
in network/resnet101_3d_gcn_x5.py
92 19 4
def init_3d_from_2d_dict()
in network/initializer.py
68 18 3
def getitem_from_raw_video()
in data/video_iterator.py
41 15 2
def _get_video_list()
in data/video_iterator.py
39 13 4
def step()
in train/custom_optim.py
32 12 3
def xavier()
in network/initializer.py
22 11 1
def __init__()
in train/custom_optim.py
13 8 7
def extract_frames()
in data/video_iterator.py
23 8 3
def autofill()
in train_kinetics.py
16 7 1
def convert_video_wapper()
in dataset/Kinetics/scripts/convert_videos.py
24 7 5
def __init__()
in train/lr_scheduler.py
17 7 5
def sampling()
in data/video_sampler.py
20 7 4
def read_video_list()
in dataset/Kinetics/scripts/convert_videos.py
7 6 1
def convert_video_wapper()
in dataset/HMDB51/scripts/convert_videos.py
18 6 4
def __call__()
in train/callback.py
19 6 8
def load_state()
in train/model.py
15 6 3
def load_checkpoint()
in train/model.py
16 6 4