golang / snappy
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 30 units with 616 lines of code in units (21.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (99 lines of code)
    • 3 medium complex units (202 lines of code)
    • 3 simple units (94 lines of code)
    • 23 very simple units (221 lines of code)
0% | 16% | 32% | 15% | 35%
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
go0% | 17% | 26% | 16% | 39%
cpp0% | 0% | 100% | 0% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT0% | 18% | 28% | 17% | 36%
misc0% | 0% | 100% | 0% | 0%
cmd/snappytool0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func()
in decode.go
99 26 1
func decode()
in decode_other.go
88 25 2
func encodeBlock()
in encode_other.go
63 13 2
int main()
in misc/main.cpp
51 12 2
func()
in encode.go
49 9 1
func Encode()
in encode.go
21 6 2
func()
in encode.go
24 6 1
func run()
in cmd/snappytool/main.go
21 5 0
func emitCopy()
in encode_other.go
26 5 3
func Decode()
in decode.go
18 5 2
func()
in decode.go
9 5 1
func decodedLen()
in decode.go
11 4 1
func emitLiteral()
in encode_other.go
18 3 2
func extendMatch()
in encode_other.go
5 3 3
11 3 1
func()
in encode.go
11 3 1
func()
in decode.go
11 3 1
func()
in decode.go
11 3 1
func main()
in cmd/snappytool/main.go
6 2 0
func()
in encode.go
8 2 1