tensorflow / gan
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 221 units with 4,198 lines of code in units (85.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (112 lines of code)
    • 10 medium complex units (587 lines of code)
    • 25 simple units (831 lines of code)
    • 185 very simple units (2,668 lines of code)
0% | 2% | 13% | 19% | 63%
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% | 2% | 13% | 19% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_gan/python/features0% | 19% | 22% | 15% | 42%
tensorflow_gan/python0% | 0% | 24% | 16% | 59%
tensorflow_gan/python/losses0% | 0% | 16% | 1% | 82%
tensorflow_gan/python/tpu0% | 0% | 29% | 64% | 5%
tensorflow_gan/python/estimator0% | 0% | 4% | 27% | 68%
tensorflow_gan/python/eval0% | 0% | 5% | 20% | 74%
tensorflow_gan0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def group_norm()
in tensorflow_gan/python/features/normalization.py
112 30 5
def gan_loss()
in tensorflow_gan/python/train.py
90 20 13
def get_eval_estimator_spec()
in tensorflow_gan/python/estimator/tpu_gan_estimator.py
47 18 6
def instance_norm()
in tensorflow_gan/python/features/normalization.py
69 17 11
def standardize_batch()
in tensorflow_gan/python/tpu/normalization_ops.py
67 16 9
def args_to_gan_model()
in tensorflow_gan/python/losses/tuple_losses.py
46 15 1
def create_train_op()
in tensorflow_gan/python/contrib_utils.py
54 13 11
def combine_adversarial_loss()
in tensorflow_gan/python/losses/losses_impl.py
60 13 9
def stargan_model()
in tensorflow_gan/python/train.py
52 11 6
def __init__()
in tensorflow_gan/python/features/virtual_batchnorm.py
57 11 7
def sliced_wasserstein_distance()
in tensorflow_gan/python/eval/sliced_wasserstein.py
45 11 8
def __init__()
in tensorflow_gan/python/estimator/stargan_estimator.py
40 10 13
def _classifier_score_from_logits_helper()
in tensorflow_gan/python/eval/classifier_metrics.py
30 10 2
def gan_train_ops()
in tensorflow_gan/python/train.py
72 9 7
def __init__()
in tensorflow_gan/python/estimator/gan_estimator.py
49 9 16
def __init__()
in tensorflow_gan/python/estimator/tpu_gan_estimator.py
84 9 13
def _frechet_classifier_distance_from_activations_helper()
in tensorflow_gan/python/eval/classifier_metrics.py
43 9 3
def train_step()
in tensorflow_gan/python/train.py
33 8 4
def accumulated_moments_for_inference()
in tensorflow_gan/python/tpu/normalization_ops.py
48 8 3
def tensor_pool()
in tensorflow_gan/python/features/random_tensor_pool.py
41 8 4