tensorflow / compression
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 613 units with 6,968 lines of code in units (80.6% of code).
    • 2 very long units (216 lines of code)
    • 17 long units (1,114 lines of code)
    • 82 medium size units (2,518 lines of code)
    • 101 small units (1,467 lines of code)
    • 411 very small units (1,653 lines of code)
3% | 15% | 36% | 21% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 15% | 31% | 21% | 26%
cc0% | 17% | 52% | 18% | 11%
h0% | 0% | 32% | 16% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
models15% | 12% | 24% | 32% | 14%
models/hific0% | 19% | 39% | 14% | 26%
tensorflow_compression/cc/kernels0% | 15% | 53% | 18% | 12%
tensorflow_compression/python/layers0% | 20% | 37% | 5% | 36%
models/toy_sources0% | 22% | 35% | 22% | 18%
tensorflow_compression/python/entropy_models0% | 10% | 33% | 32% | 23%
ROOT0% | 96% | 0% | 0% | 3%
tensorflow_compression/cc/lib0% | 27% | 40% | 13% | 18%
tensorflow_compression/python/ops0% | 0% | 65% | 10% | 23%
tensorflow_compression/python/distributions0% | 0% | 11% | 26% | 62%
tensorflow_compression/python/util0% | 0% | 0% | 64% | 35%
tensorflow_compression/python/datasets0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def parse_args()
in models/ms2020.py
115 5 1
def parse_args()
in models/bmshj2018.py
101 5 1
Status ParseHeader()
in tensorflow_compression/cc/kernels/y4m_dataset_kernels.cc
93 25 5
def parse_args()
in models/bls2017.py
92 5 1
def __init__()
in tensorflow_compression/python/entropy_models/continuous_batched.py
80 29 16
def parse_args()
in models/tfci.py
80 5 1
def call()
in tensorflow_compression/python/layers/signal_conv.py
76 48 2
Status GetNextInternal()
in tensorflow_compression/cc/kernels/y4m_dataset_kernels.cc
71 10 3
def __init__()
in models/hific/model.py
63 15 6
def plot_jacobians()
in models/toy_sources/ntc.py
62 8 6
def _up_convolve_transpose_valid()
in tensorflow_compression/python/layers/signal_conv.py
61 14 4
def main()
in build_pip_pkg.py
58 5 1
void RangeEncoder::Encode()
in tensorflow_compression/cc/lib/range_coder.cc
57 7 4
def plot_quantization()
in models/toy_sources/compression_model.py
55 9 4
def _get_dataset()
in models/hific/model.py
55 9 5
def _up_convolve_transpose_explicit()
in tensorflow_compression/python/layers/signal_conv.py
53 17 4
void RangeEncodeImpl()
in tensorflow_compression/cc/kernels/unbounded_index_range_coding_kernels.cc
53 8 6
def eval_trained_model()
in models/hific/evaluate.py
53 9 6
def build_model()
in models/hific/model.py
52 21 3
def __init__()
in tensorflow_compression/python/entropy_models/universal.py
50 11 13