opensearch-project / opensearch-go
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 2,497 units with 29,645 lines of code in units (80.0% of code).
    • 19 very long units (2,664 lines of code)
    • 160 long units (12,103 lines of code)
    • 39 medium size units (1,247 lines of code)
    • 43 small units (635 lines of code)
    • 2,236 very small units (12,996 lines of code)
8% | 40% | 4% | 2% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go8% | 40% | 4% | 2% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
opensearchapi6% | 42% | <1% | 0% | 50%
internal/build/cmd21% | 37% | 22% | 7% | 10%
opensearchtransport15% | 27% | 21% | 22% | 12%
opensearchutil28% | 0% | 53% | 10% | 7%
internal/build/utils0% | 26% | 17% | 27% | 28%
ROOT0% | 29% | 17% | 28% | 24%
signer/aws0% | 0% | 0% | 51% | 48%
internal/build0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in internal/build/cmd/generate/commands/gensource/generator.go
285 63 1
func()
in internal/build/cmd/generate/commands/gentests/generator.go
254 71 1
func()
in opensearchapi/api.search.go
199 60 1
func()
in opensearchapi/api.update_by_query.go
173 51 1
func New()
in opensearchapi/api._.go
168 1 1
func()
in opensearchapi/api.delete_by_query.go
167 49 1
func()
in opensearchtransport/opensearchtransport.go
133 44 1
func()
in opensearchapi/api.count.go
112 31 1
func()
in opensearchapi/api.search_template.go
111 30 1
func()
in opensearchapi/api.index.go
110 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 NewTestSuite()
in internal/build/cmd/generate/commands/gentests/model.go
105 37 2
func()
in opensearchapi/api.cat.indices.go
104 28 1
func()
in internal/build/cmd/generate/commands/gentests/command.go
102 26 1
func()
in opensearchutil/bulk_indexer.go
101 23 1
func()
in opensearchapi/api.nodes.stats.go
100 26 1