apple / swift-nio-http2
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 354 units with 4,087 lines of code in units (25.5% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (205 lines of code)
    • 9 medium complex units (527 lines of code)
    • 29 simple units (1,028 lines of code)
    • 314 very simple units (2,327 lines of code)
0% | 5% | 12% | 25% | 56%
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
swift0% | 5% | 13% | 25% | 55%
rb0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/NIOHTTP20% | 12% | 25% | 12% | 49%
Sources/NIOHTTP2/ConnectionStateMachine0% | 0% | 4% | 49% | 45%
Sources/NIOHTTP2/Frame Buffers0% | 0% | 10% | 24% | 64%
Sources/NIOHPACK0% | 0% | 0% | 18% | 81%
Sources/NIOHTTP2PerformanceTester0% | 0% | 0% | 0% | 100%
scripts0% | 0% | 0% | 0% | 100%
Sources/NIOHTTP2Server0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
init()
in Sources/NIOHTTP2/HTTP2ToHTTP1Codec.swift
72 34 1
mutating func encode()
in Sources/NIOHTTP2/HTTP2FrameParser.swift
133 27 2
mutating func sendHeaders()
in Sources/NIOHTTP2/StreamStateMachine.swift
94 20 4
mutating func receiveHeaders()
in Sources/NIOHTTP2/StreamStateMachine.swift
94 20 4
mutating func processOutboundFrame()
in Sources/NIOHTTP2/Frame Buffers/OutboundFrameBuffer.swift
45 15 3
mutating func sendSettings()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
61 13 1
mutating func processInboundData()
in Sources/NIOHTTP2/HTTP2ToHTTP1Codec.swift
45 12 1
mutating func receiveWindowUpdate()
in Sources/NIOHTTP2/StreamStateMachine.swift
42 12 1
mutating func sendData()
in Sources/NIOHTTP2/StreamStateMachine.swift
52 11 3
mutating func receiveData()
in Sources/NIOHTTP2/StreamStateMachine.swift
54 11 3
mutating func sendWindowUpdate()
in Sources/NIOHTTP2/StreamStateMachine.swift
40 11 1
mutating func receiveHeaders()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 3
mutating func sendHeaders()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 3
mutating func receiveData()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 4
mutating func sendData()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 4
mutating func receiveRstStream()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 2
mutating func sendRstStream()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
49 10 2
mutating func receivePushPromise()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
46 10 3
mutating func receiveGoaway()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
57 10 1
mutating func sendGoaway()
in Sources/NIOHTTP2/ConnectionStateMachine/ConnectionStateMachine.swift
57 10 1