apple / swift-nio-extras
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 104 units with 980 lines of code in units (26.4% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (52 lines of code)
    • 4 medium size units (110 lines of code)
    • 30 small units (446 lines of code)
    • 69 very small units (372 lines of code)
0% | 5% | 11% | 45% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 5% | 11% | 46% | 37%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/NIOExtras0% | 23% | 0% | 44% | 31%
Sources/NIOExtrasPerformanceTester0% | 0% | 27% | 19% | 52%
Sources/HTTPServerWithQuiescingDemo0% | 0% | 90% | 0% | 9%
Sources/NIOSOCKS0% | 0% | 7% | 80% | 12%
Sources/NIOHTTPCompression0% | 0% | 0% | 44% | 55%
Sources/NIOWritePartialPCAPDemo0% | 0% | 0% | 0% | 100%
Sources/NIOWritePCAPDemo0% | 0% | 0% | 0% | 100%
Sources/CNIOExtrasZlib0% | 0% | 0% | 0% | 100%
Sources/NIOSOCKSClient0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
mutating func writePCAPRecord()
in Sources/NIOExtras/WritePCAPHandler.swift
52 3 1
func run()
in Sources/NIOExtrasPerformanceTester/HTTP1PerformanceTestFramework.swift
38 4 0
func channelRead()
in Sources/HTTPServerWithQuiescingDemo/main.swift
29 4 2
func run()
in Sources/NIOExtrasPerformanceTester/PCAPPerformanceTest.swift
22 2 0
mutating func receiveBuffer()
in Sources/NIOSOCKS/State/ClientStateMachine.swift
21 5 1
mutating func get24UInt()
in Sources/NIOExtras/LengthFieldBasedFrameDecoder.swift
20 3 2
func emitWrites()
in Sources/NIOExtras/WritePCAPHandler.swift
20 3 0
mutating func sendAuthenticationMethod()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
20 4 1
mutating func sendAuthenticationData()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
20 5 2
mutating func sendServerResponse()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
19 4 1
mutating func oneShotDeflate()
in Sources/NIOHTTPCompression/HTTPCompression.swift
18 2 3
mutating func flush()
in Sources/NIOHTTPCompression/HTTPResponseCompressor.swift
18 6 2
mutating func inflatePart()
in Sources/NIOHTTPCompression/HTTPDecompression.swift
17 1 2
mutating func readAddressType()
in Sources/NIOSOCKS/Messages/SOCKSRequest.swift
17 4 0
mutating func receiveBuffer()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
17 6 1
func initiateShutdown()
in Sources/NIOExtras/QuiescingHelper.swift
16 3 1
func run()
in Sources/NIOExtrasPerformanceTester/RollingPCAPPerformanceTest.swift
16 2 0
mutating func initialize()
in Sources/NIOHTTPCompression/HTTPCompression.swift
16 3 1
func channelRead()
in Sources/NIOExtras/QuiescingHelper.swift
15 3 2
mutating func connectionEstablished()
in Sources/NIOSOCKS/State/ServerStateMachine.swift
15 3 0