apple / swift-tools-support-async
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 65 units with 988 lines of code in units (17.7% of code).
    • 2 very long units (288 lines of code)
    • 2 long units (144 lines of code)
    • 6 medium size units (178 lines of code)
    • 10 small units (158 lines of code)
    • 45 very small units (220 lines of code)
29% | 14% | 18% | 15% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift29% | 14% | 18% | 15% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/TSFCASFileTree46% | 11% | 13% | 15% | 12%
Sources/TSFCASFileTree/Internal0% | 42% | 54% | 0% | 2%
Sources/TSFCAS/Implementations0% | 0% | 0% | 89% | 10%
Sources/TSFFutures0% | 0% | 0% | 54% | 45%
Sources/TSFCAS0% | 0% | 0% | 0% | 100%
Sources/TSFCASUtilities0% | 0% | 0% | 0% | 100%
Sources/TSFUtility0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func run()
in Sources/TSFCASFileTree/FileTreeImport.swift
167 19 1
func assemblePartialNextSteps()
in Sources/TSFCASFileTree/FileTreeImport.swift
121 17 0
func makeNextStep()
in Sources/TSFCASFileTree/FileTreeImport.swift
73 13 3
func fetchSegment()
in Sources/TSFCASFileTree/Internal/FileSegmenter.swift
71 15 1
init()
in Sources/TSFCASFileTree/Internal/FileSegmenter.swift
38 3 5
func describeAllSegments()
in Sources/TSFCASFileTree/FileTreeImport.swift
37 8 2
func parseDirectory()
in Sources/TSFCASFileTree/Internal/FileTreeParser.swift
27 6 3
func children()
in Sources/TSFCASFileTree/FileTreeExport.swift
26 2 2
func grabFilenames()
in Sources/TSFCASFileTree/Internal/ConcurrentFilesystemScanner.swift
26 5 1
func constructDirectoryContents()
in Sources/TSFCASFileTree/FileTreeImport.swift
24 2 2
func dbPut()
in Sources/TSFCASFileTree/FileTreeImport.swift
19 2 4
init()
in Sources/TSFCAS/Implementations/Blake3DataID.swift
17 2 2
init()
in Sources/TSFCAS/Implementations/Blake3DataID.swift
17 2 2
func readFile()
in Sources/TSFCAS/Implementations/FileBackedCASDatabase.swift
17 1 1
func dbContains()
in Sources/TSFCASFileTree/FileTreeImport.swift
17 1 2
func prepareSingleSegment()
in Sources/TSFCASFileTree/FileTreeImport.swift
17 3 3
func normalized()
in Sources/TSFCASFileTree/FileTreeImport.swift
17 5 2
init()
in Sources/TSFCASFileTree/FileTreeImport.swift
14 1 5
func runBody()
in Sources/TSFFutures/FutureOperationQueue.swift
12 1 0
func invokeUserFilter()
in Sources/TSFCASFileTree/FileTreeImport.swift
11 1 2