facebookresearch / pytorch_GAN_zoo
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 267 units with 4,011 lines of code in units (85.3% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (149 lines of code)
    • 16 medium complex units (931 lines of code)
    • 32 simple units (902 lines of code)
    • 218 very simple units (2,029 lines of code)
0% | 3% | 23% | 22% | 50%
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% | 3% | 23% | 22% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
models/eval0% | 20% | 65% | 0% | 14%
models0% | 0% | 17% | 23% | 59%
models/trainer0% | 0% | 19% | 26% | 53%
models/utils0% | 0% | 18% | 22% | 58%
ROOT0% | 0% | 25% | 45% | 28%
models/metrics0% | 0% | 11% | 27% | 60%
models/datasets0% | 0% | 15% | 63% | 20%
models/networks0% | 0% | 5% | 11% | 83%
visualization0% | 0% | 0% | 50% | 49%
models/loss_criterions0% | 0% | 0% | 15% | 84%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def gradientDescentOnInput()
in models/eval/inspirational_generation.py
149 36 12
def test()
in models/eval/laplacian_SWD.py
108 23 2
def buildTrainValTest()
in models/metrics/nn_score.py
47 19 3
def buildMaskSplit()
in models/utils/product_module.py
35 19 7
def test()
in models/eval/visualization.py
89 19 2
def test()
in models/eval/metric_plot.py
51 17 2
def test()
in models/eval/inspirational_generation.py
107 17 2
def test()
in models/eval/nn_metric.py
68 15 2
def test()
in models/eval/inception.py
62 15 2
def __init__()
in models/datasets/attrib_dataset.py
44 14 9
def getLastCheckPoint()
in models/utils/utils.py
22 14 4
def forward()
in models/networks/progressive_conv_net.py
29 14 2
def fashionGenSetup()
in datasets.py
56 13 2
def train()
in models/trainer/progressive_gan_trainer.py
46 13 1
def optimizeParameters()
in models/base_GAN.py
73 12 3
def load_state_dict()
in models/base_GAN.py
39 12 6
def loadSavedTraining()
in models/trainer/gan_trainer.py
55 12 7
def __getitem__()
in models/datasets/hd5.py
26 10 2
def loadAttribDict()
in models/datasets/attrib_dataset.py
32 10 4
def loadStateDictCompatible()
in models/utils/utils.py
21 10 2