opensearch-project / opensearch-go
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 2,497 units with 29,645 lines of code in units (80.0% of code).
    • 4 very complex units (911 lines of code)
    • 20 complex units (2,165 lines of code)
    • 158 medium complex units (11,649 lines of code)
    • 32 simple units (1,027 lines of code)
    • 2,283 very simple units (13,893 lines of code)
3% | 7% | 39% | 3% | 46%
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
go3% | 7% | 39% | 3% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
internal/build/cmd15% | 8% | 38% | 16% | 21%
opensearchapi1% | 7% | 40% | <1% | 51%
opensearchtransport0% | 15% | 31% | 23% | 30%
opensearchutil0% | 0% | 40% | 33% | 25%
internal/build/utils0% | 0% | 26% | 17% | 55%
ROOT0% | 0% | 0% | 47% | 52%
signer/aws0% | 0% | 0% | 0% | 100%
internal/build0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in internal/build/cmd/generate/commands/gentests/generator.go
254 71 1
func()
in internal/build/cmd/generate/commands/gensource/generator.go
285 63 1
func()
in opensearchapi/api.search.go
199 60 1
func()
in opensearchapi/api.update_by_query.go
173 51 1
func()
in opensearchapi/api.delete_by_query.go
167 49 1
func()
in opensearchtransport/opensearchtransport.go
133 44 1
func NewTestSuite()
in internal/build/cmd/generate/commands/gentests/model.go
105 37 2
func()
in opensearchapi/api.count.go
112 31 1
func()
in opensearchapi/api.index.go
110 30 1
func()
in opensearchapi/api.search_template.go
111 30 1
func()
in opensearchapi/api.explain.go
109 29 1
func()
in opensearchapi/api.update.go
109 29 1
func()
in opensearchapi/api.indices.validate_query.go
108 29 1
func()
in opensearchapi/api.termvectors.go
108 29 1
func()
in opensearchapi/api.mtermvectors.go
106 29 1
func()
in opensearchapi/api.cat.indices.go
104 28 1
func()
in opensearchapi/api.bulk.go
100 27 1
func()
in opensearchapi/api.get.go
98 26 1
func()
in opensearchapi/api.exists.go
98 26 1
func()
in opensearchapi/api.cluster.health.go
98 26 1