kubernetes / enhancements
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 98 units with 1,775 lines of code in units (13.6% of code).
    • 1 very long units (122 lines of code)
    • 7 long units (464 lines of code)
    • 18 medium size units (544 lines of code)
    • 24 small units (379 lines of code)
    • 48 very small units (266 lines of code)
6% | 26% | 30% | 21% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go7% | 26% | 29% | 21% | 14%
py0% | 0% | 62% | 0% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
pkg/repo20% | 44% | 18% | 7% | 8%
pkg/kepctl0% | 60% | 23% | 6% | 9%
pkg/kepval0% | 65% | 34% | 0% | 0%
api0% | 0% | 62% | 10% | 26%
pkg/output0% | 0% | 53% | 29% | 16%
cmd/kepify0% | 0% | 38% | 55% | 5%
pkg/proposal0% | 0% | 28% | 57% | 13%
hack0% | 0% | 62% | 0% | 37%
api/apifakes0% | 0% | 0% | 71% | 28%
pkg/yaml0% | 0% | 0% | 0% | 100%
cmd/kepctl0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func()
in pkg/repo/repo.go
122 26 1
func addCreate()
in pkg/kepctl/commands/create.go
79 1 1
func NewRepo()
in pkg/repo/repo.go
78 12 2
func addQuery()
in pkg/kepctl/commands/query.go
72 1 1
func()
in pkg/repo/query.go
64 23 1
func()
in pkg/repo/validate.go
63 15 1
func()
in pkg/repo/repo.go
56 11 1
func ValidatePRR()
in pkg/kepval/approval.go
52 11 3
func main()
in cmd/kepify/main.go
49 10 0
func NewOutput()
in pkg/output/output.go
41 5 3
func()
in api/proposal.go
38 8 1
func()
in pkg/repo/repo.go
37 8 1
func populateProposal()
in pkg/proposal/create.go
34 8 2
func addPromote()
in pkg/kepctl/commands/promote.go
32 1 1
func DefaultPrintConfigs()
in pkg/output/output.go
32 5 1
func()
in api/groups.go
32 6 1
func()
in api/groups.go
29 6 1
func New()
in pkg/kepctl/commands/commands.go
27 1 0
func isPRRRequired()
in pkg/kepval/approval.go
27 7 1
func()
in api/approval.go
26 11 1