opensearch-project / anomaly-detection-dashboards-plugin
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 260 units with 6,868 lines of code in units (28.5% of code).
    • 1 very complex units (429 lines of code)
    • 3 complex units (1,164 lines of code)
    • 14 medium complex units (1,357 lines of code)
    • 14 simple units (832 lines of code)
    • 228 very simple units (3,086 lines of code)
6% | 16% | 19% | 12% | 44%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
tsx16% | 0% | 28% | 19% | 36%
ts0% | 27% | 14% | 7% | 50%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
public/pages8% | 23% | 27% | 11% | 30%
server/routes0% | 0% | 0% | 14% | 85%
server0% | 0% | 0% | 71% | 28%
public/redux0% | 0% | 0% | 10% | 89%
server/cluster0% | 0% | 0% | 0% | 100%
public0% | 0% | 0% | 0% | 100%
public/utils0% | 0% | 0% | 0% | 100%
server/utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex 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
monitorName: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
102 19 2
triggerName: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
101 19 2
severity: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
100 19 2
state: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
99 19 2
error: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
98 19 2
startTime: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
97 19 2
endTime: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
96 19 2
anomalyGrade: toFixedNumberForAnomaly()
in public/pages/utils/anomalyResultUtils.ts
104 15 2
confidence: toFixedNumberForAnomaly()
in public/pages/utils/anomalyResultUtils.ts
103 15 2
startTime: get()
in public/pages/utils/anomalyResultUtils.ts
102 15 2
endTime: get()
in public/pages/utils/anomalyResultUtils.ts
101 15 2
plotTime: get()
in public/pages/utils/anomalyResultUtils.ts
100 15 2
entity: get()
in public/pages/utils/anomalyResultUtils.ts
99 15 2
acknowledgedTime: get()
in public/pages/AnomalyCharts/utils/anomalyChartUtils.tsx
55 11 2
async function getBucketizedAnomalyResults()
in public/pages/DetectorResults/containers/AnomalyHistory.tsx
110 10 2
stroke: darkModeEnabled()
in public/pages/AnomalyCharts/containers/AnomalyDetailsChart.tsx
41 8 0