tensorflow / lattice
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 331 units with 8,007 lines of code in units (94.1% of code).
    • 6 very long units (845 lines of code)
    • 33 long units (2,169 lines of code)
    • 107 medium size units (3,329 lines of code)
    • 59 small units (910 lines of code)
    • 126 very small units (754 lines of code)
10% | 27% | 41% | 11% | 9%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 27% | 41% | 11% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_lattice/python10% | 27% | 41% | 11% | 9%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def verify_hyperparameters()
in tensorflow_lattice/python/lattice_lib.py
183 76 17
def assert_constraints()
in tensorflow_lattice/python/lattice_lib.py
169 28 12
def project_by_dykstra()
in tensorflow_lattice/python/lattice_lib.py
147 22 11
def verify_hyperparameters()
in tensorflow_lattice/python/linear_lib.py
137 64 9
def __init__()
in tensorflow_lattice/python/pwl_calibration_layer.py
108 21 19
def _get_final_crystal_lattices()
in tensorflow_lattice/python/premade_lib.py
101 20 4
def __init__()
in tensorflow_lattice/python/lattice_layer.py
97 24 20
def project_all_constraints()
in tensorflow_lattice/python/pwl_calibration_lib.py
97 11 9
def build_lattice_layer()
in tensorflow_lattice/python/premade_lib.py
89 15 7
def _get_rtl_structure()
in tensorflow_lattice/python/rtl_layer.py
80 30 2
def call()
in tensorflow_lattice/python/pwl_calibration_layer.py
77 25 2
def _create_rtl_submodel_kronecker_factored_lattice_nodes()
in tensorflow_lattice/python/estimators.py
74 8 6
def get_custom_objects()
in tensorflow_lattice/python/premade.py
74 2 1
def build()
in tensorflow_lattice/python/rtl_layer.py
73 10 2
def __init__()
in tensorflow_lattice/python/estimators.py
71 3 19
def build()
in tensorflow_lattice/python/pwl_calibration_layer.py
71 7 2
def build_multi_unit_calibration_layers()
in tensorflow_lattice/python/premade_lib.py
70 11 6
def __init__()
in tensorflow_lattice/python/pwl_calibration_sonnet_module.py
66 9 16
def _assert_bound_constraints()
in tensorflow_lattice/python/kronecker_factored_lattice_lib.py
66 11 6
def draw_model_graph()
in tensorflow_lattice/python/visualization.py
65 22 4