tensorflow / tensorboard
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 4,442 units with 59,911 lines of code in units (48.6% of code).
    • 52 very long units (8,950 lines of code)
    • 124 long units (8,504 lines of code)
    • 533 medium size units (16,212 lines of code)
    • 804 small units (11,711 lines of code)
    • 2,929 very small units (14,534 lines of code)
14% | 14% | 27% | 19% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts20% | 15% | 25% | 18% | 20%
py2% | 9% | 30% | 23% | 34%
rs11% | 16% | 32% | 17% | 21%
java0% | 0% | 50% | 25% | 23%
js0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tensorboard/plugins20% | 15% | 25% | 18% | 19%
tensorboard/components16% | 17% | 22% | 17% | 26%
tensorboard/webapp6% | 13% | 30% | 22% | 26%
tensorboard/data8% | 16% | 26% | 19% | 29%
tensorboard/util35% | 0% | 14% | 13% | 36%
tensorboard/uploader8% | 12% | 28% | 22% | 27%
tensorboard/backend0% | 12% | 28% | 23% | 35%
tensorboard0% | 11% | 38% | 20% | 30%
tensorboard/tools0% | 13% | 54% | 15% | 16%
tensorboard/compat0% | 3% | 19% | 21% | 55%
tensorboard/java0% | 0% | 50% | 25% | 23%
tensorboard/scripts0% | 0% | 61% | 33% | 4%
tensorboard/summary0% | 0% | 25% | 12% | 62%
tensorboard/pip_package0% | 0% | 67% | 0% | 32%
tensorboard/defs0% | 0% | 0% | 87% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
class TfGraphControls extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_controls/tf-graph-controls.ts
1092 32 1
extends LegacyElementMixin()
in tensorboard/plugins/custom_scalar/tf_custom_scalar_dashboard/tf-custom-scalar-margin-chart-card.ts
329 4 1
class TfNodeInfo extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_info/tf-node-info.ts
329 1 1
_draw()
in tensorboard/plugins/hparams/tf_hparams_scatter_plot_matrix_plot/tf-hparams-scatter-plot-matrix-plot.ts
285 22 0
class TfGraphDashboard extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_dashboard/tf-graph-dashboard.ts
232 1 1
class TfScalarDashboard extends LegacyElementMixin()
in tensorboard/plugins/scalar/tf_scalar_dashboard/tf-scalar-dashboard.ts
227 1 1
class TfGraphIcon extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_common/tf-graph-icon.ts
221 1 1
class TfGraphBoard extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_board/tf-graph-board.ts
217 1 1
ngOnInit()
in tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts
207 15 0
class TfImageLoader extends LegacyElementMixin()
in tensorboard/plugins/image/tf_image_dashboard/tf-image-loader.ts
204 2 1
extends LegacyElementMixin()
in tensorboard/plugins/custom_scalar/tf_custom_scalar_dashboard/tf-custom-scalar-multi-line-chart-card.ts
197 1 1
class TfGraphDebuggerDataCard extends LegacyElementMixin()
in tensorboard/plugins/graph/tf_graph_debugger_data_card/tf-graph-debugger-data-card.ts
197 4 1
export function build()
in tensorboard/plugins/graph/tf_graph_common/graph.ts
195 23 3
ngAfterViewInit()
in tensorboard/webapp/widgets/line_chart_v2/sub_view/line_chart_interactive_view.ts
190 20 0
class TfImageDashboard extends LegacyElementMixin()
in tensorboard/plugins/image/tf_image_dashboard/tf-image-dashboard.ts
185 1 1
export function addHealthPill()
in tensorboard/plugins/graph/tf_graph_common/scene.ts
172 34 8
class TfMultiCheckbox extends LegacyElementMixin()
in tensorboard/components/tf_dashboard_common/tf-multi-checkbox.ts
171 1 1
fn test()
in tensorboard/data/server/run.rs
167 2 0
class TfFilterableCheckboxList extends LegacyElementMixin()
in tensorboard/components/tf_dashboard_common/tf-filterable-checkbox-list.ts
166 1 1
def define_flags()
in tensorboard/uploader/flags_parser.py
162 1 1