Commonly used data structures for Swift
This report summarizes scanner evidence for apple/swift-collections, a Swift project with 4,519 GitHub stars. SynthScan examined 151,201 lines of code across 839 source files, recording 1803 pattern matches distributed across 6 syntactic categories. The legacy adjusted pattern signal is 12.0 (Moderate pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 1784 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 15 finding(s).
Which changes need focused human review? 1803 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 1803 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | Package@swift-6.2.swift | 1 | // swift-tools-version:6.2 | COMMENT |
| LOW | Package@swift-6.2.swift | 61 | // the hash table itself. This setting should never be enabled in production | COMMENT |
| LOW | CMakeLists.txt | 1 | ##===----------------------------------------------------------------------===## | COMMENT |
| LOW | Package.swift | 1 | // swift-tools-version:6.4 | COMMENT |
| LOW | Package.swift | 61 | // the hash table itself. This setting should never be enabled in production | COMMENT |
| LOW | Documentation/Container-design.md | 1521 | ### `protocol Drain` | COMMENT |
| LOW | Documentation/Container-design.md | 1541 | /// underlying consumable sequence. As soon as the sequence has run out of | COMMENT |
| LOW | Documentation/Container-design.md | 1561 | /// - Returns: An input span of at most the specified maximum count (if any), | COMMENT |
| LOW | Documentation/Container-design.md | 1781 | /// hint for the batch size of appends, to allow bulk operation even if | COMMENT |
| LOW | …umentation/Announcement-benchmarks/generate-results.sh | 1 | #!/bin/sh | COMMENT |
| LOW | cmake/modules/CMakeLists.txt | 1 | ##===----------------------------------------------------------------------===## | COMMENT |
| LOW | …ts/SortedSet/SortedSet+SetAlgebra Sequence Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …SortedCollectionsTests/SortedSet/SortedSet Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …onsTests/SortedDictionary/SortedDictionary Utils.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …onsTests/SortedDictionary/SortedDictionary Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …SortedCollectionsTests/BTree/BTree.Builder Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …sts/SortedCollectionsTests/BTree/Node+Join Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ortedCollectionsTests/BTree/Node+Balancing Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/SortedCollectionsTests/BTree/BTree Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ortedCollectionsTests/BTree/Node+Insertion Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/SortedCollectionsTests/BTree/Node Utils.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/SortedCollectionsTests/BTree/NodeTests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ortedCollectionsTests/BTree/BTree+Deletion Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/CollectionsTestSupportTests/UtilitiesTests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …lectionsTestSupportTests/MinimalTypeConformances.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ctionsTestSupportTests/IndexRangeCollectionTests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …/CollectionsTestSupportTests/CombinatoricsChecks.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/HashTreeCollectionsTests/Hash.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | Tests/HashTreeCollectionsTests/Utilities.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …hTreeCollectionsTests/TreeDictionary Smoke Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …shTreeCollectionsTests/TreeDictionary.Keys Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1 | //===----------------------------------------------------------------------===// | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1581 | } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1621 | } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1641 | COMMENT | |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1661 | // func test_grouping_initializer() { | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1681 | // "three": 3, | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1781 | expectEqual(d[keys[offset]], values[offset]) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1801 | // let (k, v) = d[offset: i] | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1821 | // keys.remove(at: offset) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1841 | // var d: TreeDictionary<LifetimeTracked<Int>, LifetimeTracked<Int>> = [:] | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1861 | // var (d, keys, values) = tracker.shareableDictionary(keys: 0 ..< count) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1881 | // var (d, keys, values) = tracker.shareableDictionary(keys: 0 ..< count) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1901 | // withEvery("isShared", in: [false, true]) { isShared in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1921 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1941 | // expectEqual(v, values[i]) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1961 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 1981 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2001 | // withHiddenCopies(if: isShared, of: &d) { d in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2021 | // withEvery("count", in: 0 ..< 30) { count in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2041 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2061 | // let (k, v) = d[offset: i] | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2081 | // let key = keys[offset] | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2101 | // withLifetimeTracking { tracker in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2121 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2141 | // expectEqual(k, keys[count - 1 - offset + i]) | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2161 | // d.modifyValue(forKey: key, default: fallback) { value in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2181 | // withLifetimeTracking { tracker in | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2201 | // } | COMMENT |
| LOW | …ts/HashTreeCollectionsTests/TreeDictionary Tests.swift | 2221 | // values[offset] = replacement | COMMENT |
| 1718 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | …s/OrderedCollections/HashTable/_Hashtable+Header.swift | 27 | /// ├──────────────────────────────────────────────┼────────┤ | COMMENT |
| MEDIUM⚡ | …s/OrderedCollections/HashTable/_Hashtable+Header.swift | 29 | /// └──────────────────────────────────────────────┴────────┘ | COMMENT |
| MEDIUM⚡ | …s/OrderedCollections/HashTable/_Hashtable+Header.swift | 31 | /// ├──────────────────────────────────────────────┼────────┤ | COMMENT |
| MEDIUM⚡ | …s/OrderedCollections/HashTable/_Hashtable+Header.swift | 33 | /// └──────────────────────────────────────────────┴────────┘ | COMMENT |
| MEDIUM⚡ | …rces/RopeModule/BigString/Basics/BigString+Index.swift | 19 | // ┌───────────────────────────────┬───┬───────────┬────────────────────┐ | COMMENT |
| MEDIUM⚡ | …rces/RopeModule/BigString/Basics/BigString+Index.swift | 21 | // ├───────────────────────────────┼───┼───────────┼────────────────────┤ | COMMENT |
| MEDIUM⚡ | …rces/RopeModule/BigString/Basics/BigString+Index.swift | 23 | // └───────────────────────────────┴───┴───────────┴────────────────────┘ | COMMENT |
| MEDIUM⚡ | …RopeModule/BigString/Chunk/BigString+Chunk+Index.swift | 19 | // ┌──────────────────┬───┬───────────┐ | COMMENT |
| MEDIUM⚡ | …RopeModule/BigString/Chunk/BigString+Chunk+Index.swift | 21 | // ├──────────────────┼───┼───────────┤ | COMMENT |
| MEDIUM⚡ | …RopeModule/BigString/Chunk/BigString+Chunk+Index.swift | 23 | // └──────────────────┴───┴───────────┘ | COMMENT |
| MEDIUM⚡ | Sources/RopeModule/Rope/Basics/_RopePath.swift | 18 | // ┌──────────────────────────────────┬────────┐ | COMMENT |
| MEDIUM⚡ | Sources/RopeModule/Rope/Basics/_RopePath.swift | 20 | // ├──────────────────────────────────┼────────┤ | COMMENT |
| MEDIUM⚡ | Sources/RopeModule/Rope/Basics/_RopePath.swift | 22 | // └──────────────────────────────────┴────────┘ | COMMENT |
| MEDIUM | Sources/HashTreeCollections/HashNode/_HashNode.swift | 26 | /// ┌───┬───┬───┬───┬───┬──────────────────┬───┬───┬───┬───┐ | COMMENT |
| MEDIUM | Sources/HashTreeCollections/HashNode/_HashNode.swift | 28 | /// └───┴───┴───┴───┴───┴──────────────────┴───┴───┴───┴───┘ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | …es/DequeModule/RigidDeque/RigidDeque+Consumption.swift | 238 | unsafe self._base._pointer.pointee._handle.closeGap(offsets: self._offsetRange) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | Utils/Debugger/formatter_bytecode.py | 380 | CODE | |
| LOW | Utils/Debugger/formatter_bytecode.py | 452 | CODE | |
| LOW | Utils/Debugger/formatter_bytecode.py | 526 | CODE | |
| LOW | Utils/Debugger/formatter_bytecode.py | 1131 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | Utils/Debugger/formatter_bytecode.py | 14 | CODE | |
| LOW | Utils/Debugger/formatter_bytecode.py | 27 | CODE | |
| LOW | Utils/Debugger/formatter_bytecode.py | 28 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | …urces/SortedCollections/BTree/_BTree+SubSequence.swift | 176 | // TODO: implement optimized `var indices` | COMMENT |
| LOW | …urces/SortedCollections/BTree/_BTree+SubSequence.swift | 191 | // TODO: implement partial RangeReplaceableCollection methods | COMMENT |