golang / exp
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,031 units with 28,215 lines of code in units (57.6% of code).
    • 5 very complex units (1,194 lines of code)
    • 22 complex units (1,939 lines of code)
    • 97 medium complex units (4,944 lines of code)
    • 253 simple units (6,768 lines of code)
    • 1,654 very simple units (13,370 lines of code)
4% | 6% | 17% | 23% | 47%
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% | 7% | 17% | 24% | 46%
c0% | 3% | 22% | 18% | 55%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
shiny8% | 6% | 16% | 18% | 50%
errors6% | 20% | 12% | 24% | 35%
cmd0% | 19% | 30% | 27% | 22%
winfsnotify0% | 26% | 0% | 26% | 46%
apidiff0% | 14% | 6% | 24% | 54%
shootout0% | 2% | 16% | 24% | 55%
event0% | 3% | 10% | 20% | 65%
sumdb0% | 0% | 34% | 31% | 34%
vulncheck0% | 0% | 20% | 47% | 31%
vulndb0% | 0% | 19% | 40% | 40%
slices0% | 0% | 37% | 15% | 46%
utf8string0% | 0% | 53% | 23% | 23%
jsonrpc20% | 0% | 5% | 31% | 62%
ebnf0% | 0% | 15% | 22% | 62%
io0% | 0% | 13% | 10% | 76%
mmap0% | 0% | 0% | 48% | 51%
ebnflint0% | 0% | 0% | 62% | 37%
rand0% | 0% | 0% | 9% | 90%
internal0% | 0% | 0% | 6% | 93%
maps0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func convVirtualKeyCode()
in shiny/driver/internal/win32/key.go
291 171 1
func cocoaKeyCode()
in shiny/driver/gldriver/cocoa.go
228 112 1
func()
in shiny/widget/flex/flex.go
322 104 1
func decodeDrawing()
in shiny/iconvg/decode.go
193 65 3
func()
in errors/fmt/print.go
160 52 1
func()
in apidiff/correspondence.go
90 43 1
func()
in errors/fmt/print.go
143 42 1
func()
in shiny/driver/x11driver/screen.go
110 36 1
func()
in errors/fmt/scan.go
95 34 1
func prepareLoadDir()
in cmd/gorelease/gorelease.go
124 34 6
func upgradeDrawing()
in shiny/iconvg/upgrade.go
142 33 3
func genPathData()
in shiny/materialdesign/icons/gen.go
85 33 5
func()
in errors/fmt/format.go
93 31 1
func loadLocalModule()
in cmd/gorelease/gorelease.go
109 31 4
func decodeMetadataChunk()
in shiny/iconvg/decode.go
83 31 4
func upgradeStyling()
in shiny/iconvg/upgrade.go
109 30 3
func runRelease()
in cmd/gorelease/gorelease.go
80 29 4
char out_of_bounds()
in shootout/meteor-contest.c
35 29 2
func out_of_bounds()
in shootout/meteor-contest.go
33 29 2
func()
in winfsnotify/winfsnotify.go
109 29 1