apple / swift-stress-tester
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 119 units with 1,200 lines of code in units (18.3% of code).
    • 0 very long units (0 lines of code)
    • 3 long units (229 lines of code)
    • 9 medium size units (239 lines of code)
    • 17 small units (258 lines of code)
    • 90 very small units (474 lines of code)
0% | 19% | 19% | 21% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift0% | 16% | 21% | 21% | 39%
py0% | 29% | 11% | 19% | 39%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
SourceKitStressTester/Sources/SwiftCWrapper0% | 60% | 12% | 3% | 22%
ROOT0% | 32% | 12% | 20% | 34%
SwiftEvolve/Sources/SwiftEvolve0% | 0% | 21% | 23% | 55%
SourceKitStressTester/Sources/StressTester0% | 0% | 27% | 37% | 35%
SourceKitStressTester0% | 0% | 100% | 0% | 0%
SourceKitStressTester/Sources/Common0% | 0% | 0% | 57% | 42%
SourceKitStressTester/Utilities0% | 0% | 0% | 0% | 100%
SourceKitStressTester/Sources/SwiftSourceKit0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func run()
in SourceKitStressTester/Sources/SwiftCWrapper/SwiftCWrapper.swift
94 18 0
init()
in SourceKitStressTester/Sources/SwiftCWrapper/ExpectedIssue.swift
73 18 3
def run()
in build-script-helper.py
62 8 1
func enabledFor()
in SourceKitStressTester/Sources/SwiftCWrapper/ExpectedIssue.swift
36 18 1
func cursorInfo()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
30 5 1
func evolve()
in SwiftEvolve/Sources/SwiftEvolve/SwiftEvolveTool.swift
29 3 2
func mapToCodeBlock()
in SwiftEvolve/Sources/SwiftEvolve/SyntaxConstructionExtensions.swift
28 1 1
func write()
in SwiftEvolve/Sources/SwiftEvolve/SyntaxDump.swift
25 4 3
func codeComplete()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
24 2 2
def parse_args()
in build-script-helper.py
24 5 1
func rangeInfo()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
22 3 2
func getConfigParam()
in SourceKitStressTester/Package.swift
21 4 1
func semanticRefactoring()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
20 2 4
func moduleInterfaceGen()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
20 1 0
func mapToFunctionParameterClause()
in SwiftEvolve/Sources/SwiftEvolve/SyntaxConstructionExtensions.swift
20 1 3
func plan()
in SwiftEvolve/Sources/SwiftEvolve/SwiftEvolveTool.swift
19 3 2
func format()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
18 1 1
def install_package()
in build-script-helper.py
18 6 6
func conformingMethodList()
in SourceKitStressTester/Sources/StressTester/SourceKitDocument.swift
17 3 2
init()
in SwiftEvolve/Sources/SwiftEvolve/CommandLine.swift
16 1 0