facebookresearch / moco
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 43 units with 601 lines of code in units (66.9% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (235 lines of code)
    • 0 medium complex units (0 lines of code)
    • 4 simple units (106 lines of code)
    • 37 very simple units (260 lines of code)
0% | 39% | 0% | 17% | 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% | 39% | 0% | 17% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 48% | 0% | 21% | 29%
moco0% | 0% | 0% | 0% | 100%
detection0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main_worker()
in main_lincls.py
132 41 3
def main_worker()
in main_moco.py
103 28 3
def main()
in main_moco.py
23 7 0
def main()
in main_lincls.py
23 7 0
def train()
in main_moco.py
30 6 6
def train()
in main_lincls.py
30 6 6
9 5 3
def validate()
in main_lincls.py
29 5 4
def sanity_check()
in main_lincls.py
12 5 2
6 4 3
def __init__()
in moco/builder.py
17 3 7
def _dequeue_and_enqueue()
in moco/builder.py
8 3 2
def _batch_shuffle_ddp()
in moco/builder.py
11 3 2
def forward()
in moco/builder.py
16 3 3
def build_evaluator()
in detection/train_net.py
8 3 4
def save_checkpoint()
in main_moco.py
4 2 3
def display()
in main_moco.py
4 2 2
def accuracy()
in main_moco.py
12 2 3
3 2 1
def _batch_unshuffle_ddp()
in moco/builder.py
8 2 3