amazon-research / exponential-moving-average-normalization
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 149 units with 2,285 lines of code in units (78.1% of code).
    • 0 very complex units (0 lines of code)
    • 3 complex units (411 lines of code)
    • 4 medium complex units (465 lines of code)
    • 20 simple units (540 lines of code)
    • 122 very simple units (869 lines of code)
0% | 17% | 20% | 23% | 38%
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% | 17% | 20% | 23% | 38%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 31% | 32% | 28% | 7%
backbone0% | 0% | 22% | 8% | 68%
utils0% | 0% | 0% | 37% | 62%
data0% | 0% | 0% | 12% | 87%
models0% | 0% | 0% | 10% | 89%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main_worker()
in main_lincls.py
142 49 3
def main_worker()
in main_moco.py
133 38 3
def main_worker()
in main_byol.py
136 36 3
def main_worker()
in main_fixmatch.py
170 23 3
def train()
in main_fixmatch.py
84 14 6
def main_worker()
in main_cls.py
169 14 3
def __init__()
in backbone/resnet.py
42 13 9
def train()
in main_byol.py
46 10 5
def step()
in utils/LARS.py
40 10 2
def __init__()
in utils/LARS.py
23 9 8
def train()
in main_moco.py
42 9 6
def ss_validate()
in engine.py
61 8 4
def main()
in main_cls.py
26 8 0
def train()
in main_cls.py
35 8 6
def main()
in main_byol.py
20 7 0
def main()
in main_lincls.py
24 7 0
def init_weights()
in utils/init.py
14 7 2
def forward()
in models/moco.py
23 7 3
def main()
in main_fixmatch.py
21 7 0
def main()
in main_moco.py
21 7 0