tensorflow / cloud
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 175 units with 2,419 lines of code in units (58.6% of code).
    • 1 very long units (202 lines of code)
    • 5 long units (358 lines of code)
    • 26 medium size units (799 lines of code)
    • 39 small units (571 lines of code)
    • 104 very small units (489 lines of code)
8% | 14% | 33% | 23% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py9% | 16% | 33% | 20% | 20%
cc0% | 0% | 28% | 49% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/python/tensorflow_cloud/core25% | 7% | 28% | 20% | 19%
src/python/tensorflow_cloud/tuner0% | 29% | 41% | 13% | 16%
src/cpp/monitoring0% | 0% | 28% | 49% | 22%
src/python/tensorflow_cloud/core/experimental0% | 0% | 29% | 32% | 37%
src/python/tensorflow_cloud/utils0% | 0% | 17% | 61% | 21%
src/python0% | 0% | 0% | 60% | 40%
api_docs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _get_valid_machine_configurations()
in src/python/tensorflow_cloud/core/gcp.py
202 1 0
def run_trial()
in src/python/tensorflow_cloud/tuner/tuner.py
99 19 4
def convert_study_config_to_hps()
in src/python/tensorflow_cloud/tuner/utils.py
89 22 2
def validate_job_labels()
in src/python/tensorflow_cloud/core/gcp.py
58 12 1
def _is_parameter_valid()
in src/python/tensorflow_cloud/tuner/utils.py
56 17 2
def _convert_hyperparams_to_vizier_params()
in src/python/tensorflow_cloud/tuner/utils.py
56 15 1
def __init__()
in src/python/tensorflow_cloud/tuner/tuner.py
46 7 18
def update_trial()
in src/python/tensorflow_cloud/tuner/tuner.py
44 12 6
def _create_docker_file()
in src/python/tensorflow_cloud/core/containerize.py
43 9 1
def _serialize_assets()
in src/python/tensorflow_cloud/tuner/cloud_fit_client.py
43 12 3
def convert_hyperparams_to_hparams()
in src/python/tensorflow_cloud/tuner/utils.py
40 12 1
def get_tpu_cluster_resolver_fn()
in src/python/tensorflow_cloud/core/preprocess.py
39 1 0
def create_trial()
in src/python/tensorflow_cloud/tuner/tuner.py
38 11 2
def run_cloudtuner()
in src/python/tensorflow_cloud/core/run.py
36 9 2
def end_trial()
in src/python/tensorflow_cloud/tuner/tuner.py
35 7 3
def _get_docker_base_image()
in src/python/tensorflow_cloud/core/containerize.py
34 14 1
def classifier_trainer()
in src/python/tensorflow_cloud/core/experimental/models.py
33 2 8
def _obtain_long_running_operation()
in src/python/tensorflow_cloud/tuner/vizier_client.py
32 4 2
def format_objective()
in src/python/tensorflow_cloud/tuner/utils.py
27 8 5
def should_trial_stop()
in src/python/tensorflow_cloud/tuner/vizier_client.py
26 4 2