apple / swift-nio-examples
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 103 units with 1,198 lines of code in units (33.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 5 medium complex units (254 lines of code)
    • 6 simple units (180 lines of code)
    • 92 very simple units (764 lines of code)
0% | 0% | 21% | 15% | 63%
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% | 0% | 21% | 15% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
NIOSMTP/NIOSMTP0% | 0% | 36% | 13% | 49%
json-rpc/Sources0% | 0% | 20% | 24% | 54%
backpressure-file-io-channel/Sources0% | 0% | 50% | 0% | 49%
connect-proxy/Sources0% | 0% | 31% | 0% | 68%
TLSify/Sources0% | 0% | 0% | 32% | 68%
http2-client/Sources0% | 0% | 0% | 0% | 100%
nio-launchd/Sources0% | 0% | 0% | 0% | 100%
UniversalBootstrapDemo/Sources0% | 0% | 0% | 0% | 100%
http2-server/Sources0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
func show()
in json-rpc/Sources/LightsdDemo/main.swift
78 23 1
func channelRead()
in NIOSMTP/NIOSMTP/SendEmailHandler.swift
68 21 2
func encode()
in NIOSMTP/NIOSMTP/SMTPRequestEncoder.swift
37 11 2
func runAction()
in backpressure-file-io-channel/Sources/BackpressureChannelToFileIO/SaveEverythingHTTPServer.swift
44 11 2
func channelRead()
in connect-proxy/Sources/ConnectProxy/ConnectHandler.swift
27 11 2
init()
in json-rpc/Sources/LightsdDemo/main.swift
22 9 1
func configureBootstrap()
in NIOSMTP/NIOSMTP/ViewController.swift
39 8 4
init()
in json-rpc/Sources/JsonRpc/Model.swift
18 8 1
func encode()
in json-rpc/Sources/JsonRpc/Model.swift
19 8 1
func connected()
in TLSify/Sources/TLSifyLib/TLSProxy.swift
48 7 3
init()
in json-rpc/Sources/JsonRpc/Model.swift
34 7 1
func sendAuthenticationStart()
in NIOSMTP/NIOSMTP/SendEmailHandler.swift
16 5 1
func userInboundEventTriggered()
in http2-client/Sources/http2-client/main.swift
9 5 2
init()
in json-rpc/Sources/JsonRpc/Model.swift
12 5 1
func channelRead()
in NIOSMTP/NIOSMTP/SMTPResponseDecoder.swift
20 4 2
func run()
in TLSify/Sources/TLSify/main.swift
34 4 0
func channelRead()
in UniversalBootstrapDemo/Sources/UniversalBootstrapDemo/ExampleHTTPLibrary.swift
12 4 2
func run()
in UniversalBootstrapDemo/Sources/UniversalBootstrapDemo/main.swift
28 4 0
func removeHandler()
in connect-proxy/Sources/ConnectProxy/ConnectHandler.swift
15 4 2
func addFramingHandlers()
in json-rpc/Sources/JsonRpc/Codec.swift
16 4 1