opensearch-project / dashboards-notebooks
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 185 units with 2,691 lines of code in units (31.1% of code).
    • 4 very long units (874 lines of code)
    • 1 long units (63 lines of code)
    • 20 medium size units (614 lines of code)
    • 41 small units (590 lines of code)
    • 119 very small units (550 lines of code)
32% | 2% | 22% | 21% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
tsx72% | 0% | 12% | 7% | 6%
ts44% | 7% | 14% | 20% | 13%
kt0% | 0% | 36% | 31% | 31%
js0% | 0% | 100% | 0% | 0%
java0% | 0% | 0% | 39% | 60%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
dashboards-notebooks/public/components72% | 0% | 12% | 7% | 6%
dashboards-notebooks/server/routes82% | 0% | 15% | 0% | 1%
dashboards-notebooks/server/adaptors0% | 54% | 27% | 17% | 0%
opensearch-notebooks/src/main0% | 0% | 36% | 31% | 31%
dashboards-notebooks/server/clusters0% | 0% | 100% | 0% | 0%
dashboards-notebooks/server/helpers0% | 0% | 10% | 52% | 36%
dashboards-notebooks/poc/zeppelin0% | 0% | 0% | 39% | 60%
dashboards-notebooks/server0% | 0% | 0% | 62% | 37%
dashboards-notebooks/public0% | 0% | 0% | 52% | 48%
dashboards-notebooks/server/services0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
render()
in dashboards-notebooks/public/components/notebook.tsx
372 8 0
export function ParaRouter()
in dashboards-notebooks/server/routes/paraRouter.ts
195 13 1
export function NoteRouter()
in dashboards-notebooks/server/routes/noteRouter.ts
190 15 1
export function NoteTable()
in dashboards-notebooks/public/components/note_table.tsx
117 3 1
export function OpenSearchNotebooksPlugin()
in dashboards-notebooks/server/adaptors/opensearch_notebooks_plugin.ts
63 1 3
override fun doExecute()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/action/PluginBaseAction.kt
41 10 3
fun addSettingsUpdateConsumer()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/settings/PluginSettings.kt
40 1 1
fun parse()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/model/Notebook.kt
39 2 1
export function sqlRouter()
in dashboards-notebooks/server/routes/sqlRouter.ts
38 1 2
async function getTenantInfoIfExists()
in dashboards-notebooks/public/components/helpers/reporting_context_menu_helper.tsx
34 4 0
export function vizRouter()
in dashboards-notebooks/server/routes/vizRouter.ts
34 3 1
export default function sqlPlugin()
in dashboards-notebooks/server/clusters/sql/sqlPlugin.js
33 1 3
createParagraph = function()
in dashboards-notebooks/server/adaptors/default_backend.ts
32 5 2
fun parse()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/model/Notebook.kt
31 2 1
checkIfReportingPluginIsInstalled()
in dashboards-notebooks/public/components/notebook.tsx
31 3 0
fun validateUser()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/security/UserAccessManager.kt
30 7 1
fun parse()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/model/Notebook.kt
30 2 1
override fun prepareRequest()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/resthandler/NotebookRestHandler.kt
28 1 2
fun delete()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/action/NotebookActions.kt
28 3 2
fun getAllNotebooks()
in opensearch-notebooks/src/main/kotlin/org/opensearch/notebooks/index/NotebooksIndex.kt
27 2 4