apple / swift-nio-transport-services
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 29 units with 337 lines of code in units (15.2% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (63 lines of code)
    • 2 medium size units (60 lines of code)
    • 7 small units (94 lines of code)
    • 19 very small units (120 lines of code)
0% | 18% | 17% | 27% | 35%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 18% | 17% | 27% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/NIOTransportServices0% | 20% | 19% | 26% | 33%
Sources/NIOTSHTTPClient0% | 0% | 0% | 60% | 40%
Sources/NIOTSHTTPServer0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func getOption0()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
63 17 1
func applyChannelOption()
in Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift
30 13 2
func valueFor()
in Sources/NIOTransportServices/TCPOptions+SocketChannelOption.swift
30 19 1
func fireThroughPipeline()
in Sources/NIOTransportServices/NIOTSListenerBootstrap.swift
17 1 1
func channelRead()
in Sources/NIOTransportServices/NIOTSListenerBootstrap.swift
15 2 2
mutating func newPort()
in Sources/NIOTransportServices/SocketAddress+NWEndpoint.swift
14 4 1
func channelRead()
in Sources/NIOTSHTTPClient/main.swift
12 4 2
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 5 1
func completionCallback()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 3 2
mutating func closeOutput()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
12 5 0
func channelRead()
in Sources/NIOTSHTTPServer/main.swift
10 2 2
mutating func closeInput()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
10 4 0
func completionCallback()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
9 2 1
func beginActivating0()
in Sources/NIOTransportServices/StateManagedChannel.swift
9 1 2
func channelActive()
in Sources/NIOTSHTTPClient/main.swift
8 1 1
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
8 3 1
mutating func writabilityChanges()
in Sources/NIOTransportServices/NIOTSConnectionChannel.swift
8 3 1
func becomeActive0()
in Sources/NIOTransportServices/StateManagedChannel.swift
8 1 1
func alreadyConfigured0()
in Sources/NIOTransportServices/StateManagedChannel.swift
7 1 1
func setupChildChannel()
in Sources/NIOTransportServices/NIOTSListenerBootstrap.swift
6 1 0