opensearch-project / opensearch-ruby
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 506 units with 4,785 lines of code in units (19.8% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (76 lines of code)
    • 10 medium complex units (261 lines of code)
    • 35 simple units (715 lines of code)
    • 460 very simple units (3,733 lines of code)
0% | 1% | 5% | 14% | 78%
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
rb0% | 1% | 5% | 15% | 77%
rake0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
opensearch-transport/lib0% | 9% | 12% | 9% | 68%
opensearch-api/lib0% | 0% | 5% | 22% | 72%
opensearch-dsl/lib0% | 0% | 3% | 8% | 87%
profile/benchmarking0% | 0% | 0% | 0% | 100%
opensearch/lib0% | 0% | 0% | 0% | 100%
rake_tasks0% | 0% | 0% | 0% | 100%
opensearch-transport/spec0% | 0% | 0% | 0% | 100%
opensearch/spec0% | 0% | 0% | 0% | 100%
opensearch-api/spec0% | 0% | 0% | 0% | 100%
profile0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
perform_request
in opensearch-transport/lib/opensearch/transport/transport/base.rb
76 33 7
initialize
in opensearch-transport/lib/opensearch/transport/client.rb
41 25 2
__build_connections
in opensearch-transport/lib/opensearch/transport/transport/base.rb
14 15 0
termvectors
in opensearch-api/lib/opensearch/api/actions/termvectors.rb
26 12 1
to_hash
in opensearch-dsl/lib/opensearch/dsl/search.rb
15 12 0
get_field_mapping
in opensearch-api/lib/opensearch/api/actions/indices/get_field_mapping.rb
21 11 1
index
in opensearch-api/lib/opensearch/api/actions/index.rb
22 11 1
msearch
in opensearch-api/lib/opensearch/api/actions/msearch.rb
39 11 1
stats
in opensearch-api/lib/opensearch/api/actions/nodes/stats.rb
24 11 1
to_hash
in opensearch-dsl/lib/opensearch/dsl/search/base_component.rb
16 11 1
__parse_host
in opensearch-transport/lib/opensearch/transport/client.rb
43 11 1
__bulkify
in opensearch-api/lib/opensearch/api/utils.rb
23 10 1
update
in opensearch-api/lib/opensearch/api/actions/update.rb
23 9 1
__report_unsupported_parameters
in opensearch-api/lib/opensearch/api/utils.rb
33 8 2
delete
in opensearch-api/lib/opensearch/api/actions/delete.rb
22 8 1
msearch_template
in opensearch-api/lib/opensearch/api/actions/msearch_template.rb
28 8 1
explain
in opensearch-api/lib/opensearch/api/actions/explain.rb
22 8 1
get
in opensearch-api/lib/opensearch/api/actions/get.rb
22 8 1
search
in opensearch-api/lib/opensearch/api/actions/search.rb
22 8 1
initialize
in opensearch-transport/lib/opensearch/transport/transport/base.rb
22 8 2