kubernetes / git-sync
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 65 units with 1,223 lines of code in units (78.9% of code).
    • 2 very long units (378 lines of code)
    • 1 long units (58 lines of code)
    • 12 medium size units (356 lines of code)
    • 17 small units (241 lines of code)
    • 33 very small units (190 lines of code)
30% | 4% | 29% | 19% | 15%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
go30% | 4% | 29% | 19% | 15%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
cmd/git-sync41% | 6% | 24% | 18% | 9%
pkg/logging0% | 0% | 75% | 14% | 10%
pkg/pid10% | 0% | 45% | 54% | 0%
pkg/cmd0% | 0% | 55% | 30% | 13%
pkg/hook0% | 0% | 16% | 15% | 68%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func main()
in cmd/git-sync/main.go
271 72 0
func addWorktreeAndSwap()
in cmd/git-sync/main.go
107 26 8
func cloneRepo()
in cmd/git-sync/main.go
58 13 6
func callGitAskPassURL()
in cmd/git-sync/main.go
49 11 2
func parseGitConfigs()
in cmd/git-sync/main.go
46 10 1
func syncRepo()
in cmd/git-sync/main.go
37 9 9
func()
in pkg/logging/logging.go
33 6 1
func()
in pkg/logging/logging.go
31 8 1
func runInit()
in pkg/pid1/pid1.go
25 8 1
func updateSymlink()
in cmd/git-sync/main.go
24 7 4
func()
in pkg/cmd/cmd.go
24 4 1
func setupGitSSH()
in cmd/git-sync/main.go
22 5 1
func parseGitConfigQVal()
in cmd/git-sync/main.go
22 7 1
func()
in pkg/hook/hook.go
22 5 1
func addUser()
in cmd/git-sync/main.go
21 5 0
func()
in pkg/hook/webhook.go
20 5 1
func parseGitConfigVal()
in cmd/git-sync/main.go
19 5 2
func getRevs()
in cmd/git-sync/main.go
17 4 4
func removeDirContents()
in cmd/git-sync/main.go
16 5 2
func sigchld()
in pkg/pid1/pid1.go
16 5 1