kubernetes / release
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 1,921 units with 24,184 lines of code in units (75.9% of code).
    • 8 very long units (1,197 lines of code)
    • 55 long units (3,789 lines of code)
    • 153 medium size units (4,509 lines of code)
    • 534 small units (8,189 lines of code)
    • 1,171 very small units (6,500 lines of code)
4% | 15% | 18% | 33% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go4% | 15% | 18% | 33% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/krel22% | 27% | 32% | 13% | 3%
packages/deb46% | 16% | 16% | 9% | 11%
cmd/release-notes61% | 32% | 0% | 0% | 5%
pkg/fastforward9% | 3% | 3% | 45% | 38%
pkg/changelog6% | 2% | 14% | 39% | 36%
pkg/announce32% | 0% | 38% | 20% | 9%
pkg/release0% | 20% | 17% | 34% | 27%
pkg/notes0% | 40% | 27% | 22% | 10%
pkg/anago0% | 8% | 9% | 44% | 37%
pkg/gcp0% | 28% | 13% | 34% | 24%
pkg/build0% | 26% | 30% | 23% | 19%
pkg/kubepkg0% | 21% | 20% | 28% | 29%
cmd/publish-release0% | 45% | 38% | 9% | 6%
cmd/kubepkg0% | 64% | 0% | 19% | 16%
pkg/binary0% | 0% | 45% | 36% | 17%
pkg/cve0% | 0% | 65% | 20% | 13%
cmd/ci-reporter0% | 0% | 55% | 23% | 21%
cmd/schedule-builder0% | 0% | 75% | 0% | 24%
pkg/mail0% | 0% | 21% | 49% | 28%
images/build0% | 0% | 60% | 17% | 21%
pkg/testgrid0% | 0% | 14% | 62% | 22%
pkg/kubecross0% | 0% | 0% | 64% | 35%
cmd/gcbuilder0% | 0% | 0% | 70% | 29%
pkg/version0% | 0% | 0% | 77% | 22%
pkg/testing0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in packages/deb/build.go
215 8 0
func init()
in cmd/release-notes/main.go
171 1 0
func createDraftPR()
in cmd/krel/cmd/release_notes.go
152 25 2
func fixReleaseNotes()
in cmd/krel/cmd/release_notes.go
148 27 2
func()
in pkg/fastforward/fastforward.go
135 27 1
func()
in pkg/changelog/changelog.go
130 26 1
func UpdateGitHubPage()
in pkg/announce/github_page.go
126 28 1
func editReleaseNote()
in cmd/krel/cmd/release_notes.go
120 25 4
func releaseNotesJSON()
in cmd/krel/cmd/release_notes.go
100 19 2
func()
in pkg/gcp/gcb/gcb.go
99 22 1
func GenerateReleaseVersion()
in pkg/release/release_version.go
95 17 4
func()
in pkg/release/repository.go
95 21 1
func WriteReleaseNotes()
in cmd/release-notes/main.go
91 22 1
func WriteChecksums()
in pkg/release/release.go
90 19 1
func()
in pkg/anago/stage.go
90 23 1
func()
in pkg/gcp/gcb/gcb.go
89 20 1
func ListBuildBinaries()
in pkg/release/workspace.go
88 17 2
func()
in pkg/anago/stage.go
88 16 1
func()
in pkg/notes/notes.go
84 19 1
func()
in pkg/anago/anagofakes/fake_stage_impl.go
83 2 1