facebookresearch / deit
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 123 units with 1,651 lines of code in units (90.7% of code).
    • 1 very complex units (211 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (52 lines of code)
    • 5 simple units (142 lines of code)
    • 116 very simple units (1,246 lines of code)
12% | 0% | 3% | 8% | 75%
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
py12% | 0% | 3% | 8% | 75%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT12% | 0% | 3% | 8% | 75%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
211 52 1
def __init__()
in patchconvnet_models.py
52 11 28
34 7 11
def log_every()
in utils.py
45 7 4
def forward()
in losses.py
25 7 4
def build_dataset()
in datasets.py
18 6 2
def __init__()
in samplers.py
20 6 6
def _init_weights()
in patchconvnet_models.py
8 5 2
def __init__()
in cait_models.py
41 5 27
def _init_weights()
in cait_models.py
8 5 2
def _init_weights()
in resmlp_models.py
8 5 2
def __init__()
in patchconvnet_models.py
13 4 14
def forward_features()
in patchconvnet_models.py
14 4 2
def main()
in run_with_submitit.py
31 4 0
def __init__()
in datasets.py
31 4 8
def build_transform()
in datasets.py
27 4 2
21 4 1
def __init__()
in resmlp_models.py
20 4 12
def resmlp_24()
in resmlp_models.py
19 4 4
def resmlpB_24()
in resmlp_models.py
19 4 4