tensorflow / recommenders
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 88 units with 1,056 lines of code in units (75.1% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 17 medium size units (499 lines of code)
    • 23 small units (351 lines of code)
    • 48 very small units (206 lines of code)
0% | 0% | 47% | 33% | 19%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 47% | 33% | 19%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_recommenders/layers/embedding0% | 0% | 54% | 34% | 10%
tensorflow_recommenders/layers0% | 0% | 31% | 32% | 36%
tensorflow_recommenders/layers/feature_interaction0% | 0% | 65% | 27% | 6%
tensorflow_recommenders/experimental/models0% | 0% | 76% | 15% | 8%
tensorflow_recommenders/tasks0% | 0% | 59% | 36% | 4%
tensorflow_recommenders/experimental/optimizers0% | 0% | 46% | 22% | 31%
tensorflow_recommenders/experimental/layers0% | 0% | 48% | 42% | 8%
tools0% | 0% | 0% | 100% | 0%
tensorflow_recommenders/models0% | 0% | 0% | 50% | 50%
tensorflow_recommenders/metrics0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def call()
in tensorflow_recommenders/tasks/retrieval.py
48 14 8
def compute_loss()
in tensorflow_recommenders/experimental/models/ranking.py
43 4 3
def __init__()
in tensorflow_recommenders/layers/factorized_top_k.py
38 2 11
def __init__()
in tensorflow_recommenders/experimental/models/ranking.py
33 5 6
def call()
in tensorflow_recommenders/layers/factorized_top_k.py
30 9 5
def call()
in tensorflow_recommenders/layers/feature_interaction/dot_interaction.py
30 5 2
def __init__()
in tensorflow_recommenders/layers/feature_interaction/dcn.py
28 2 15
def index()
in tensorflow_recommenders/layers/factorized_top_k.py
27 5 3
def build()
in tensorflow_recommenders/layers/feature_interaction/dcn.py
27 2 2
def _get_batch_size_from_input_shapes()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
26 8 1
def call()
in tensorflow_recommenders/tasks/ranking.py
26 8 6
def _normalize_and_prepare_optimizer()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
25 8 1
def _clone_and_prepare_features()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
25 5 1
def apply_gradients()
in tensorflow_recommenders/experimental/optimizers/composite_optimizer.py
25 7 5
def call()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
23 8 4
def translate_keras_optimizer()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
23 9 1
def __init__()
in tensorflow_recommenders/experimental/layers/embedding/partial_tpu_embedding.py
22 6 6
def _hide_layer_and_module_methods()
in tools/build_api_docs.py
19 8 0
def build()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
19 7 2
def get_config()
in tensorflow_recommenders/layers/feature_interaction/dcn.py
19 1 1