tensorflow / tfx
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 2,079 units with 21,217 lines of code in units (52.6% of code).
    • 6 very long units (843 lines of code)
    • 40 long units (2,644 lines of code)
    • 214 medium size units (6,475 lines of code)
    • 329 small units (4,749 lines of code)
    • 1,490 very small units (6,506 lines of code)
3% | 12% | 30% | 22% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 12% | 30% | 22% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tfx/components11% | 14% | 32% | 19% | 21%
tfx/orchestration4% | 12% | 29% | 25% | 28%
tfx/extensions0% | 31% | 35% | 15% | 16%
tfx/benchmarks0% | 23% | 40% | 18% | 18%
tfx/dsl0% | 9% | 15% | 21% | 53%
tfx/scripts0% | 50% | 47% | 0% | 1%
tfx/types0% | 6% | 25% | 25% | 42%
tfx/utils0% | 6% | 32% | 16% | 44%
tfx/experimental0% | 0% | 42% | 33% | 23%
tfx/tools0% | 0% | 35% | 18% | 45%
tfx0% | 0% | 29% | 24% | 46%
ROOT0% | 0% | 0% | 26% | 73%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _RunBeamImpl()
in tfx/components/transform/executor.py
256 10 22
def Do()
in tfx/components/transform/executor.py
130 9 7
def Transform()
in tfx/components/transform/executor.py
122 19 6
def _prepare_execution()
in tfx/orchestration/portable/launcher.py
119 5 1
def build()
in tfx/orchestration/kubeflow/v2/step_builder.py
115 28 1
def _orchestrate_active_pipeline()
in tfx/orchestration/experimental/core/pipeline_ops.py
101 28 4
def Do()
in tfx/extensions/google_cloud_ai_platform/bulk_inferrer/executor.py
97 16 7
def _generate_tasks_for_node()
in tfx/orchestration/experimental/core/async_pipeline_task_gen.py
95 17 3
def debug_str()
in tfx/dsl/compiler/placeholder_utils.py
92 27 1
def _runMetricsPlotsAndValidationsEvaluatorManualActuation()
in tfx/benchmarks/tfma_v2_benchmark_base.py
87 17 5
def run_component()
in tfx/scripts/run_component.py
84 28 4
def Do()
in tfx/extensions/google_cloud_ai_platform/pusher/executor.py
80 11 7
def run_as_kubernetes_job()
in tfx/orchestration/experimental/kubernetes/kubernetes_remote_runner.py
78 13 2
def get_common_fn_args()
in tfx/components/trainer/fn_args_utils.py
77 15 5
def _generate_tasks_for_node()
in tfx/orchestration/experimental/core/sync_pipeline_task_gen.py
77 13 2
def Do()
in tfx/extensions/google_cloud_ai_platform/tuner/executor.py
75 19 7
def placeholder_to_cel()
in tfx/orchestration/kubeflow/v2/compiler_utils.py
72 9 1
def _run_executor()
in tfx/orchestration/launcher/kubernetes_component_launcher.py
72 10 8
def __init__()
in tfx/components/transform/component.py
71 9 16
def _dump_ui_metadata()
in tfx/orchestration/kubeflow/container_entrypoint.py
70 18 3