microsoft / go-winio
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 526 units with 6,455 lines of code in units (79.5% of code).
    • 1 very complex units (111 lines of code)
    • 3 complex units (369 lines of code)
    • 19 medium complex units (996 lines of code)
    • 36 simple units (1,070 lines of code)
    • 467 very simple units (3,909 lines of code)
1% | 5% | 15% | 16% | 60%
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
go1% | 5% | 15% | 16% | 60%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
pkg/etw6% | 0% | 10% | 14% | 68%
backuptar0% | 66% | 0% | 23% | 9%
wim0% | 18% | 25% | 24% | 31%
wim/lzx0% | 0% | 52% | 27% | 20%
pkg/security0% | 0% | 23% | 13% | 63%
vhd0% | 0% | 20% | 8% | 71%
ROOT0% | 0% | 4% | 17% | 77%
pkg/guid0% | 0% | 23% | 12% | 64%
pkg/etwlogrus0% | 0% | 0% | 61% | 38%
pkg/process0% | 0% | 0% | 0% | 100%
wim/validate0% | 0% | 0% | 0% | 100%
tools/etw-provider-gen0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func SmartField()
in pkg/etw/fieldopt.go
111 51 2
142 41 5
119 28 3
func()
in wim/wim.go
108 28 1
func newFn()
in pkg/etw/mksyscall_windows.go
71 17 1
func newFn()
in pkg/security/mksyscall_windows.go
71 17 1
func newFn()
in vhd/mksyscall_windows.go
71 17 1
func()
in wim/lzx/lzx.go
59 17 1
func buildTable()
in wim/lzx/lzx.go
54 13 1
func()
in pkg/etw/mksyscall_windows.go
48 12 1
func()
in pkg/etw/mksyscall_windows.go
56 12 1
func()
in pkg/security/mksyscall_windows.go
48 12 1
func()
in pkg/security/mksyscall_windows.go
56 12 1
func()
in vhd/mksyscall_windows.go
48 12 1
func()
in vhd/mksyscall_windows.go
56 12 1
func()
in wim/lzx/lzx.go
52 12 1
func NewReader()
in wim/wim.go
45 12 1
func()
in wim/wim.go
52 12 1
func()
in backup.go
39 11 1
func()
in file.go
36 11 1