golang / build
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 2,788 units with 46,183 lines of code in units (73.6% of code).
    • 5 very complex units (2,172 lines of code)
    • 25 complex units (2,986 lines of code)
    • 161 medium complex units (9,740 lines of code)
    • 323 simple units (9,590 lines of code)
    • 2,274 very simple units (21,695 lines of code)
4% | 6% | 21% | 20% | 46%
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
go4% | 6% | 21% | 20% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dashboard68% | 0% | 5% | 2% | 22%
cmd2% | 9% | 29% | 24% | 33%
internal3% | 3% | 8% | 12% | 72%
maintner2% | 3% | 21% | 22% | 49%
buildlet0% | 12% | 23% | 22% | 42%
devapp0% | 9% | 23% | 23% | 42%
version0% | 0% | 36% | 24% | 39%
kubernetes0% | 0% | 18% | 36% | 44%
gerrit0% | 0% | 19% | 1% | 78%
vcs-test0% | 0% | 20% | 34% | 44%
ROOT0% | 0% | 48% | 29% | 22%
revdial0% | 0% | 15% | 37% | 46%
repos0% | 0% | 20% | 0% | 79%
cloudfns0% | 0% | 0% | 50% | 49%
env0% | 0% | 0% | 35% | 64%
tarutil0% | 0% | 0% | 39% | 60%
livelog0% | 0% | 0% | 23% | 76%
pargzip0% | 0% | 0% | 0% | 100%
buildenv0% | 0% | 0% | 0% | 100%
autocertcache0% | 0% | 0% | 0% | 100%
types0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in cmd/release/release.go
299 80 1
func file_gomote_proto_init()
in internal/gomote/protos/gomote.pb.go
326 78 0
func init()
in dashboard/builders.go
1139 78 0
func push()
in cmd/gomote/push.go
233 54 1
func()
in maintner/github.go
175 54 1
func()
in cmd/gopherstats/gopherstats.go
129 42 1
func main()
in maintner/maintnerd/maintnerd.go
166 41 0
func main()
in cmd/buildlet/stage0/stage0.go
148 39 0
func main()
in cmd/debugnewvm/debugnewvm.go
155 38 0
func StartNewVM()
in buildlet/gce.go
196 36 5
func main()
in cmd/buildlet/buildlet.go
123 35 0
func SyncBuilds()
in internal/buildstats/buildstats.go
136 35 2
func main()
in cmd/upload/upload.go
115 32 0
func SyncSpans()
in internal/buildstats/buildstats.go
126 32 2
func newTrySet()
in cmd/coordinator/coordinator.go
135 31 1
func handleExec()
in cmd/buildlet/buildlet.go
135 30 2
func()
in devapp/release.go
118 29 1
func()
in cmd/gopherbot/gopherbot.go
92 28 1
func InitGCE()
in internal/coordinator/pool/gce.go
97 28 7
72 27 2