tensorflow / decision-forests
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 519 units with 7,698 lines of code in units (76.5% of code).
    • 9 very long units (1,492 lines of code)
    • 21 long units (1,462 lines of code)
    • 64 medium size units (2,000 lines of code)
    • 97 small units (1,425 lines of code)
    • 328 very small units (1,319 lines of code)
19% | 18% | 25% | 18% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py18% | 16% | 24% | 20% | 20%
cc24% | 21% | 26% | 17% | 10%
js0% | 44% | 41% | 0% | 14%
h0% | 0% | 39% | 14% | 45%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorflow_decision_forests/keras43% | 22% | 14% | 11% | 8%
tensorflow_decision_forests/tensorflow/ops16% | 24% | 27% | 17% | 14%
tensorflow_decision_forests/keras/wrapper79% | 0% | 9% | 5% | 5%
tensorflow_decision_forests/tensorflow0% | 39% | 38% | 13% | 8%
tensorflow_decision_forests/component/model_plotter0% | 30% | 37% | 19% | 12%
tensorflow_decision_forests/tensorflow/distribute0% | 9% | 35% | 37% | 17%
tensorflow_decision_forests/component/builder0% | 0% | 47% | 31% | 20%
tensorflow_decision_forests/component/inspector0% | 0% | 28% | 22% | 48%
tensorflow_decision_forests/component/py_tree0% | 0% | 16% | 24% | 58%
tools0% | 0% | 0% | 100% | 0%
configure0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
ydf::utils::StatusOr GenKerasPythonWrapper()
in tensorflow_decision_forests/keras/wrapper/wrapper.cc
312 40 0
def __init__()
in tensorflow_decision_forests/keras/wrappers_pre_generated.py
193 2 68
def collect_data_step()
in tensorflow_decision_forests/keras/core.py
175 52 3
tf::Status FeatureSet::InitializeDatasetFromFeatures()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
159 11 3
def __init__()
in tensorflow_decision_forests/keras/wrappers_pre_generated.py
149 2 53
tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
146 15 2
def __init__()
in tensorflow_decision_forests/keras/wrappers_pre_generated.py
123 2 45
def fit_on_dataset_path()
in tensorflow_decision_forests/keras/core.py
121 20 10
void Compute()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
114 12 1
tf::Status SetVerticalDataset()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
99 19 3
def __init__()
in tensorflow_decision_forests/keras/core.py
92 23 18
def __init__()
in tensorflow_decision_forests/keras/wrappers_pre_generated.py
85 2 32
def _train_model()
in tensorflow_decision_forests/keras/core.py
84 17 1
explicit SimpleMLModelTrainer()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
83 10 1
tf::Status SetExamples()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
81 16 3
tf::Status RunInference()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
80 15 4
tf::Status FeatureSet::Link()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
80 18 6
def pd_dataframe_to_tf_dataset()
in tensorflow_decision_forests/keras/core.py
79 10 8
def normalize_inputs()
in tensorflow_decision_forests/tensorflow/core.py
72 15 2
def train_on_file_dataset()
in tensorflow_decision_forests/tensorflow/core.py
72 17 19