facebookresearch / LeViT
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 96 units with 1,522 lines of code in units (89.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (195 lines of code)
    • 0 medium complex units (0 lines of code)
    • 7 simple units (327 lines of code)
    • 88 very simple units (1,000 lines of code)
0% | 12% | 0% | 21% | 65%
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% | 12% | 0% | 21% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 12% | 0% | 21% | 65%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main.py
195 48 1
def build_dataset()
in datasets.py
26 10 2
def __init__()
in levit.py
74 9 17
def __init__()
in levit_c.py
74 9 17
39 8 12
def model_factory()
in levit_c.py
37 8 10
def log_every()
in utils.py
45 7 4
32 6 10
10 5 1
def __init__()
in samplers.py
21 5 5
def main()
in run_with_submitit.py
32 4 0
def __init__()
in levit.py
34 4 7
def __init__()
in levit.py
50 4 10
def __init__()
in datasets.py
32 4 8
def build_transform()
in datasets.py
27 4 2
21 4 1
def __init__()
in levit_c.py
34 4 7
def __init__()
in levit_c.py
50 4 10
def forward()
in losses.py
26 4 4
def __iter__()
in samplers.py
13 4 1