GerritCodeReview / zoekt
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 454 units with 8,109 lines of code in units (80.3% of code).
    • 0 very complex units (0 lines of code)
    • 8 complex units (904 lines of code)
    • 31 medium complex units (2,005 lines of code)
    • 64 simple units (1,946 lines of code)
    • 351 very simple units (3,254 lines of code)
0% | 11% | 24% | 23% | 40%
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
go0% | 11% | 24% | 23% | 40%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 12% | 17% | 15% | 54%
cmd/zoekt-repo-index0% | 51% | 0% | 47% | 1%
gitindex0% | 17% | 14% | 34% | 33%
cmd/zoekt-mirror-github0% | 48% | 0% | 10% | 41%
cmd/zoekt-indexserver0% | 26% | 0% | 30% | 43%
query0% | 14% | 23% | 25% | 36%
web0% | 0% | 53% | 18% | 28%
shards0% | 0% | 58% | 0% | 41%
cmd/zoekt-archive-index0% | 0% | 37% | 32% | 30%
build0% | 0% | 18% | 52% | 28%
cmd/zoekt-mirror-bitbucket-server0% | 0% | 48% | 13% | 37%
cmd/zoekt-webserver0% | 0% | 52% | 0% | 47%
cmd/zoekt-mirror-gerrit0% | 0% | 77% | 0% | 22%
cmd/zoekt-test0% | 0% | 64% | 0% | 35%
cmd/zoekt-mirror-gitlab0% | 0% | 64% | 0% | 35%
cmd/zoekt0% | 0% | 63% | 22% | 13%
cmd/zoekt-mirror-gitiles0% | 0% | 34% | 46% | 18%
cmd/zoekt-index0% | 0% | 0% | 82% | 17%
ctags0% | 0% | 0% | 35% | 64%
cmd/zoekt-git-index0% | 0% | 0% | 100% | 0%
cmd/zoekt-hg-index0% | 0% | 0% | 67% | 32%
cmd/zoekt-git-clone0% | 0% | 0% | 100% | 0%
cmd0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func executeMirror()
in cmd/zoekt-indexserver/config.go
104 35 3
func()
in eval.go
165 34 1
func IndexGitRepo()
in gitindex/index.go
123 30 1
func parseExpr()
in query/parse.go
87 30 1
func main()
in cmd/zoekt-mirror-github/main.go
117 27 0
func main()
in cmd/zoekt-repo-index/main.go
133 27 0
func()
in matchtree.go
104 26 1
func()
in eval.go
71 26 1
func compare()
in cmd/zoekt-test/main.go
87 23 3
func()
in web/snippets.go
109 22 1
func()
in read.go
103 22 1
func main()
in cmd/zoekt-mirror-gerrit/main.go
91 21 0
func main()
in cmd/zoekt-webserver/main.go
94 21 0
func main()
in cmd/zoekt-mirror-bitbucket-server/main.go
95 21 0
func()
in shards/shards.go
99 20 1
func do()
in cmd/zoekt-archive-index/main.go
66 18 2
func setTemplatesFromConfig()
in gitindex/index.go
59 18 2
func()
in matchtree.go
68 18 1
func()
in indexbuilder.go
71 18 1
func()
in shards/watcher.go
59 17 1