golang / protobuf
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,387 units with 9,959 lines of code in units (73.0% of code).
    • 1 very complex units (228 lines of code)
    • 5 complex units (610 lines of code)
    • 35 medium complex units (2,007 lines of code)
    • 42 simple units (1,303 lines of code)
    • 1,304 very simple units (5,811 lines of code)
2% | 6% | 20% | 13% | 58%
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% | 6% | 20% | 13% | 58%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
jsonpb26% | 17% | 30% | 11% | 14%
protoc-gen-go/generator0% | 16% | 27% | 20% | 36%
proto0% | 7% | 39% | 19% | 33%
internal/gengogrpc0% | 0% | 59% | 26% | 13%
protoc-gen-go/grpc0% | 0% | 50% | 29% | 20%
internal/cmd0% | 0% | 0% | 94% | 5%
descriptor0% | 0% | 0% | 51% | 48%
protoc-gen-go0% | 0% | 0% | 100% | 0%
ptypes0% | 0% | 0% | 18% | 81%
internal/testprotos0% | 0% | 0% | 0% | 100%
protoc-gen-go/descriptor0% | 0% | 0% | 0% | 100%
protoc-gen-go/plugin0% | 0% | 0% | 0% | 100%
ptypes/wrappers0% | 0% | 0% | 0% | 100%
ptypes/any0% | 0% | 0% | 0% | 100%
ptypes/empty0% | 0% | 0% | 0% | 100%
ptypes/timestamp0% | 0% | 0% | 0% | 100%
ptypes/duration0% | 0% | 0% | 0% | 100%
ptypes/struct0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in jsonpb/decode.go
228 70 1
func()
in jsonpb/encode.go
152 41 1
func()
in protoc-gen-go/generator/generator.go
98 39 1
func()
in proto/text_decode.go
91 38 1
func()
in protoc-gen-go/generator/generator.go
204 32 1
func()
in proto/text_decode.go
65 28 1
func()
in protoc-gen-go/generator/generator.go
55 25 1
func()
in proto/text_decode.go
98 25 1
func()
in protoc-gen-go/grpc/grpc.go
120 24 1
func genService()
in internal/gengogrpc/grpc.go
122 24 4
func unescape()
in proto/text_decode.go
65 24 1
func()
in proto/text_decode.go
77 23 1
func()
in proto/text_encode.go
88 23 1
func()
in protoc-gen-go/generator/generator.go
69 22 1
func()
in proto/properties.go
52 22 1
func()
in protoc-gen-go/generator/generator.go
52 18 1
func()
in jsonpb/encode.go
86 18 1
func newProperties()
in proto/properties.go
61 18 1
func()
in protoc-gen-go/generator/generator.go
83 17 1
func()
in proto/text_encode.go
60 17 1