facebookresearch / omnivore
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 54 units with 754 lines of code in units (63.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (189 lines of code)
    • 5 simple units (132 lines of code)
    • 45 very simple units (433 lines of code)
0% | 0% | 25% | 17% | 57%
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% | 0% | 25% | 17% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models0% | 0% | 23% | 19% | 56%
ROOT0% | 0% | 36% | 0% | 63%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def inflate_weights()
in models/swin_transformer_3d.py
66 17 2
def load_and_interpolate_3d_weights()
in models/swin_transformer_3d.py
62 15 2
def uniform_crop()
in transforms.py
32 11 5
def init_weights()
in models/swin_transformer_3d.py
29 11 2
def forward_part1()
in models/swin_transformer_3d.py
39 8 3
def forward_seg()
in models/swin_transformer_3d.py
43 7 4
def forward()
in models/swin_transformer_3d.py
25 7 2
def get_window_size()
in models/swin_transformer_3d.py
13 6 3
def _freeze_stages()
in models/swin_transformer_3d.py
12 6 1
def forward()
in models/swin_transformer_3d.py
19 5 6
def forward_intermediate_features()
in models/swin_transformer_3d.py
15 5 3
def get_patch_embedding()
in models/swin_transformer_3d.py
21 5 2
def forward()
in transforms.py
8 4 2
def forward()
in models/swin_transformer_3d.py
14 4 4
def compute_mask()
in models/swin_transformer_3d.py
27 4 6
def forward()
in transforms.py
15 3 2
def __init__()
in transforms.py
12 3 3
def forward()
in models/swin_transformer_3d.py
7 3 2
def forward()
in models/swin_transformer_3d.py
12 3 4
def run_variable_channel_forward()
in models/swin_transformer_3d.py
12 3 2