opensearch-project / dashboards-reports
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 316 units with 5,085 lines of code in units (34.4% of code).
    • 8 very long units (2,124 lines of code)
    • 4 long units (243 lines of code)
    • 28 medium size units (848 lines of code)
    • 66 small units (980 lines of code)
    • 210 very small units (890 lines of code)
41% | 4% | 16% | 19% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx87% | 4% | 3% | 3% | 1%
ts48% | 7% | 17% | 15% | 10%
kt0% | 3% | 26% | 37% | 32%
js0% | 0% | 40% | 16% | 42%
java0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dashboards-reports/public/components78% | 3% | 7% | 5% | 5%
dashboards-reports/server/routes51% | 9% | 13% | 17% | 7%
dashboards-reports/server/backend100% | 0% | 0% | 0% | 0%
reports-scheduler/src/main0% | 3% | 25% | 36% | 35%
dashboards-reports/server0% | 0% | 73% | 0% | 26%
dashboards-reports/server/clusters0% | 0% | 100% | 0% | 0%
dashboards-reports/server/config0% | 0% | 74% | 0% | 25%
dashboards-reports/public0% | 0% | 0% | 52% | 47%
dashboards-reports/server/model0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function ReportSettings()
in dashboards-reports/public/components/report_definitions/report_settings/report_settings.tsx
780 57 1
export function ReportDelivery()
in dashboards-reports/public/components/report_definitions/delivery/delivery.tsx
279 15 1
export default function()
in dashboards-reports/server/routes/report.ts
269 9 2
export default function()
in dashboards-reports/server/routes/reportDefinition.ts
236 11 2
export function TimeRangeSelect()
in dashboards-reports/public/components/report_definitions/report_settings/time_range.tsx
194 16 1
export function ReportDefinitions()
in dashboards-reports/public/components/main/report_definitions_table.tsx
126 4 1
export default function()
in dashboards-reports/server/backend/opensearch-reports-plugin.ts
122 1 3
export default function()
in dashboards-reports/server/routes/notifications.ts
118 10 1
export function GenerateReportLoadingModal()
in dashboards-reports/public/components/main/loading_modal/loading_modal.tsx
65 1 1
report_definition: backendToUiReportDefinition()
in dashboards-reports/server/routes/utils/converters/backendToUi.ts
60 8 2
override fun doExecute()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/PluginBaseAction.kt
59 10 3
export default function()
in dashboards-reports/server/routes/reportSource.ts
59 6 1
async function populateMetaData()
in dashboards-reports/server/routes/utils/savedSearchReportHelper.ts
48 5 4
public async setup()
in dashboards-reports/server/plugin.ts
46 3 1
override fun executeRequest()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/resthandler/ReportDefinitionRestHandler.kt
36 1 2
fun parse()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/model/ReportDefinition.kt
35 2 1
function locationHashChanged()
in dashboards-reports/public/components/context_menu/context_menu.js
35 8 0
export function NotificationsPlugin()
in dashboards-reports/server/clusters/notificationsPlugin.ts
35 1 3
fun createOnDemandFromDefinition()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/ReportInstanceActions.kt
34 2 2
async function getTenantInfoIfExists()
in dashboards-reports/public/components/context_menu/context_menu.js
34 4 0