tensorflow / probability
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 8,263 units with 86,634 lines of code in units (38.9% of code).
    • 30 very long units (3,944 lines of code)
    • 190 long units (12,490 lines of code)
    • 864 medium size units (26,865 lines of code)
    • 1,278 small units (18,725 lines of code)
    • 5,901 very small units (24,610 lines of code)
4% | 14% | 31% | 21% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py4% | 14% | 31% | 21% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_probability/python4% | 14% | 31% | 21% | 27%
discussion/turnkey_inference_candidate66% | 33% | 0% | 0% | 0%
tensorflow_probability/substrates94% | 0% | 0% | 0% | 5%
spinoffs/inference_gym4% | 16% | 29% | 17% | 30%
spinoffs/oryx0% | 7% | 25% | 24% | 42%
discussion/neutra0% | 32% | 35% | 0% | 31%
spinoffs/fun_mc0% | 3% | 30% | 24% | 40%
discussion/pathfinder0% | 0% | 60% | 9% | 30%
tensorflow_probability/tools0% | 0% | 0% | 65% | 35%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def sample_sequential_monte_carlo()
in tensorflow_probability/python/experimental/mcmc/sample_sequential_monte_carlo.py
228 11 14
def _sample_posterior()
in discussion/turnkey_inference_candidate/window_tune_nuts_sampling.py
195 12 16
def bijector_supports()
in tensorflow_probability/python/bijectors/hypothesis_testlib.py
162 3 0
def build()
in tensorflow_probability/python/distributions/pixel_cnn.py
152 34 2
def make_convolution_transpose_fn_with_subkernels_matrix()
in tensorflow_probability/python/experimental/nn/util/convolution_util.py
152 10 8
def _loop_tree_doubling()
in tensorflow_probability/python/experimental/mcmc/preconditioned_nuts.py
150 16 10
def _loop_tree_doubling()
in tensorflow_probability/python/mcmc/nuts.py
148 16 8
def vjp_bwd()
in tensorflow_probability/python/math/ode/base.py
142 12 3
def main()
in tensorflow_probability/substrates/meta/rewrite.py
141 31 1
def one_step()
in tensorflow_probability/python/mcmc/replica_exchange_mc.py
139 26 4
def _loop_build_sub_tree()
in tensorflow_probability/python/experimental/mcmc/preconditioned_nuts.py
138 9 15
def _make_evolve_trajectory()
in tensorflow_probability/python/experimental/mcmc/nuts_autobatching.py
135 20 4
def gen_module()
in tensorflow_probability/python/internal/backend/meta/gen_linear_operators.py
134 7 1
def _loop_build_sub_tree()
in tensorflow_probability/python/mcmc/nuts.py
133 9 14
def make_convolution_transpose_fn_with_subkernels()
in tensorflow_probability/python/experimental/nn/util/convolution_util.py
130 7 8
def maybe_step()
in tensorflow_probability/python/math/ode/bdf.py
130 8 4
def _build_sampler_loop_body()
in tensorflow_probability/python/experimental/sts_gibbs/gibbs_sampler.py
124 20 3
def radon()
in spinoffs/inference_gym/inference_gym/internal/data.py
119 9 7
def _interp_regular_1d_grid_impl()
in tensorflow_probability/python/math/interpolation.py
118 15 11
def one_step()
in tensorflow_probability/python/experimental/mcmc/elliptical_slice_sampler.py
115 6 4