kubernetes / publishing-bot
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 99 units with 2,139 lines of code in units (79.0% of code).
    • 2 very long units (372 lines of code)
    • 6 long units (427 lines of code)
    • 16 medium size units (525 lines of code)
    • 37 small units (566 lines of code)
    • 38 very small units (249 lines of code)
17% | 19% | 24% | 26% | 11%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go17% | 19% | 24% | 26% | 11%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/sync-tags37% | 19% | 7% | 32% | 3%
cmd/publishing-bot14% | 18% | 19% | 25% | 21%
cmd/init-repo0% | 60% | 0% | 25% | 13%
cmd/collapsed-kube-commit-mapper0% | 61% | 38% | 0% | 0%
pkg/git0% | 0% | 69% | 22% | 8%
pkg/golang0% | 0% | 100% | 0% | 0%
cmd/validate-rules0% | 0% | 62% | 38% | 0%
cmd/gomod-zip0% | 0% | 63% | 36% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in cmd/sync-tags/main.go
235 63 0
func main()
in cmd/publishing-bot/main.go
137 39 0
func()
in cmd/publishing-bot/publisher.go
98 20 1
func main()
in cmd/init-repo/main.go
77 22 0
func()
in cmd/publishing-bot/publisher.go
73 19 1
69 14 3
func main()
in cmd/collapsed-kube-commit-mapper/main.go
58 14 0
func packageDepToGoModCache()
in cmd/sync-tags/gomod.go
52 12 5
func MergePoints()
in pkg/git/mainline.go
50 12 2
func ReportOnIssue()
in cmd/publishing-bot/github.go
49 12 6
func cleanCacheForTag()
in cmd/sync-tags/main.go
49 14 1
func fetchKubernetesStagingDirectoryFiles()
in cmd/validate-rules/staging/github_utils.go
38 9 1
func InstallGoVersions()
in pkg/golang/install.go
38 12 1
func SourceCommitToDstCommits()
in pkg/git/mapping.go
37 10 4
func Usage()
in cmd/collapsed-kube-commit-mapper/main.go
36 2 0
func()
in cmd/publishing-bot/publisher.go
36 11 1
func()
in cmd/publishing-bot/publisher.go
31 7 1
func installGoVersion()
in pkg/golang/install.go
28 8 2
func main()
in cmd/validate-rules/main.go
24 7 0
func transfromLogToGithubFormat()
in cmd/publishing-bot/github.go
23 3 3