apple / swift-nio
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 713 units with 7,164 lines of code in units (21.1% of code).
    • 2 very complex units (1,427 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (306 lines of code)
    • 17 simple units (539 lines of code)
    • 688 very simple units (4,892 lines of code)
19% | 0% | 4% | 7% | 68%
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
c90% | 0% | 0% | 3% | 6%
swift4% | 0% | 5% | 8% | 81%
py0% | 0% | 0% | 29% | 70%
rb0% | 0% | 0% | 0% | 100%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Sources/CNIOHTTPParser99% | 0% | 0% | 0% | <1%
Sources/NIOHTTP134% | 0% | 3% | 16% | 46%
Sources/NIOPosix0% | 0% | 6% | 10% | 82%
Sources/NIOWebSocket0% | 0% | 38% | 11% | 50%
Sources/NIOCrashTester0% | 0% | 25% | 0% | 74%
Sources/NIOHTTP1Server0% | 0% | 13% | 16% | 70%
Sources/NIOPerformanceTester0% | 0% | 0% | 5% | 94%
Sources/NIOCore0% | 0% | 0% | 1% | 98%
Sources/CNIOLinux0% | 0% | 0% | 29% | 70%
Sources/_NIODataStructures0% | 0% | 0% | 22% | 77%
Sources/CNIODarwin0% | 0% | 0% | 65% | 34%
dev0% | 0% | 0% | 29% | 70%
scripts0% | 0% | 0% | 0% | 100%
Sources/NIOEmbedded0% | 0% | 0% | 0% | 100%
Sources/CNIOWindows0% | 0% | 0% | 0% | 100%
Sources/NIOAsyncAwaitDemo0% | 0% | 0% | 0% | 100%
Sources/NIOWebSocketServer0% | 0% | 0% | 0% | 100%
Sources/NIOTLS0% | 0% | 0% | 0% | 100%
Sources/NIOMulticastChat0% | 0% | 0% | 0% | 100%
Sources/NIOUDPEchoClient0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
size_t c_nio_http_parser_execute()
in Sources/CNIOHTTPParser/c_nio_http_parser.c
1174 354 4
mutating func write()
in Sources/NIOHTTP1/HTTPEncoder.swift
253 121 1
func whenReady0()
in Sources/NIOPosix/SelectorUring.swift
94 17 2
func main()
in Sources/NIOCrashTester/main.swift
51 16 0
func flushNow()
in Sources/NIOPosix/BaseSocketChannel.swift
44 15 0
func isKeepAlive()
in Sources/NIOHTTP1/HTTPTypes.swift
25 13 1
mutating func parseStep()
in Sources/NIOWebSocket/WebSocketFrameDecoder.swift
61 13 1
func dynamicHandler()
in Sources/NIOHTTP1Server/main.swift
31 11 1
int CNIOLinux_pthread_getname_np()
in Sources/CNIOLinux/shim.c
23 10 3
func whenReady0()
in Sources/NIOPosix/SelectorEpoll.swift
52 10 2
def put_in_dict()
in dev/stackdiff-dtrace.py
16 10 1
func setOption0()
in Sources/NIOPosix/BaseSocketChannel.swift
29 9 2
func _read()
in Sources/NIOPosix/NonBlockingFileIO.swift
36 9 2
func whenReady0()
in Sources/NIOPosix/SelectorKqueue.swift
49 9 2
func didFinishHead()
in Sources/NIOHTTP1/HTTPDecoder.swift
54 8 6
func channelRead()
in Sources/NIOHTTP1Server/main.swift
38 8 2
func validateState()
in Sources/NIOWebSocket/WebSocketFrameDecoder.swift
18 8 1
int CNIODarwin_sendmmsg()
in Sources/CNIODarwin/shim.c
17 7 4
mutating func startProcessing()
in Sources/NIOCore/Codec.swift
23 7 1
init()
in Sources/NIOHTTP1/HTTPDecoder.swift
65 6 1