opensearch-project / anomaly-detection-dashboards-plugin
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 260 units with 6,868 lines of code in units (28.5% of code).
    • 14 very long units (2,767 lines of code)
    • 17 long units (1,396 lines of code)
    • 42 medium size units (1,197 lines of code)
    • 49 small units (764 lines of code)
    • 138 very small units (744 lines of code)
40% | 20% | 17% | 11% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts42% | 11% | 19% | 13% | 12%
tsx36% | 33% | 14% | 7% | 7%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
public/pages50% | 21% | 10% | 8% | 7%
server/cluster85% | 0% | 14% | 0% | 0%
server/routes0% | 14% | 43% | 20% | 21%
server0% | 71% | 20% | 0% | 8%
public/redux0% | 16% | 42% | 20% | 21%
public/utils0% | 0% | 0% | 58% | 41%
public0% | 0% | 0% | 50% | 50%
server/utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
export function AnomalyResults()
in public/pages/DetectorResults/containers/AnomalyResults.tsx
429 82 1
data: toFixedNumberForAnomaly()
in public/pages/utils/anomalyResultUtils.ts
389 47 2
startTime: get()
in public/pages/utils/anomalyResultUtils.ts
388 47 2
endTime: get()
in public/pages/utils/anomalyResultUtils.ts
387 47 2
export default function adPlugin()
in server/cluster/ad/adPlugin.ts
215 1 3
export function DashboardOverview()
in public/pages/Dashboard/Container/DashboardOverview.tsx
130 7 0
async function getBucketizedAnomalyResults()
in public/pages/DetectorResults/containers/AnomalyHistory.tsx
110 10 2
function FilterValue()
in public/pages/DefineDetector/components/DataFilterList/components/FilterValue.tsx
106 4 1
anomalyGrade: toFixedNumberForAnomaly()
in public/pages/utils/anomalyResultUtils.ts
104 15 2
confidence: toFixedNumberForAnomaly()
in public/pages/utils/anomalyResultUtils.ts
103 15 2
monitorName: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
102 19 2
startTime: get()
in public/pages/utils/anomalyResultUtils.ts
102 15 2
triggerName: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
101 19 2
endTime: get()
in public/pages/utils/anomalyResultUtils.ts
101 15 2
severity: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
100 19 2
plotTime: get()
in public/pages/utils/anomalyResultUtils.ts
100 15 2
state: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
99 19 2
entity: get()
in public/pages/utils/anomalyResultUtils.ts
99 15 2
startTime: get()
in server/routes/utils/adHelpers.ts
99 7 2
error: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
98 19 2