tensorflow / adanet
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 508 units with 6,757 lines of code in units (85.2% of code).
    • 4 very long units (719 lines of code)
    • 17 long units (1,171 lines of code)
    • 78 medium size units (2,295 lines of code)
    • 71 small units (1,036 lines of code)
    • 338 very small units (1,536 lines of code)
10% | 17% | 33% | 15% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py10% | 17% | 33% | 15% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
adanet/core17% | 20% | 28% | 15% | 18%
adanet/autoensemble0% | 42% | 28% | 12% | 16%
research/improve_nas0% | 6% | 64% | 15% | 14%
adanet/ensemble0% | 17% | 35% | 20% | 26%
adanet/subnetwork0% | 41% | 22% | 11% | 24%
adanet/experimental0% | 0% | 7% | 3% | 88%
adanet/distributed0% | 0% | 0% | 40% | 59%
adanet/tf_compat0% | 0% | 0% | 32% | 67%
adanet/replay0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def build_iteration()
in adanet/core/iteration.py
237 41 14
def build_ensemble_spec()
in adanet/core/ensemble_builder.py
218 44 13
def train_and_evaluate_estimator()
in adanet/core/estimator_distributed_test_runner.py
141 15 0
def __init__()
in adanet/core/estimator.py
123 18 28
def train()
in adanet/core/estimator.py
92 39 6
def build_subnetwork_spec()
in adanet/core/ensemble_builder.py
91 13 9
def __init__()
in adanet/core/tpu_estimator.py
85 11 32
def _create_iteration()
in adanet/core/estimator.py
83 13 9
def _build_nasnet_base()
in research/improve_nas/trainer/nasnet.py
81 25 9
def monkey_patched_summaries()
in adanet/core/summary.py
80 4 1
def build_ensemble()
in adanet/ensemble/weighted.py
78 14 11
def _get_best_ensemble_index()
in adanet/core/estimator.py
76 17 4
def _architecture_ensemble_spec()
in adanet/core/estimator.py
67 11 10
def best_eval_metrics_tuple()
in adanet/core/eval_metrics.py
58 13 3
def materialize_subnetwork_reports()
in adanet/core/report_materializer.py
58 20 5
def dummy_ensemble_spec()
in adanet/core/testing_utils.py
57 4 12
def __init__()
in adanet/autoensemble/estimator.py
56 1 28
def __new__()
in adanet/subnetwork/report.py
55 14 4
def _monkey_patch_context()
in adanet/core/ensemble_builder.py
52 3 3
def build_subnetwork()
in adanet/autoensemble/common.py
51 2 9