golang / image
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 613 units with 17,541 lines of code in units (11.8% of code).
    • 1 very complex units (465 lines of code)
    • 29 complex units (3,510 lines of code)
    • 66 medium complex units (4,474 lines of code)
    • 135 simple units (5,054 lines of code)
    • 382 very simple units (4,038 lines of code)
2% | 20% | 25% | 28% | 23%
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% | 20% | 25% | 28% | 23%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
draw6% | 29% | 24% | 29% | 10%
tiff0% | 47% | 14% | 12% | 26%
font0% | 10% | 27% | 33% | 27%
vp8l0% | 14% | 43% | 26% | 15%
webp0% | 54% | 20% | 17% | 6%
bmp0% | 18% | 24% | 44% | 11%
vp80% | 0% | 24% | 25% | 50%
ccitt0% | 0% | 29% | 21% | 49%
vector0% | 0% | 28% | 22% | 49%
riff0% | 0% | 48% | 36% | 14%
cmd0% | 0% | 29% | 46% | 23%
colornames0% | 0% | 20% | 19% | 59%
math0% | 0% | 0% | 33% | 66%
example0% | 0% | 0% | 90% | 9%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func expnDollar()
in draw/gen.go
465 83 4
func()
in tiff/reader.go
180 48 1
func()
in font/sfnt/postscript.go
145 40 1
func Decode()
in tiff/reader.go
127 36 1
func()
in font/sfnt/sfnt.go
90 35 1
func()
in draw/impl.go
92 33 1
func()
in draw/impl.go
92 33 1
func()
in draw/impl.go
83 33 1
func()
in font/sfnt/gpos.go
110 32 1
func()
in draw/impl.go
160 32 1
func()
in draw/impl.go
160 32 1
func()
in draw/impl.go
160 32 1
func()
in draw/impl.go
160 32 1
func()
in draw/impl.go
94 32 1
func()
in vp8l/decode.go
120 32 1
func()
in draw/impl.go
156 31 1
func()
in draw/impl.go
156 31 1
func()
in draw/impl.go
156 31 1
func()
in draw/impl.go
156 31 1
func newDecoder()
in tiff/reader.go
120 31 1