opensearch-project / perftop
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 65 units with 751 lines of code in units (79.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (83 lines of code)
    • 7 medium size units (206 lines of code)
    • 21 small units (300 lines of code)
    • 36 very small units (162 lines of code)
0% | 11% | 27% | 39% | 21%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js0% | 11% | 27% | 39% | 21%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/perf-top/rca/util/temperature-profile0% | 74% | 0% | 25% | 0%
lib/perf-top/metrics/util0% | 0% | 37% | 45% | 17%
lib/perf-top/rca/util0% | 0% | 18% | 56% | 25%
lib/perf-top/metrics0% | 0% | 100% | 0% | 0%
lib/perf-top/rca0% | 0% | 73% | 0% | 26%
lib/perf-top0% | 0% | 0% | 43% | 56%
lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
function getData()
in lib/perf-top/rca/util/temperature-profile/generate-data.js
83 20 4
function()
in lib/perf-top/metrics/util/metric-line.js
49 9 1
function getDataPerNode()
in lib/perf-top/metrics/util/generate-data.js
41 13 1
function()
in lib/perf-top/rca/util/metric-line.js
27 7 1
function initAndStart()
in lib/perf-top/metrics/generate-graphs.js
24 6 1
function initAndStart()
in lib/perf-top/rca/generate-graphs.js
22 5 1
function getMetricUnits()
in lib/perf-top/metrics/util/generate-data.js
22 7 2
function aggregateMetricData()
in lib/perf-top/metrics/util/generate-data.js
21 4 1
function removeStaleData()
in lib/perf-top/metrics/util/generate-data.js
20 7 2
function()
in lib/perf-top/rca/util/metric-table.js
18 7 1
function metricTable()
in lib/perf-top/metrics/util/metric-table.js
18 2 6
function metricLine()
in lib/perf-top/metrics/util/metric-line.js
18 3 5
function metricLine()
in lib/perf-top/rca/util/metric-line.js
17 3 8
function()
in lib/perf-top/metrics/util/metric-table.js
17 4 1
function getMetricData()
in lib/perf-top/rca/util/temperature-profile/generate-data.js
16 4 7
function metricTable()
in lib/perf-top/rca/util/metric-table.js
15 2 8
function makeRequest()
in lib/perf-top/helper.js
14 2 2
function addCommaDelimiter()
in lib/perf-top/metrics/util/generate-data.js
14 5 1
function metricBar()
in lib/perf-top/metrics/util/metric-bar.js
14 2 5
function removeStaleData()
in lib/perf-top/rca/util/temperature-profile/generate-data.js
13 3 2