tensorflow / addons
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 902 units with 10,030 lines of code in units (45.5% of code).
    • 0 very long units (0 lines of code)
    • 28 long units (1,771 lines of code)
    • 93 medium size units (2,829 lines of code)
    • 175 small units (2,537 lines of code)
    • 606 very small units (2,893 lines of code)
0% | 17% | 28% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 11% | 25% | 28% | 34%
cc0% | 43% | 39% | 12% | 3%
h0% | 24% | 32% | 19% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_addons/custom_ops0% | 41% | 38% | 13% | 5%
tensorflow_addons/optimizers0% | 19% | 24% | 21% | 34%
tensorflow_addons/seq2seq0% | 17% | 21% | 30% | 31%
tensorflow_addons/layers0% | 8% | 26% | 35% | 30%
build_deps/toolchains0% | 27% | 33% | 21% | 17%
tensorflow_addons/rnn0% | 14% | 37% | 33% | 14%
tensorflow_addons/metrics0% | 0% | 33% | 21% | 44%
tensorflow_addons/utils0% | 0% | 57% | 16% | 25%
tensorflow_addons/losses0% | 0% | 25% | 13% | 61%
tensorflow_addons/callbacks0% | 0% | 21% | 43% | 35%
ROOT0% | 0% | 28% | 30% | 41%
tensorflow_addons/testing0% | 0% | 74% | 0% | 25%
tensorflow_addons/activations0% | 0% | 20% | 45% | 34%
tools0% | 0% | 75% | 0% | 24%
tensorflow_addons/image0% | 0% | 5% | 34% | 60%
tensorflow_addons0% | 0% | 44% | 0% | 56%
tensorflow_addons/text0% | 0% | 7% | 35% | 56%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build()
in tensorflow_addons/layers/noisy_dense.py
91 7 2
void operator()
in tensorflow_addons/custom_ops/image/cc/kernels/resampler_ops.cc
87 18 0
Status operator()
in tensorflow_addons/custom_ops/layers/cc/kernels/correlation_cost_op.cc
76 12 0
def body()
in tensorflow_addons/seq2seq/decoder.py
70 11 6
void Compute()
in tensorflow_addons/custom_ops/text/cc/kernels/skip_gram_kernels.cc
70 9 1
def call()
in tensorflow_addons/seq2seq/attention_wrapper.py
69 9 4
void operator()
in tensorflow_addons/custom_ops/layers/cc/kernels/embedding_bag_backward_kernels.cu.cc
69 2 0
Status operator()
in tensorflow_addons/custom_ops/layers/cc/kernels/correlation_cost_op_gpu.cu.cc
67 4 0
def _resource_apply_sparse()
in tensorflow_addons/optimizers/yogi.py
67 10 4
Status operator()
in tensorflow_addons/custom_ops/layers/cc/kernels/correlation_cost_op.cc
65 12 0
void operator()
in tensorflow_addons/custom_ops/layers/cc/kernels/embedding_bag_ops.cc
64 7 0
def _resource_apply_dense()
in tensorflow_addons/optimizers/yogi.py
63 10 3
def _resource_apply_sparse()
in tensorflow_addons/optimizers/adabelief.py
63 6 4
def _find_cuda_config()
in build_deps/toolchains/gpu/find_cuda_config.py
62 7 2
__global__ void Correlation_backward_input1()
in tensorflow_addons/custom_ops/layers/cc/kernels/correlation_cost_op_gpu.cu.cc
62 10 16
__global__ void Correlation_backward_input2()
in tensorflow_addons/custom_ops/layers/cc/kernels/correlation_cost_op_gpu.cu.cc
62 10 16
__global__ void ResamplerGrad2DKernel()
in tensorflow_addons/custom_ops/image/cc/kernels/resampler_ops_gpu.cu.cc
62 19 10
void operator()
in tensorflow_addons/custom_ops/image/cc/kernels/resampler_ops.cc
59 13 0
def _resource_apply_dense()
in tensorflow_addons/optimizers/adabelief.py
59 6 3
def _prepare_local()
in tensorflow_addons/optimizers/rectified_adam.py
56 2 4