bazelbuild / bazel-gazelle
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 501 units with 9,135 lines of code in units (46.6% of code).
    • 1 very complex units (223 lines of code)
    • 8 complex units (861 lines of code)
    • 56 medium complex units (2,666 lines of code)
    • 97 simple units (2,504 lines of code)
    • 339 very simple units (2,881 lines of code)
2% | 9% | 29% | 27% | 31%
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
go2% | 9% | 29% | 27% | 31%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
language6% | 10% | 29% | 27% | 26%
cmd0% | 21% | 27% | 27% | 23%
internal0% | 36% | 0% | 11% | 51%
rule0% | 0% | 31% | 28% | 40%
merger0% | 0% | 63% | 30% | 5%
repo0% | 0% | 17% | 31% | 50%
walk0% | 0% | 34% | 34% | 30%
label0% | 0% | 47% | 0% | 52%
config0% | 0% | 36% | 27% | 35%
testtools0% | 0% | 42% | 57% | 0%
pathtools0% | 0% | 51% | 17% | 31%
resolve0% | 0% | 0% | 18% | 81%
flag0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in language/go/generate.go
223 63 1
func updateRepos()
in cmd/gazelle/update-repos.go
164 45 2
func()
in language/go/config.go
133 43 1
func runFixUpdate()
in cmd/gazelle/fix-update.go
139 31 3
func migrateNamingConvention()
in language/go/fix.go
64 31 2
func()
in cmd/gazelle/fix-update.go
96 30 1
func main()
in internal/list_repository_tools_srcs.go
68 26 0
func importReposFromModules()
in language/go/modules.go
109 26 1
func goFileInfo()
in language/go/fileinfo.go
88 26 2
func getPlatformStringsAddFunction()
in language/go/package.go
60 24 3
func MapExprStrings()
in rule/expr.go
73 23 2
70 23 1
func detectNamingConvention()
in language/go/config.go
63 20 2
func fetchModule()
in cmd/fetch_repo/module.go
71 19 4
func FixLoads()
in merger/fix.go
66 18 2
func watchDir()
in cmd/autogazelle/server_unix.go
56 18 2
func mergeDict()
in rule/merge.go
64 18 2
func resolveWithIndexGo()
in language/go/resolve.go
43 18 4
func fileNameInfo()
in language/go/fileinfo.go
47 18 1
func()
in language/go/package.go
47 18 1