opensearch-project / OpenSearch-Dashboards
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 8,337 units with 116,270 lines of code in units (39.1% of code).
    • 2 very complex units (245 lines of code)
    • 12 complex units (1,900 lines of code)
    • 197 medium complex units (12,230 lines of code)
    • 564 simple units (19,677 lines of code)
    • 7,562 very simple units (82,218 lines of code)
<1% | 1% | 10% | 16% | 70%
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
ts<1% | 1% | 9% | 14% | 74%
js<1% | 1% | 11% | 19% | 67%
tsx0% | 2% | 12% | 19% | 65%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/plugins<1% | 1% | 10% | 17% | 70%
packages/osd-ace2% | 14% | 11% | 12% | 58%
packages/osd-expect0% | 23% | 15% | 28% | 31%
packages/osd-telemetry-tools0% | 13% | 23% | 16% | 47%
src/core0% | <1% | 9% | 12% | 76%
packages/osd-optimizer0% | 0% | 28% | 21% | 49%
packages/osd-interpreter0% | 0% | 39% | 24% | 35%
packages/osd-test0% | 0% | 16% | 19% | 63%
packages/osd-pm0% | 0% | 21% | 12% | 65%
packages/osd-dev-utils0% | 0% | 14% | 23% | 61%
src/legacy0% | 0% | 11% | 6% | 81%
packages/osd-opensearch0% | 0% | 21% | 7% | 70%
src/dev0% | 0% | 3% | 22% | 73%
packages/osd-release-notes0% | 0% | 20% | 22% | 57%
packages/opensearch-datemath0% | 0% | 66% | 33% | 0%
src/cli0% | 0% | 7% | 26% | 66%
packages/osd-plugin-generator0% | 0% | 39% | 38% | 22%
packages/osd-opensearch-archiver0% | 0% | 4% | 13% | 82%
packages/osd-plugin-helpers0% | 0% | 14% | 29% | 56%
packages/opensearch-safer-lodash-set0% | 0% | 80% | 0% | 19%
packages/osd-i18n0% | 0% | 7% | 35% | 56%
packages/osd-monaco0% | 0% | 7% | 36% | 55%
packages/osd-config-schema0% | 0% | 0% | 17% | 82%
src/cli_plugin0% | 0% | 0% | 15% | 84%
src/cli_keystore0% | 0% | 0% | 52% | 47%
packages/osd-eslint-plugin-eslint0% | 0% | 0% | 28% | 71%
packages/osd-config0% | 0% | 0% | 21% | 78%
src/optimize0% | 0% | 0% | 20% | 79%
packages/osd-analytics0% | 0% | 0% | 35% | 64%
packages/osd-eslint-import-resolver-opensearch-dashboards0% | 0% | 0% | 39% | 60%
tasks0% | 0% | 0% | 13% | 86%
packages/osd-logging0% | 0% | 0% | 84% | 15%
src/setup_node_env0% | 0% | 0% | 25% | 74%
packages/osd-apm-config-loader0% | 0% | 0% | 8% | 91%
packages/osd-ui-framework0% | 0% | 0% | 0% | 100%
src/fixtures0% | 0% | 0% | 0% | 100%
tasks/config0% | 0% | 0% | 0% | 100%
packages/osd-std0% | 0% | 0% | 0% | 100%
utilities0% | 0% | 0% | 0% | 100%
packages/osd-ui-shared-deps0% | 0% | 0% | 0% | 100%
packages/osd-storybook0% | 0% | 0% | 0% | 100%
src0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
packages/osd-utils0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export function getCurrentMethodAndTokenPaths()
in src/plugins/console/public/lib/autocomplete/autocomplete.ts
211 78 4
this.isEqual = function()
in packages/osd-ace/src/ace/modes/x_json/worker/x_json.ace.worker.js
34 54 1
oop.implement()
in packages/osd-ace/src/ace/modes/x_json/worker/x_json.ace.worker.js
130 50 2
function format()
in packages/osd-expect/expect.js
145 45 2
function TimelineVisComponent()
in src/plugins/vis_type_timeline/public/components/timeline_vis_component.tsx
308 40 5
export function getDescriptor()
in packages/osd-telemetry-tools/src/tools/serializer.ts
121 40 2
export function useForm()
in src/plugins/opensearch_ui_shared/static/forms/hook_form_lib/hooks/use_form.ts
354 38 1
EventEmitter._emit = EventEmitter._dispatchEvent = function()
in packages/osd-ace/src/ace/modes/x_json/worker/x_json.ace.worker.js
46 36 2
addPath()
in src/plugins/vis_type_vislib/public/vislib/visualizations/pie_chart.js
187 35 4
export async function parseManifest()
in src/core/server/plugins/discovery/plugin_manifest_parser.ts
111 34 3
function addBodyPrefixSuffixToContext()
in src/plugins/console/public/lib/autocomplete/autocomplete.ts
80 29 1
function()
in src/plugins/vis_type_table/public/agg_table/agg_table.js
105 28 0
_injectContextVars()
in src/plugins/vis_type_vega/public/data_model/opensearch_query_parser.ts
97 27 2
export function DiscoverLegacy()
in src/plugins/discover/public/application/components/discover_legacy.tsx
216 26 29
function applyTerm()
in src/plugins/console/public/lib/autocomplete/autocomplete.ts
89 25 1
export function logOptimizerState()
in packages/osd-optimizer/src/log_optimizer_state.ts
99 25 2
function DefaultEditorAggParams()
in src/plugins/vis_default_editor/public/components/agg_params.tsx
175 24 19
renderField()
in src/plugins/advanced_settings/public/management_app/components/field/field.tsx
128 24 2
function MetricsAxisOptions()
in src/plugins/vis_type_vislib/public/components/options/metrics_axes/index.tsx
228 24 1
drawGauge()
in src/plugins/vis_type_vislib/public/vislib/visualizations/gauges/meter.js
145 24 4