kubernetes / cluster-bootstrap
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 17 units with 161 lines of code in units (68.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (45 lines of code)
    • 4 small units (57 lines of code)
    • 11 very small units (59 lines of code)
0% | 0% | 27% | 35% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go0% | 0% | 27% | 35% | 36%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
token/jws0% | 0% | 63% | 0% | 36%
token/util0% | 0% | 33% | 38% | 28%
util/secrets0% | 0% | 0% | 62% | 37%
util/tokens0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
24 4 3
func randBytes()
in token/util/helpers.go
21 5 1
func GetExpiration()
in util/secrets/secrets.go
19 4 2
func GetGroups()
in util/secrets/secrets.go
14 4 1
func ValidateUsages()
in token/util/helpers.go
13 4 1
func GenerateBootstrapToken()
in token/util/helpers.go
11 3 0
func GetData()
in util/secrets/secrets.go
9 3 2
func ParseName()
in util/secrets/secrets.go
7 2 1
func ParseToken()
in util/tokens/tokens.go
7 2 1
func stripContent()
in token/jws/jws.go
7 2 1
func DetachedTokenIsValid()
in token/jws/jws.go
7 2 4
func ValidateBootstrapGroupName()
in token/util/helpers.go
6 2 1
func HasExpired()
in util/secrets/secrets.go
4 1 2
func TokenFromIDAndSecret()
in token/util/helpers.go
3 1 2
func IsValidBootstrapToken()
in token/util/helpers.go
3 1 1
func IsValidBootstrapTokenID()
in token/util/helpers.go
3 1 1
func BootstrapTokenSecretName()
in token/util/helpers.go
3 1 1