Repository Analysis

apple/swift-collections

Commonly used data structures for Swift

12.5 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of apple/swift-collections, a Swift project with 4,471 GitHub stars. SynthScan v2.0 examined 147,629 lines of code across 820 source files, recording 1840 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 12.5 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

12.5
Adjusted Score
12.5
Raw Score
100%
Time Factor
2026-07-29
Last Push
4.5K
Stars
Swift
Language
147.6K
Lines of Code
820
Files
1.8K
Pattern Hits
2026-08-02
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 1HIGH 0MEDIUM 15LOW 1824

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 1840 distinct pattern matches across 6 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block1815 hits · 1762 pts
SeverityFileLineSnippetContext
LOWCMakeLists.txt1##===----------------------------------------------------------------------===##COMMENT
LOWPackage@swift-6.0.swift1// swift-tools-version:6.0COMMENT
LOWPackage@swift-6.0.swift21// swift build -Xswiftc -DCOLLECTIONS_INTERNAL_CHECKSCOMMENT
LOWPackage@swift-6.0.swift41 //COMMENT
LOWPackage.swift1// swift-tools-version:6.2COMMENT
LOWPackage.swift61 // the hash table itself. This setting should never be enabled in productionCOMMENT
LOWDocumentation/Container-design.md1241COMMENT
LOWDocumentation/Container-design.md1261 var underestimatedCount: Int { get }COMMENT
LOWDocumentation/Container-design.md1281 ///COMMENT
LOWDocumentation/Container-design.md1301 ///COMMENT
LOWDocumentation/Container-design.md1321 /// Skip the given number items in the underlying generative sequence,COMMENT
LOWDocumentation/Container-design.md1341 /// an upcoming item in the sequence. Failure may happen midway throughCOMMENT
LOWDocumentation/Container-design.md1361 /// The ownership of all generated elements is transferred to theCOMMENT
LOWDocumentation/Container-design.md1381 /// available in the bulk method). Custom implementations of `next()`COMMENT
LOWDocumentation/Container-design.md1401 /// This rounding operation enables clients to convert/normalize valid indexCOMMENT
LOWDocumentation/Container-design.md1521/// a series of `InputSpan` instances. This iterator-like construct allowsCOMMENT
LOWDocumentation/Container-design.md1541 /// extending the exclusive access initiated by the call toCOMMENT
LOWDocumentation/Container-design.md1561 @_lifetime(&self)COMMENT
LOW…umentation/Announcement-benchmarks/generate-results.sh1#!/bin/shCOMMENT
LOWcmake/modules/CMakeLists.txt1##===----------------------------------------------------------------------===##COMMENT
LOW…SortedCollectionsTests/SortedSet/SortedSet Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…onsTests/SortedDictionary/SortedDictionary Utils.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…onsTests/SortedDictionary/SortedDictionary Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…SortedCollectionsTests/BTree/BTree.Builder Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…sts/SortedCollectionsTests/BTree/Node+Join Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ortedCollectionsTests/BTree/Node+Balancing Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/SortedCollectionsTests/BTree/BTree Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ortedCollectionsTests/BTree/Node+Insertion Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/SortedCollectionsTests/BTree/Node Utils.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/SortedCollectionsTests/BTree/NodeTests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ortedCollectionsTests/BTree/BTree+Deletion Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/CollectionsTestSupportTests/UtilitiesTests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…lectionsTestSupportTests/MinimalTypeConformances.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ctionsTestSupportTests/IndexRangeCollectionTests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…/CollectionsTestSupportTests/CombinatoricsChecks.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/HashTreeCollectionsTests/Hash.swift1//===----------------------------------------------------------------------===//COMMENT
LOWTests/HashTreeCollectionsTests/Utilities.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…hTreeCollectionsTests/TreeDictionary Smoke Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…shTreeCollectionsTests/TreeDictionary.Keys Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1//===----------------------------------------------------------------------===//COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1581 }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1621 }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1641COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1661 // func test_grouping_initializer() {COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1681 // "three": 3,COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1781 expectEqual(d[keys[offset]], values[offset])COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1801// let (k, v) = d[offset: i]COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1821// keys.remove(at: offset)COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1841// var d: TreeDictionary<LifetimeTracked<Int>, LifetimeTracked<Int>> = [:]COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1861// var (d, keys, values) = tracker.shareableDictionary(keys: 0 ..< count)COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1881 // var (d, keys, values) = tracker.shareableDictionary(keys: 0 ..< count)COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1901 // withEvery("isShared", in: [false, true]) { isShared inCOMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1921 // }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1941 // expectEqual(v, values[i])COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1961 // }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift1981 // }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift2001 // withHiddenCopies(if: isShared, of: &d) { d inCOMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift2021 // withEvery("count", in: 0 ..< 30) { count inCOMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift2041 // }COMMENT
LOW…ts/HashTreeCollectionsTests/TreeDictionary Tests.swift2061 // let (k, v) = d[offset: i]COMMENT
1755 more matches not shown…
Decorative Section Separators15 hits · 64 pts
SeverityFileLineSnippetContext
MEDIUM…s/OrderedCollections/HashTable/_Hashtable+Header.swift27 /// ├──────────────────────────────────────────────┼────────┤COMMENT
MEDIUM…s/OrderedCollections/HashTable/_Hashtable+Header.swift29 /// └──────────────────────────────────────────────┴────────┘COMMENT
MEDIUM…s/OrderedCollections/HashTable/_Hashtable+Header.swift31 /// ├──────────────────────────────────────────────┼────────┤COMMENT
MEDIUM…s/OrderedCollections/HashTable/_Hashtable+Header.swift33 /// └──────────────────────────────────────────────┴────────┘COMMENT
MEDIUM…rces/RopeModule/BigString/Basics/BigString+Index.swift21 // ┌───────────────────────────────┬───┬───────────┬────────────────────┐COMMENT
MEDIUM…rces/RopeModule/BigString/Basics/BigString+Index.swift23 // ├───────────────────────────────┼───┼───────────┼────────────────────┤COMMENT
MEDIUM…rces/RopeModule/BigString/Basics/BigString+Index.swift25 // └───────────────────────────────┴───┴───────────┴────────────────────┘COMMENT
MEDIUM…RopeModule/BigString/Chunk/BigString+Chunk+Index.swift21 // ┌──────────────────┬───┬───────────┐COMMENT
MEDIUM…RopeModule/BigString/Chunk/BigString+Chunk+Index.swift23 // ├──────────────────┼───┼───────────┤COMMENT
MEDIUM…RopeModule/BigString/Chunk/BigString+Chunk+Index.swift25 // └──────────────────┴───┴───────────┘COMMENT
MEDIUMSources/RopeModule/Rope/Basics/_RopePath.swift17 // ┌──────────────────────────────────┬────────┐COMMENT
MEDIUMSources/RopeModule/Rope/Basics/_RopePath.swift19 // ├──────────────────────────────────┼────────┤COMMENT
MEDIUMSources/RopeModule/Rope/Basics/_RopePath.swift21 // └──────────────────────────────────┴────────┘COMMENT
MEDIUMSources/HashTreeCollections/HashNode/_HashNode.swift26/// ┌───┬───┬───┬───┬───┬──────────────────┬───┬───┬───┬───┐COMMENT
MEDIUMSources/HashTreeCollections/HashNode/_HashNode.swift28/// └───┴───┴───┴───┴───┴──────────────────┴───┴───┴───┴───┘COMMENT
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICAL…es/DequeModule/RigidDeque/RigidDeque+Consumption.swift219 self._base._pointer.pointee._handle.closeGap(offsets: self._offsetRange)CODE
Deep Nesting4 hits · 4 pts
SeverityFileLineSnippetContext
LOWUtils/Debugger/formatter_bytecode.py380CODE
LOWUtils/Debugger/formatter_bytecode.py452CODE
LOWUtils/Debugger/formatter_bytecode.py526CODE
LOWUtils/Debugger/formatter_bytecode.py1131CODE
Unused Imports3 hits · 3 pts
SeverityFileLineSnippetContext
LOWUtils/Debugger/formatter_bytecode.py14CODE
LOWUtils/Debugger/formatter_bytecode.py27CODE
LOWUtils/Debugger/formatter_bytecode.py28CODE
TODO Padding2 hits · 3 pts
SeverityFileLineSnippetContext
LOW…urces/SortedCollections/BTree/_BTree+SubSequence.swift176 // TODO: implement optimized `var indices`COMMENT
LOW…urces/SortedCollections/BTree/_BTree+SubSequence.swift191// TODO: implement partial RangeReplaceableCollection methodsCOMMENT