opensearch-project / OpenSearch-Dashboards
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 8,337 units with 116,270 lines of code in units (39.1% of code).
    • 68 very long units (10,936 lines of code)
    • 289 long units (19,461 lines of code)
    • 1,155 medium size units (36,599 lines of code)
    • 1,572 small units (23,039 lines of code)
    • 5,253 very small units (26,235 lines of code)
9% | 16% | 31% | 19% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx20% | 29% | 25% | 12% | 12%
ts6% | 13% | 33% | 21% | 25%
js8% | 14% | 30% | 21% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/plugins10% | 17% | 32% | 17% | 21%
src/core11% | 12% | 30% | 22% | 22%
packages/osd-ace20% | 15% | 15% | 22% | 24%
packages/osd-test8% | 8% | 30% | 24% | 28%
src/legacy12% | 13% | 16% | 27% | 28%
packages/osd-expect23% | 0% | 34% | 22% | 19%
packages/osd-telemetry-tools13% | 22% | 23% | 22% | 19%
packages/osd-pm8% | 14% | 23% | 25% | 27%
packages/osd-interpreter8% | 41% | 13% | 16% | 19%
src/dev0% | 19% | 25% | 23% | 31%
packages/osd-optimizer0% | 28% | 40% | 16% | 14%
packages/osd-ui-framework0% | 17% | 33% | 25% | 23%
packages/osd-dev-utils0% | 17% | 29% | 24% | 28%
packages/osd-opensearch-archiver0% | 20% | 31% | 19% | 29%
src/cli0% | 28% | 30% | 18% | 22%
packages/osd-opensearch0% | 16% | 30% | 27% | 26%
src/fixtures0% | 32% | 21% | 21% | 24%
packages/osd-plugin-generator0% | 77% | 0% | 0% | 22%
packages/osd-release-notes0% | 20% | 28% | 23% | 27%
packages/opensearch-datemath0% | 66% | 33% | 0% | 0%
src/optimize0% | 20% | 37% | 31% | 11%
tasks0% | 18% | 69% | 4% | 7%
packages/osd-config-schema0% | 0% | 26% | 32% | 40%
packages/osd-plugin-helpers0% | 0% | 61% | 20% | 17%
packages/osd-i18n0% | 0% | 38% | 26% | 35%
packages/osd-eslint-plugin-eslint0% | 0% | 52% | 17% | 30%
src/cli_plugin0% | 0% | 20% | 58% | 21%
utilities0% | 0% | 75% | 19% | 5%
src/cli_keystore0% | 0% | 41% | 29% | 29%
packages/osd-monaco0% | 0% | 29% | 36% | 34%
packages/osd-config0% | 0% | 17% | 35% | 46%
packages/osd-analytics0% | 0% | 30% | 18% | 51%
packages/opensearch-safer-lodash-set0% | 0% | 80% | 0% | 19%
packages/osd-std0% | 0% | 14% | 50% | 35%
packages/osd-logging0% | 0% | 84% | 0% | 15%
tasks/config0% | 0% | 10% | 40% | 49%
packages/osd-eslint-import-resolver-opensearch-dashboards0% | 0% | 16% | 58% | 24%
packages/osd-apm-config-loader0% | 0% | 17% | 35% | 47%
src/setup_node_env0% | 0% | 0% | 25% | 74%
src0% | 0% | 0% | 100% | 0%
packages/osd-storybook0% | 0% | 0% | 71% | 28%
ROOT0% | 0% | 0% | 100% | 0%
packages/osd-ui-shared-deps0% | 0% | 0% | 0% | 100%
packages/osd-utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function getUiSettings()
in src/plugins/data/server/ui_settings.ts
628 2 0
public start()
in src/core/public/doc_links/doc_links_service.ts
358 2 1
export function useForm()
in src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts
354 38 1
render()
in src/plugins/vis_type_timeseries/public/application/components/panel_config/timeseries.js
339 10 0
function TimelineVisComponent()
in src/plugins/vis_type_timeline/public/components/timeline_vis_component.tsx
308 40 5
render()
in src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
266 11 0
export function CollapsibleNav()
in src/core/public/chrome/ui/header/collapsible_nav.tsx
251 12 12
render()
in src/plugins/vis_type_timeseries/public/application/components/panel_config/gauge.js
247 6 0
function MetricsAxisOptions()
in src/plugins/vis_type_vislib/public/components/options/metrics_axes/index.tsx
228 24 1
export function DiscoverLegacy()
in src/plugins/discover/public/application/components/discover_legacy.tsx
216 26 29
export function getCurrentMethodAndTokenPaths()
in src/plugins/console/public/lib/autocomplete/autocomplete.ts
211 78 4
renderRelationships()
in src/plugins/saved_objects_management/public/management_section/objects_table/components/relationships.tsx
202 11 0
renderRow()
in src/plugins/vis_type_timeseries/public/application/components/annotations_editor.js
199 3 1
export function DevToolsSettingsModal()
in src/plugins/console/public/application/components/settings_modal.tsx
198 8 1
export function Tabs()
in src/plugins/index_pattern_management/public/components/edit_index_pattern/tabs/tabs.tsx
194 10 5
render()
in src/plugins/vis_type_timeseries/public/application/components/panel_config/table.js
190 5 0
export default()
in src/legacy/server/config/schema.js
189 1 0
addPath()
in src/plugins/vis_type_vislib/public/vislib/visualizations/pie_chart.js
187 35 4
export function DiscoverFieldSearch()
in src/plugins/discover/public/application/components/sidebar/discover_field_search.tsx
182 9 3
function DefaultEditorAggParams()
in src/plugins/vis_default_editor/public/components/agg_params.tsx
175 24 19