tensorflow / gan
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 221 units with 4,198 lines of code in units (85.8% of code).
    • 1 very long units (112 lines of code)
    • 13 long units (830 lines of code)
    • 57 medium size units (1,858 lines of code)
    • 52 small units (821 lines of code)
    • 98 very small units (577 lines of code)
2% | 19% | 44% | 19% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py2% | 19% | 44% | 19% | 13%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_gan/python/features19% | 22% | 21% | 22% | 14%
tensorflow_gan/python0% | 40% | 39% | 4% | 15%
tensorflow_gan/python/estimator0% | 12% | 48% | 20% | 18%
tensorflow_gan/python/losses0% | 18% | 43% | 27% | 10%
tensorflow_gan/python/tpu0% | 29% | 57% | 12% | 0%
tensorflow_gan/python/eval0% | 7% | 57% | 23% | 11%
tensorflow_gan0% | 0% | 52% | 47% | 0%
ROOT0% | 0% | 0% | 71% | 28%
Alternative Visuals
Longest Units
Top 20 longest 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 __init__()
in tensorflow_gan/python/estimator/tpu_gan_estimator.py
84 9 13
def gan_train_ops()
in tensorflow_gan/python/train.py
72 9 7
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 kernel_classifier_distance_and_std_from_activations()
in tensorflow_gan/python/eval/classifier_metrics.py
60 2 4
def combine_adversarial_loss()
in tensorflow_gan/python/losses/losses_impl.py
60 13 9
def wasserstein_gradient_penalty()
in tensorflow_gan/python/losses/losses_impl.py
59 3 13
def __init__()
in tensorflow_gan/python/features/virtual_batchnorm.py
57 11 7
def stargan_loss()
in tensorflow_gan/python/train.py
55 5 2
def create_train_op()
in tensorflow_gan/python/contrib_utils.py
54 13 11
def stargan_model()
in tensorflow_gan/python/train.py
52 11 6
def _get_train_op()
in tensorflow_gan/python/estimator/tpu_gan_estimator.py
51 6 7
def infogan_model()
in tensorflow_gan/python/train.py
49 3 7
def __init__()
in tensorflow_gan/python/estimator/gan_estimator.py
49 9 16
def accumulated_moments_for_inference()
in tensorflow_gan/python/tpu/normalization_ops.py
48 8 3
def get_eval_estimator_spec()
in tensorflow_gan/python/estimator/tpu_gan_estimator.py
47 18 6
def args_to_gan_model()
in tensorflow_gan/python/losses/tuple_losses.py
46 15 1
def sliced_wasserstein_distance()
in tensorflow_gan/python/eval/sliced_wasserstein.py
45 11 8