opensearch-project / opensearch-dashboards-test-library
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 44 units with 332 lines of code in units (90.2% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 4 medium size units (120 lines of code)
    • 5 small units (70 lines of code)
    • 35 very small units (142 lines of code)
0% | 0% | 36% | 21% | 42%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 0% | 36% | 21% | 42%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
common-utils/common-UI0% | 0% | 42% | 19% | 37%
page-object-model/dashboard-page0% | 0% | 55% | 25% | 20%
common-utils/network0% | 0% | 47% | 46% | 6%
common-utils0% | 0% | 0% | 0% | 100%
page-object-model/home-page0% | 0% | 0% | 0% | 100%
page-object-model/login-page0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
addFilterRetryFull()
in common-utils/common-UI/common-UI.js
34 6 4
addDashboardPanels()
in page-object-model/dashboard-page/dashboard-page.js
33 3 3
importJSONDoc()
in common-utils/network/test-fixture-handler.js
30 3 2
addFilterRetrySelection()
in common-utils/common-UI/common-UI.js
23 4 4
importJSONMapping()
in common-utils/network/test-fixture-handler.js
16 2 1
saveDashboardVisualization()
in page-object-model/dashboard-page/dashboard-page.js
15 3 3
setDateRange()
in common-utils/common-UI/common-UI.js
13 1 2
removeFilter()
in common-utils/common-UI/common-UI.js
13 2 2
clearJSONMapping()
in common-utils/network/test-fixture-handler.js
13 2 1
addSampleData()
in common-utils/misc-utils.js
10 1 1
viewData()
in common-utils/misc-utils.js
8 2 1
removeSampleData()
in common-utils/misc-utils.js
6 1 0
openVisualizationContextMenu()
in page-object-model/dashboard-page/dashboard-page.js
6 1 1
checkElementContainsValue()
in common-utils/common-UI/common-UI.js
5 1 3
checkElementComponentContainsValue()
in common-utils/common-UI/common-UI.js
5 1 4
checkValuesExistInComponent()
in common-utils/common-UI/common-UI.js
5 1 2
checkValuesDoNotExistInComponent()
in common-utils/common-UI/common-UI.js
5 1 2
pinFilter()
in common-utils/common-UI/common-UI.js
4 1 2
removeAllFilters()
in common-utils/common-UI/common-UI.js
4 1 0
pieChartRemoveFilter()
in common-utils/common-UI/common-UI.js
4 1 1