kubernetes / git-sync
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 65 units with 1,223 lines of code in units (78.9% of code).
    • 1 very complex units (271 lines of code)
    • 1 complex units (107 lines of code)
    • 2 medium complex units (107 lines of code)
    • 7 simple units (218 lines of code)
    • 54 very simple units (520 lines of code)
22% | 8% | 8% | 17% | 42%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
go22% | 8% | 8% | 17% | 42%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
cmd/git-sync29% | 11% | 11% | 14% | 32%
pkg/logging0% | 0% | 0% | 75% | 24%
pkg/pid10% | 0% | 0% | 45% | 54%
pkg/hook0% | 0% | 0% | 0% | 100%
pkg/cmd0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex 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 runInit()
in pkg/pid1/pid1.go
25 8 1
func()
in pkg/logging/logging.go
31 8 1
func updateSymlink()
in cmd/git-sync/main.go
24 7 4
func parseGitConfigQVal()
in cmd/git-sync/main.go
22 7 1
func()
in pkg/logging/logging.go
33 6 1
func removeDirContents()
in cmd/git-sync/main.go
16 5 2
func addUser()
in cmd/git-sync/main.go
21 5 0
func setupGitSSH()
in cmd/git-sync/main.go
22 5 1
func parseGitConfigVal()
in cmd/git-sync/main.go
19 5 2
func unescape()
in cmd/git-sync/main.go
15 5 1
func()
in pkg/hook/hook.go
22 5 1
func()
in pkg/hook/webhook.go
20 5 1
func sigchld()
in pkg/pid1/pid1.go
16 5 1
func revIsHash()
in cmd/git-sync/main.go
15 4 3