tensorflow / hub
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 334 units with 3,119 lines of code in units (80.0% of code).
    • 0 very long units (0 lines of code)
    • 6 long units (323 lines of code)
    • 29 medium size units (876 lines of code)
    • 56 small units (833 lines of code)
    • 243 very small units (1,087 lines of code)
0% | 10% | 28% | 26% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 10% | 28% | 26% | 34%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_hub0% | 6% | 22% | 29% | 40%
tensorflow_hub/tools/make_image_classifier0% | 18% | 48% | 17% | 15%
tensorflow_hub/tools/module_search0% | 27% | 56% | 0% | 16%
tensorflow_hub/tools/make_nearest_neighbour_index0% | 21% | 40% | 23% | 14%
build_docs0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def atomic_download()
in tensorflow_hub/resolver.py
58 24 4
def create_apply_graph()
in tensorflow_hub/native_module.py
57 17 4
def _get_data_as_datasets()
in tensorflow_hub/tools/make_image_classifier/make_image_classifier_lib.py
53 8 3
def knn_errorrate()
in tensorflow_hub/tools/module_search/utils.py
52 24 4
def run()
in tensorflow_hub/tools/make_nearest_neighbour_index/index_builder.py
52 7 1
def _make_assets_key_collection()
in tensorflow_hub/saved_model_lib.py
51 14 2
def validate_args()
in tensorflow_hub/tools/make_nearest_neighbour_index/make_nearest_neighbour_index.py
43 18 1
def main()
in tensorflow_hub/tools/module_search/search.py
42 11 1
def _apply_colocation_attr_map()
in tensorflow_hub/native_module.py
42 14 2
def eval_function_for_module()
in tensorflow_hub/module.py
41 11 2
def __init__()
in tensorflow_hub/keras_layer.py
38 14 12
def main()
in tensorflow_hub/tools/make_image_classifier/make_image_classifier.py
37 17 1
def _create_state_graph()
in tensorflow_hub/native_module.py
37 4 2
def compute_distance_matrix()
in tensorflow_hub/tools/module_search/utils.py
36 9 3
def get_config()
in tensorflow_hub/keras_layer.py
33 13 1
def recover_partitioned_variable_map()
in tensorflow_hub/native_module.py
33 16 1
def call()
in tensorflow_hub/keras_layer.py
31 11 3
def make_image_classifier()
in tensorflow_hub/tools/make_image_classifier/make_image_classifier_lib.py
31 2 7
def main()
in tensorflow_hub/tools/make_nearest_neighbour_index/make_nearest_neighbour_index.py
31 7 1
def compute_distance_matrix_loo()
in tensorflow_hub/tools/module_search/utils.py
30 8 2