bazelbuild / buildtools
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 1,099 units with 14,715 lines of code in units (62.1% of code).
    • 5 very complex units (2,112 lines of code)
    • 10 complex units (1,053 lines of code)
    • 44 medium complex units (2,194 lines of code)
    • 121 simple units (3,076 lines of code)
    • 919 very simple units (6,280 lines of code)
14% | 7% | 14% | 20% | 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
go14% | 7% | 14% | 20% | 42%
js0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
py0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
build42% | 11% | 6% | 12% | 27%
build_proto17% | 0% | 0% | 0% | 82%
edit0% | 9% | 7% | 39% | 44%
warn0% | 6% | 35% | 36% | 21%
extra_actions_base_proto0% | 22% | 0% | 0% | 77%
convertast0% | 0% | 73% | 0% | 26%
buildifier0% | 0% | 31% | 36% | 31%
unused_deps0% | 0% | 33% | 30% | 35%
api_proto0% | 0% | 29% | 0% | 70%
deps_proto0% | 0% | 26% | 0% | 73%
differ0% | 0% | 46% | 0% | 53%
wspace0% | 0% | 13% | 50% | 36%
bzlenv0% | 0% | 0% | 62% | 37%
buildozer0% | 0% | 0% | 54% | 45%
tables0% | 0% | 0% | 43% | 56%
labels0% | 0% | 0% | 38% | 61%
ROOT0% | 0% | 0% | 0% | 100%
testutils0% | 0% | 0% | 0% | 100%
generatetables0% | 0% | 0% | 0% | 100%
file0% | 0% | 0% | 0% | 100%
buildifier20% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in build/parse.y.go
1068 181 1
func file_build_proto_build_proto_init()
in build_proto/build.gen.pb.go
386 93 0
func()
in build/lex.go
236 86 1
func()
in build/print.go
288 75 1
func()
in build/lex.go
134 53 1
func WalkOnce()
in build/walk.go
117 44 2
func detectTypes()
in warn/types.go
105 41 1
func file_extra_actions_base_proto_extra_actions_base_proto_init()
in extra_actions_base_proto/extra_actions_base.gen.pb.go
172 40 0
func fixLabels()
in build/rewrite.go
107 39 1
func findUninitializedVariables()
in warn/warn_control_flow.go
90 32 3
func fixMultilinePlus()
in build/rewrite.go
96 31 1
func Buildozer()
in edit/buildozer.go
96 31 2
func rewrite()
in edit/buildozer.go
115 30 2
func Unquote()
in build/quote.go
94 29 1
func sortStringLists()
in build/rewrite.go
61 27 1
func convExpr()
in convertast/convert_ast.go
118 24 1
func processFile()
in buildifier/buildifier.go
79 23 7
func()
in build/print.go
44 22 1
func yyErrorMessage()
in build/parse.y.go
50 20 2
func ctxActionsWarning()
in warn/warn_bazel_api.go
73 18 1