facebookresearch / swav
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 56 units with 1,220 lines of code in units (72.9% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 7 medium complex units (586 lines of code)
    • 4 simple units (108 lines of code)
    • 45 very simple units (526 lines of code)
0% | 0% | 48% | 8% | 43%
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% | 48% | 8% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 0% | 64% | 7% | 28%
src0% | 0% | 8% | 11% | 80%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in main_swav.py
103 17 0
def train()
in main_swav.py
69 16 6
def main()
in eval_semisup.py
117 15 0
29 15 3
def main()
in eval_linear.py
110 12 0
def main()
in main_deepclusterv2.py
103 11 0
def train()
in main_deepclusterv2.py
55 11 7
def cluster_memory()
in main_deepclusterv2.py
47 7 5
def create_logger()
in src/logger.py
22 7 2
def __init__()
in eval_linear.py
20 6 5
def initialize_exp()
in src/utils.py
19 6 3
def _make_layer()
in src/resnet50.py
38 5 6
def forward()
in src/resnet50.py
16 5 2
def train()
in eval_semisup.py
45 4 4
def validate_network()
in eval_semisup.py
32 4 2
def init_memory()
in main_deepclusterv2.py
22 4 2
def train()
in eval_linear.py
46 4 5
def validate_network()
in eval_linear.py
33 4 3
def forward_head()
in src/resnet50.py
8 4 2
16 3 1