opensearch-project / opensearch-cli
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 304 units with 2,894 lines of code in units (69.5% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 26 medium size units (695 lines of code)
    • 66 small units (951 lines of code)
    • 211 very small units (1,185 lines of code)
0% | 2% | 24% | 32% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 2% | 24% | 32% | 40%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
controller0% | 6% | 34% | 17% | 41%
mapper0% | 0% | 44% | 29% | 25%
gateway0% | 0% | 11% | 44% | 44%
commands0% | 0% | 10% | 54% | 35%
handler0% | 0% | 27% | 14% | 57%
it0% | 0% | 34% | 42% | 22%
client0% | 0% | 0% | 0% | 100%
entity0% | 0% | 0% | 0% | 100%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in controller/ad/ad.go
63 13 1
func()
in controller/ad/ad.go
44 11 1
func()
in controller/ad/ad.go
35 10 1
func()
in controller/ad/ad.go
34 10 1
func()
in controller/ad/ad.go
33 8 1
func()
in handler/ad/ad.go
32 7 1
func MapToCreateDetector()
in mapper/ad/ad.go
32 6 1
func()
in controller/profile/profile.go
30 8 1
func CommandToCurlRequestParameter()
in mapper/platform/platform.go
29 9 1
func()
in controller/ad/ad.go
29 7 1
func()
in handler/ad/ad.go
28 6 1
func()
in controller/ad/ad.go
28 8 1
func NewHTTPGateway()
in gateway/gateway.go
27 7 2
func()
in it/helper.go
24 5 1
24 3 3
func()
in controller/ad/ad.go
24 6 1
func init()
in commands/profile.go
24 1 0
func MapToDetectorOutput()
in mapper/ad/ad.go
23 3 1
func MapToUpdateDetector()
in mapper/ad/ad.go
23 4 1
func()
in controller/ad/ad.go
23 6 1