microsoft / hcsshim
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 3,903 units with 63,057 lines of code in units (79.7% of code).
    • 16 very complex units (4,223 lines of code)
    • 70 complex units (8,903 lines of code)
    • 167 medium complex units (10,457 lines of code)
    • 315 simple units (9,816 lines of code)
    • 3,335 very simple units (29,658 lines of code)
6% | 14% | 16% | 15% | 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
go6% | 14% | 16% | 15% | 47%
c0% | 0% | 41% | 29% | 29%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
internal4% | 13% | 16% | 17% | 47%
cmd15% | 15% | 15% | 15% | 37%
pkg9% | 19% | 17% | 9% | 43%
ext40% | 17% | 25% | 23% | 34%
ROOT0% | 0% | 15% | 11% | 72%
computestorage0% | 0% | 20% | 5% | 73%
init0% | 0% | 32% | 39% | 28%
vsockexec0% | 0% | 66% | 0% | 33%
hcn0% | 0% | 1% | 16% | 82%
osversion0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go
617 176 1
func()
in internal/vmservice/vmservice.pb.go
430 122 1
func()
in internal/vmservice/vmservice.pb.go
317 89 1
func()
in cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go
264 77 1
func()
in pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go
272 77 1
func()
in pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go
267 74 1
func()
in cmd/containerd-shim-runhcs-v1/stats/stats.pb.go
246 72 1
func()
in internal/vmservice/vmservice.pb.go
229 67 1
func()
in internal/shimdiag/shimdiag.pb.go
233 64 1
func()
in pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go
219 61 1
func()
in internal/vmservice/vmservice.pb.go
213 58 1
func()
in cmd/containerd-shim-runhcs-v1/stats/stats.pb.go
189 55 1
func createContainer()
in cmd/runhcs/container.go
168 53 1
func()
in internal/vmservice/vmservice.pb.go
189 53 1
func()
in pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go
185 51 1
func()
in pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go
185 51 1
func()
in pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go
183 50 1
func()
in pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go
181 49 1
func()
in internal/computeagent/computeagent.pb.go
168 46 1
func()
in internal/vmservice/vmservice.pb.go
162 46 1