apple / swift-http-structured-headers
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 203 units with 1,360 lines of code in units (45.6% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (210 lines of code)
    • 7 medium size units (217 lines of code)
    • 16 small units (236 lines of code)
    • 177 very small units (697 lines of code)
0% | 15% | 15% | 17% | 51%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 15% | 15% | 17% | 51%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/StructuredFieldValues/Encoder0% | 24% | 14% | 3% | 57%
Sources/StructuredFieldValues/Decoder0% | 10% | 13% | 27% | 48%
Sources/sh-parser0% | 0% | 22% | 37% | 39%
Sources/RawStructuredFieldValues0% | 0% | 58% | 0% | 41%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func encode()
in Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
93 29 2
func innerElement()
in Sources/StructuredFieldValues/Decoder/StructuredFieldValueDecoder.swift
65 19 1
func append()
in Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
52 21 1
mutating func insert()
in Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
46 16 2
func decode()
in Sources/StructuredFieldValues/Decoder/BareItemDecoder.swift
38 17 1
func encode()
in Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
38 17 1
func main()
in Sources/sh-parser/main.swift
28 7 0
func validateStructuredHeaderKey()
in Sources/RawStructuredFieldValues/FieldSerializer.swift
23 4 0
mutating func decode()
in Sources/StructuredFieldValues/Decoder/BareInnerListDecoder.swift
22 3 1
mutating func decode()
in Sources/StructuredFieldValues/Decoder/TopLevelListDecoder.swift
22 3 1
mutating func appendBareItem()
in Sources/StructuredFieldValues/Encoder/StructuredFieldValueEncoder.swift
20 7 1
func prettyFormat()
in Sources/sh-parser/main.swift
18 8 0
func container()
in Sources/StructuredFieldValues/Decoder/StructuredFieldValueDecoder.swift
16 7 1
func decode()
in Sources/StructuredFieldValues/Decoder/DictionaryKeyedContainer.swift
15 3 2
func decode()
in Sources/StructuredFieldValues/Decoder/KeyedInnerListDecoder.swift
15 3 2
func decode()
in Sources/StructuredFieldValues/Decoder/KeyedItemDecoder.swift
15 3 2
func decode()
in Sources/StructuredFieldValues/Decoder/KeyedTopLevelListDecoder.swift
15 3 2
func decode()
in Sources/StructuredFieldValues/Decoder/ParametersDecoder.swift
15 3 2
init()
in Sources/sh-parser/main.swift
15 5 0
mutating func nestedContainer()
in Sources/StructuredFieldValues/Decoder/BareInnerListDecoder.swift
14 1 1