tensorflow / ranking
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 473 units with 5,751 lines of code in units (85.2% of code).
    • 2 very long units (206 lines of code)
    • 5 long units (341 lines of code)
    • 67 medium size units (2,001 lines of code)
    • 123 small units (1,750 lines of code)
    • 276 very small units (1,453 lines of code)
3% | 5% | 34% | 30% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 5% | 34% | 30% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_ranking/python6% | 8% | 31% | 33% | 20%
tensorflow_ranking/python/keras0% | 4% | 27% | 27% | 40%
tensorflow_ranking/python/keras/canned0% | 0% | 81% | 13% | 5%
tensorflow_ranking/extension0% | 0% | 44% | 36% | 18%
tensorflow_ranking/extension/premade0% | 0% | 56% | 21% | 22%
tensorflow_ranking/research0% | 0% | 66% | 29% | 3%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def make_ranking_metric_fn()
in tensorflow_ranking/python/metrics.py
105 2 7
def parse()
in tensorflow_ranking/python/data.py
101 30 2
def make_loss_fn()
in tensorflow_ranking/python/losses.py
91 14 8
def model_to_estimator()
in tensorflow_ranking/python/keras/estimator.py
76 15 7
def _make_gam_score_fn()
in tensorflow_ranking/python/estimator.py
71 14 6
def make_loss_metric_fn()
in tensorflow_ranking/python/losses.py
52 3 4
def encode_listwise_features()
in tensorflow_ranking/python/feature.py
51 10 6
def __init__()
in tensorflow_ranking/python/keras/layers.py
50 6 13
def __init__()
in tensorflow_ranking/python/keras/canned/gam.py
49 8 11
def _compute_logits_impl()
in tensorflow_ranking/python/model.py
48 12 7
def sample()
in tensorflow_ranking/python/losses_impl.py
48 9 4
def create_estimator_spec()
in tensorflow_ranking/python/head.py
47 6 6
def pair_weights()
in tensorflow_ranking/python/losses_impl.py
45 7 3
def score()
in tensorflow_ranking/python/keras/canned/gam.py
45 13 4
def parse()
in tensorflow_ranking/python/data.py
41 12 2
def build_ranking_dataset_with_parsing_fn()
in tensorflow_ranking/python/data.py
41 14 14
def train_and_validate()
in tensorflow_ranking/python/keras/pipeline.py
39 6 2
def make_gam_ranking_estimator()
in tensorflow_ranking/python/estimator.py
38 1 16
def create_estimator_spec()
in tensorflow_ranking/python/head.py
37 7 6
def call()
in tensorflow_ranking/python/keras/feature.py
37 8 3