apple / swift-experimental-string-processing
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 710 units with 7,772 lines of code in units (35.1% of code).
    • 5 very long units (756 lines of code)
    • 7 long units (490 lines of code)
    • 47 medium size units (1,517 lines of code)
    • 177 small units (2,132 lines of code)
    • 474 very small units (2,877 lines of code)
9% | 6% | 19% | 27% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
swift9% | 6% | 19% | 27% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Sources/_StringProcessing29% | 11% | 26% | 3% | 29%
Sources/_StringProcessing/Legacy35% | 16% | 21% | 2% | 23%
Sources/_MatchingEngine/Engine43% | 0% | 0% | 9% | 47%
Sources/Prototypes/PEG0% | 25% | 9% | 11% | 53%
Sources/_MatchingEngine/Regex0% | 4% | 51% | 16% | 27%
Sources/VariadicsGenerator0% | 35% | 28% | 21% | 14%
Sources/_StringProcessing/Algorithms0% | 0% | 24% | 40% | 34%
Sources/_StringProcessing/RegexDSL0% | 0% | 1% | 54% | 44%
Sources/PatternConverter0% | 0% | 100% | 0% | 0%
Sources/_MatchingEngine/Utility0% | 0% | 0% | 29% | 70%
Sources/Exercises0% | 0% | 0% | 100% | 0%
Sources/Prototypes/TourOfTypes0% | 0% | 0% | 17% | 82%
Sources/_Unicode0% | 0% | 0% | 0% | 100%
Sources/Prototypes/Combinators0% | 0% | 0% | 0% | 100%
Sources/Prototypes/PTCaRet0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func compileNode()
in Sources/_StringProcessing/Legacy/LegacyCompile.swift
210 39 1
mutating func cycle()
in Sources/_MatchingEngine/Engine/Processor.swift
175 41 0
func generateConsumer()
in Sources/_StringProcessing/ConsumerInterface.swift
156 70 1
func compileQuantification()
in Sources/_StringProcessing/Compiler.swift
113 15 4
func generateConsumer()
in Sources/_StringProcessing/ConsumerInterface.swift
102 39 1
func execute()
in Sources/_StringProcessing/Legacy/HareVM.swift
99 22 3
func emit()
in Sources/_StringProcessing/Compiler.swift
76 25 1
func transpile()
in Sources/Prototypes/PEG/PEGTranspile.swift
73 27 0
func generateConsumer()
in Sources/_StringProcessing/ConsumerInterface.swift
69 18 1
func emitTupleStruct()
in Sources/VariadicsGenerator/VariadicsGenerator.swift
60 2 1
mutating func printAsPattern()
in Sources/_MatchingEngine/Regex/Printing/PrintAsPattern.swift
60 18 1
mutating func cycle()
in Sources/Prototypes/PEG/PEGCore.swift
53 22 0
func emitConcatenation()
in Sources/VariadicsGenerator/VariadicsGenerator.swift
49 3 1
func readThrough()
in Sources/_StringProcessing/Legacy/TortoiseVM.swift
49 15 2
mutating func lexGroupStart()
in Sources/_MatchingEngine/Regex/Parse/LexicalAnalysis.swift
47 20 0
func emitAssertion()
in Sources/_StringProcessing/Compiler.swift
47 16 1
func _consume()
in Sources/Prototypes/PEG/PEGInterpreter.swift
46 21 5
mutating func outputAsCanonical()
in Sources/_MatchingEngine/Regex/Printing/PrintAsCanonical.swift
42 15 1
func _match()
in Sources/_StringProcessing/RegexDSL/Core.swift
42 4 3
mutating func lexMatchingOption()
in Sources/_MatchingEngine/Regex/Parse/LexicalAnalysis.swift
41 19 0