golang / mobile
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,441 units with 23,896 lines of code in units (67.1% of code).
    • 7 very complex units (3,177 lines of code)
    • 13 complex units (1,485 lines of code)
    • 86 medium complex units (4,678 lines of code)
    • 122 simple units (3,445 lines of code)
    • 1,213 very simple units (11,111 lines of code)
13% | 6% | 19% | 14% | 46%
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
go12% | 6% | 21% | 14% | 44%
c79% | 0% | 0% | 0% | 20%
java0% | 0% | 0% | 13% | 86%
m0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
gl30% | 2% | 1% | 1% | 64%
app35% | 0% | 13% | 16% | 35%
internal11% | 9% | 29% | 21% | 28%
cmd7% | 13% | 36% | 19% | 22%
bind0% | 9% | 33% | 22% | 34%
exp0% | 0% | 2% | 7% | 89%
example0% | 0% | 5% | 24% | 69%
event0% | 0% | 23% | 0% | 76%
asset0% | 0% | 0% | 0% | 100%
geom0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in gl/gldebug.go
1188 592 1
func convAndroidKeyCode()
in app/android.go
315 212 1
519 161 2
func fixFloat()
in gl/work_windows.go
297 145 4
func convVirtualKeyCode()
in app/darwin_desktop.go
228 112 1
func UnmarshalXML()
in internal/binres/binres.go
402 89 2
func goAndroidBuild()
in cmd/gomobile/build_androidapp.go
228 56 2
func goAppleBind()
in cmd/gomobile/bind_iosapp.go
185 35 3
func main()
in gl/gendebug.go
144 35 0
func()
in internal/importers/java/java.go
112 33 1
func()
in bind/genjava.go
127 32 1
func()
in internal/importers/java/java.go
118 32 1
func buildAAR()
in cmd/gomobile/bind_androidapp.go
122 30 4
func()
in internal/importers/java/java.go
95 30 1
func()
in bind/genobjcw.go
104 29 1
func()
in bind/genobjc.go
96 28 1
func()
in bind/genjava.go
105 28 1
func goAppleBuild()
in cmd/gomobile/build_apple.go
114 27 3
func()
in bind/genobjc.go
77 27 1
func()
in bind/genclasses.go
86 27 1