facebookresearch / moco-v3
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 60 units with 791 lines of code in units (72.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (265 lines of code)
    • 0 medium complex units (0 lines of code)
    • 9 simple units (232 lines of code)
    • 49 very simple units (294 lines of code)
0% | 33% | 0% | 29% | 37%
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% | 33% | 0% | 29% | 37%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 44% | 0% | 26% | 29%
transfer0% | 0% | 0% | 41% | 58%
moco0% | 0% | 0% | 34% | 66%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main_worker()
in main_lincls.py
141 43 3
def main_worker()
in main_moco.py
124 26 3
def train()
in main_moco.py
35 8 7
def build_dataset()
in transfer/datasets.py
37 8 2
def step()
in moco/optimizer.py
22 8 1
def main()
in main_moco.py
23 7 0
def _build_mlp()
in moco/builder.py
12 7 6
def main()
in main_lincls.py
23 7 0
def train()
in main_lincls.py
31 7 6
def __init__()
in vits.py
19 6 3
def validate()
in main_lincls.py
30 6 4
def sanity_check()
in main_lincls.py
12 5 3
8 3 3
def __getitem__()
in transfer/oxford_pets_dataset.py
11 3 2
def __getitem__()
in transfer/oxford_flowers_dataset.py
9 3 2
def __init__()
in vits.py
22 3 7
def forward()
in vits.py
9 3 2
def save_checkpoint()
in main_moco.py
4 2 3
def display()
in main_moco.py
4 2 2
def build_transform()
in transfer/datasets.py
14 2 2