amazon-research / crossnorm-selfnorm
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 260 units with 4,263 lines of code in units (87.4% of code).
    • 0 very complex units (0 lines of code)
    • 5 complex units (697 lines of code)
    • 15 medium complex units (608 lines of code)
    • 35 simple units (1,027 lines of code)
    • 205 very simple units (1,931 lines of code)
0% | 16% | 14% | 24% | 45%
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% | 16% | 14% | 24% | 45%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 37% | 0% | 20% | 42%
segmentation/tool0% | 40% | 5% | 23% | 30%
segmentation/model0% | 7% | 25% | 15% | 51%
models/imagenet0% | 0% | 26% | 32% | 40%
models/cifar0% | 0% | 18% | 38% | 43%
segmentation/util0% | 0% | 16% | 29% | 54%
models0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main_worker()
in segmentation/tool/train_cnsn.py
151 44 3
def main_worker()
in segmentation/tool/train.py
146 43 3
def __init__()
in segmentation/model/cnsn_resnet.py
76 31 16
def main()
in cifar.py
165 27 0
def main()
in imagenet.py
159 26 0
def init_weights()
in segmentation/util/util.py
39 19 5
def __init__()
in segmentation/util/transform.py
30 16 5
def __init__()
in models/imagenet/resnet_cnsn.py
61 16 12
def check()
in segmentation/tool/train.py
22 15 1
def check()
in segmentation/tool/train_cnsn.py
22 15 1
def __init__()
in segmentation/model/cnsn_resnet.py
38 14 15
def __init__()
in segmentation/model/resnet.py
42 13 9
def __init__()
in segmentation/util/transform.py
16 13 3
def make_layers_custom()
in models/cifar/allconv_cnsn.py
62 12 6
def __init__()
in segmentation/model/pspnet.py
46 11 6
def __init__()
in segmentation/model/cnsn_resnet.py
34 11 13
def forward()
in segmentation/model/psanet.py
46 11 2
def __init__()
in segmentation/model/psanet.py
48 11 14
def __init__()
in models/imagenet/resnet_ibn_cnsn.py
54 11 6
def __init__()
in models/cifar/resnext_cnsn.py
48 11 10