opensearch-project / observability
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 330 units with 7,626 lines of code in units (24.6% of code).
    • 15 very long units (3,162 lines of code)
    • 16 long units (1,127 lines of code)
    • 48 medium size units (1,417 lines of code)
    • 66 small units (964 lines of code)
    • 185 very small units (956 lines of code)
41% | 14% | 18% | 12% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx54% | 21% | 11% | 5% | 6%
ts49% | 14% | 13% | 15% | 6%
kt0% | 0% | 41% | 23% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dashboards-observability/public/components50% | 23% | 12% | 7% | 6%
dashboards-observability/server/routes78% | 12% | 8% | 0% | 0%
dashboards-observability/server/adaptors53% | 0% | 46% | 0% | 0%
opensearch-observability/src/main0% | 0% | 41% | 23% | 35%
dashboards-observability/server/common0% | 0% | 10% | 52% | 36%
dashboards-observability/public/services0% | 0% | 12% | 77% | 10%
dashboards-observability/server0% | 0% | 65% | 0% | 34%
dashboards-observability/public0% | 0% | 0% | 89% | 10%
dashboards-observability/server/services0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in dashboards-observability/public/components/notebooks/components/notebook.tsx
411 8 0
export function DashboardTable()
in dashboards-observability/public/components/trace_analytics/components/dashboard/dashboard_table.tsx
354 19 1
export function PanelsRouter()
in dashboards-observability/server/routes/custom_panels/panels_router.ts
334 19 1
export function registerNoteRoute()
in dashboards-observability/server/routes/notebooks/noteRouter.ts
238 15 1
export function registerParaRoute()
in dashboards-observability/server/routes/notebooks/paraRouter.ts
235 13 1
export function NoteTable()
in dashboards-observability/public/components/notebooks/components/note_table.tsx
227 7 1
export function SpanDetailPanel()
in dashboards-observability/public/components/trace_analytics/components/traces/span_detail_panel.tsx
203 10 1
export function VisualizationsRouter()
in dashboards-observability/server/routes/custom_panels/visualizations_router.ts
197 11 1
export function Dashboard()
in dashboards-observability/public/components/trace_analytics/components/dashboard/dashboard.tsx
186 20 1
export function SpanDetailFlyout()
in dashboards-observability/public/components/trace_analytics/components/traces/span_detail_flyout.tsx
165 23 1
is reflected in the datetime functions()
in dashboards-observability/public/components/common/helpers/ppl_docs/language_structure/datatypes.ts
151 11 1
export function SavedQueryTable()
in dashboards-observability/public/components/explorer/home_table/saved_query_table.tsx
126 6 4
export function BoxPlt()
in dashboards-observability/public/components/trace_analytics/components/common/plots/box_plt.tsx
118 16 1
export function ServiceMapScale()
in dashboards-observability/public/components/trace_analytics/components/common/plots/service_map_scale.tsx
114 4 1
export function OpenSearchObservabilityPlugin()
in dashboards-observability/server/adaptors/opensearch_observability_plugin.ts
103 1 3
export function SpanDetailTable()
in dashboards-observability/public/components/trace_analytics/components/traces/span_detail_table.tsx
96 11 1
export function registerTraceAnalyticsDslRouter()
in dashboards-observability/server/routes/trace_analytics_dsl_router.ts
86 7 1
last_updated: moment()
in dashboards-observability/public/components/trace_analytics/requests/traces_request_handler.ts
84 2 1
export function registerDslRoute()
in dashboards-observability/server/routes/dsl.ts
80 10 3
export function ObservabilitySideBar()
in dashboards-observability/public/components/common/side_nav.tsx
79 1 1