apple / swift-system
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 18 units with 97 lines of code in units (2.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 0 medium size units (0 lines of code)
    • 2 small units (24 lines of code)
    • 16 very small units (73 lines of code)
0% | 0% | 0% | 24% | 75%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 0% | 0% | 26% | 73%
py0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/System/FilePath0% | 0% | 0% | 28% | 71%
Utilities0% | 0% | 0% | 0% | 100%
Sources/System0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 18 longest units
Unit# linesMcCabe index# params
func parseUNC()
in Sources/System/FilePath/FilePathWindows.swift
13 1 1
mutating func eatSigil()
in Sources/System/FilePath/FilePathWindows.swift
11 2 0
func expectBackslash()
in Sources/System/FilePath/FilePathWindows.swift
9 2 0
mutating func eatDrive()
in Sources/System/FilePath/FilePathWindows.swift
8 2 0
def swift_sources_in()
in Utilities/expand-availability.py
8 4 1
mutating func eatComponent()
in Sources/System/FilePath/FilePathWindows.swift
6 1 0
init()
in Sources/System/FilePath/FilePathWindows.swift
6 1 3
mutating func _replaceAll()
in Sources/System/Util.swift
5 3 2
func expectComponent()
in Sources/System/FilePath/FilePathWindows.swift
4 1 0
func _invariantCheck()
in Sources/System/FilePath/FilePathComponents.swift
3 1 0
func _withPlatformString()
in Sources/System/FilePath/FilePathComponents.swift
3 1 1
init()
in Sources/System/FilePath/FilePathComponents.swift
3 1 1
init()
in Sources/System/FilePath/FilePathWindows.swift
3 1 1
mutating func eatBackslash()
in Sources/System/FilePath/FilePathWindows.swift
3 1 0
mutating func eatUNC()
in Sources/System/FilePath/FilePathWindows.swift
3 1 0
mutating func clear()
in Sources/System/FilePath/FilePathWindows.swift
3 1 0
mutating func reset()
in Sources/System/FilePath/FilePathWindows.swift
3 1 2
func formPath()
in Sources/System/FilePath/FilePathWindows.swift
3 1 0