bazelbuild / rules_go
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 341 units with 7,686 lines of code in units (46.8% of code).
    • 2 very complex units (467 lines of code)
    • 10 complex units (1,284 lines of code)
    • 37 medium complex units (1,923 lines of code)
    • 67 simple units (1,993 lines of code)
    • 225 very simple units (2,019 lines of code)
6% | 16% | 25% | 25% | 26%
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
go6% | 16% | 25% | 25% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
go/tools/builders5% | 16% | 28% | 29% | 19%
go/tools/releaser19% | 27% | 9% | 17% | 26%
go/tools/bazel_testing0% | 43% | 0% | 24% | 31%
go/tools/bzltestutil0% | 20% | 21% | 28% | 29%
go/tools/bazel0% | 0% | 59% | 11% | 28%
go/tools/bazel_benchmark0% | 0% | 49% | 19% | 30%
go/tools/gopackagesdriver0% | 0% | 20% | 18% | 61%
go/tools/windows-testrunner0% | 0% | 0% | 57% | 42%
go/tools/fetch_repo0% | 0% | 0% | 64% | 35%
go/tools/internal0% | 0% | 0% | 0% | 100%
go/tools/coverdata0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func compileArchive()
in go/tools/builders/compilepkg.go
255 59 23
func upgradeDepDecl()
in go/tools/releaser/upgradedep.go
212 51 6
func runPrepare()
in go/tools/releaser/prepare.go
152 38 3
func runUpgradeDep()
in go/tools/releaser/upgradedep.go
142 37 3
func compile()
in go/tools/builders/compile.go
159 36 1
func setupWorkspace()
in go/tools/bazel_testing/bazel_testing.go
134 35 2
func genTestMain()
in go/tools/builders/generate_test_main.go
154 34 1
func cgo2()
in go/tools/builders/cgo2.go
153 34 19
func()
in go/tools/builders/read.go
83 30 1
func run()
in go/tools/builders/protoc.go
135 29 1
func readGoInfo()
in go/tools/builders/read.go
84 28 2
func()
in go/tools/bzltestutil/test2json.go
88 27 1
func link()
in go/tools/builders/link.go
106 25 1
func buildEmbedcfgFile()
in go/tools/builders/embedcfg.go
59 21 4
func initRunfiles()
in go/tools/bazel/runfiles.go
88 21 0
func()
in go/tools/gopackagesdriver/packageregistry.go
45 19 1
func stdlib()
in go/tools/builders/stdlib.go
94 19 1
func checkAnalysisResults()
in go/tools/builders/nogo_main.go
71 19 2
func readMetadata()
in go/tools/builders/pack.go
62 18 2
func readFileInfo()
in go/tools/builders/filter.go
55 18 2