opensearch-project / dashboards-reports
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 316 units with 5,085 lines of code in units (34.4% of code).
    • 1 very complex units (780 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (709 lines of code)
    • 11 simple units (723 lines of code)
    • 301 very simple units (2,873 lines of code)
15% | 0% | 13% | 14% | 56%
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
tsx49% | 0% | 29% | 3% | 16%
ts0% | 0% | 15% | 34% | 50%
kt0% | 0% | 0% | 5% | 94%
js0% | 0% | 0% | 20% | 79%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dashboards-reports/public/components44% | 0% | 26% | 5% | 23%
dashboards-reports/server/routes0% | 0% | 19% | 44% | 35%
reports-scheduler/src/main0% | 0% | 0% | 5% | 94%
dashboards-reports/server/backend0% | 0% | 0% | 0% | 100%
dashboards-reports/server0% | 0% | 0% | 0% | 100%
dashboards-reports/server/model0% | 0% | 0% | 0% | 100%
dashboards-reports/server/config0% | 0% | 0% | 0% | 100%
dashboards-reports/server/clusters0% | 0% | 0% | 0% | 100%
dashboards-reports/public0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function ReportSettings()
in dashboards-reports/public/components/report_definitions/report_settings/report_settings.tsx
780 57 1
export function TimeRangeSelect()
in dashboards-reports/public/components/report_definitions/report_settings/time_range.tsx
194 16 1
export function ReportDelivery()
in dashboards-reports/public/components/report_definitions/delivery/delivery.tsx
279 15 1
export default function()
in dashboards-reports/server/routes/reportDefinition.ts
236 11 2
override fun doExecute()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/action/PluginBaseAction.kt
59 10 3
export default function()
in dashboards-reports/server/routes/notifications.ts
118 10 1
export default function()
in dashboards-reports/server/routes/report.ts
269 9 2
override fun toXContent()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/model/ReportInstance.kt
33 8 2
function locationHashChanged()
in dashboards-reports/public/components/context_menu/context_menu.js
35 8 0
function sanitize()
in dashboards-reports/server/routes/utils/dataReportHelpers.ts
15 8 1
report_definition: backendToUiReportDefinition()
in dashboards-reports/server/routes/utils/converters/backendToUi.ts
60 8 2
created: convertTimestamp()
in dashboards-reports/public/components/main/report_details/report_details.tsx
30 7 1
lastUpdated: convertTimestamp()
in dashboards-reports/public/components/main/report_details/report_details.tsx
29 7 1
function flattenHits()
in dashboards-reports/server/routes/utils/dataReportHelpers.ts
16 7 3
export default function()
in dashboards-reports/server/routes/reportSource.ts
59 6 1
fun validateUser()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/security/UserAccessManager.kt
18 5 1
function addTenantToURL()
in dashboards-reports/public/components/context_menu/context_menu.js
14 5 2
async function populateMetaData()
in dashboards-reports/server/routes/utils/savedSearchReportHelper.ts
48 5 4
fun getSearchAccessInfo()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/security/UserAccessManager.kt
13 4 1
fun doesUserHasAccess()
in reports-scheduler/src/main/kotlin/org/opensearch/reportsscheduler/security/UserAccessManager.kt
13 4 3