A modern approach to Container-Based Dependency Injection for Swift and SwiftUI.
This report summarizes scanner evidence for hmlongco/Factory, a Swift project with 2,914 GitHub stars. SynthScan examined 16,528 lines of code across 704 source files, recording 105 pattern matches distributed across 7 syntactic categories. The legacy adjusted pattern signal is 7.3 (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? 102 finding(s).
Are imports declared and package/API names verified? 3 finding(s).
Are wrappers, guards, and repeated structures necessary? 2 finding(s).
Which changes need focused human review? 105 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 105 distinct pattern matches across 7 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 | FactoryDemo/FactoryDemoTests/ContainerTrait.swift | 1 | // | COMMENT |
| LOW | FactoryDemo/FactoryDemoTests/ContainerTrait.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | …toryDemo/FactoryDemo/FactoryDemoApp+AutoRegister.swift | 81 | // MockServiceN(0) | COMMENT |
| LOW | FactoryDemo/FactoryDemo/ContentView.swift | 121 | // ContentView(model: model1) | COMMENT |
| LOW | FactoryDemo/FactoryDemo/ContentView.swift | 141 | // } | COMMENT |
| LOW | …ctoryDemo/FactoryDemo/Concepts/FunctionInjection.swift | 1 | // | COMMENT |
| LOW | …ctoryDemo/FactoryDemo/Concepts/FunctionInjection.swift | 21 | // @Injected(\.openURL) var openURL | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 1 | // | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 61 | //struct PipelineProcessorTag : Tag { | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 81 | // var priority: Int { get } | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 101 | // } | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 121 | // for anyTaggedFactory in taggedFactories.values { | COMMENT |
| LOW | FactoryDemo/FactoryDemo/Concepts/Tags.swift | 141 | ///// tagged registrations | COMMENT |
| LOW | …/FactoryDemo/Concepts/TestNonExtendableContainer.swift | 1 | // | COMMENT |
| LOW | FactoryDemo/Modules/Networking/Networking/Networking.h | 1 | // | COMMENT |
| LOW | FactoryDemo/Modules/Common/Common/Common.h | 1 | // | COMMENT |
| LOW | Tests/FactoryTests/SwiftTesting/ParallelTests.swift | 61 | func commonTests(_ value: String) { | COMMENT |
| LOW | Tests/FactoryTests/SwiftTesting/ParallelTests.swift | 121 | let sut1 = TaskLocalUseCase() | COMMENT |
| LOW | Tests/FactoryTests/SwiftTesting/ParallelTests.swift | 201 | await isolatedAsyncTests("baz") | COMMENT |
| LOW | Tests/FactoryTests/SwiftTesting/ParallelTests.swift | 221 | #expect(sut2.fooBarBazSingleton.value == value) | COMMENT |
| LOW | …sts/FactoryTests/XCTests/FactoryPerformanceTests.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryTesting/ContainerTrait.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryTesting/ContainerTrait.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 41 | /// self { MyService() } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 61 | COMMENT | |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 81 | /// Note this should be defined as a @TaskLocal variable to be able to use its isolation mechanism, which is especia | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 121 | } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 181 | } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 241 | /// Syntactic sugar allows container to create a parameter factory whose optional registration is promised before re | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Containers.swift | 481 | COMMENT | |
| LOW | Sources/FactoryKit/FactoryKit/Scopes.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Scopes.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Scopes.swift | 41 | /// var service: Factory<ServiceType> { | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Contexts.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Contexts.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 41 | /// @Injected(\.myService) var service1 | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 101 | /// ```swift | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 181 | /// ```swift | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 201 | /// ```swift | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 281 | /// ```swift | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 301 | /// } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 361 | } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 401 | /// Allows the user to force a Factory resolution at their discretion. | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 421 | /// } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 461 | public init(_ wrappedValue: T) { | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Injections.swift | 481 | @MainActor @propertyWrapper public struct InjectedObservable<T>: DynamicProperty where T: Observation.Observable { | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Resolver.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Resolver.swift | 21 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 1 | // | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 61 | registration.register(scope: scope) | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 101 | /// Syntactic sugar defines this Factory's dependency scope to be singleton. See ``Scope/Singleton-swift.class``. | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 141 | COMMENT | |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 161 | /// Adds a factory specific decorator. The decorator will *always* be called with the resolved dependency | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 281 | COMMENT | |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 301 | } | COMMENT |
| LOW | Sources/FactoryKit/FactoryKit/Modifiers.swift | 321 | /// MainView() | COMMENT |
| 23 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | …t/managedcontainer/promised(key:file:line:)-1lq85.json | 1 | {"schemaVersion":{"patch":0,"minor":3,"major":0},"abstract":[{"type":"text","text":"Syntactic sugar allows container to | CODE |
| MEDIUM | …kit/managedcontainer/callasfunction(key:_:)-2xdpp.json | 1 | {"sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/factorykit\/managedconta | CODE |
| MEDIUM | …actorykit/container/promised(key:file:line:)-f5q7.json | 1 | {"sections":[],"variants":[{"traits":[{"interfaceLanguage":"swift"}],"paths":["\/documentation\/factorykit\/container\/p | CODE |
| MEDIUM | …factorykit/container/callasfunction(key:_:)-9dimj.json | 1 | {"schemaVersion":{"major":0,"minor":3,"patch":0},"abstract":[{"type":"text","text":"Syntactic sugar allows container to | CODE |
| MEDIUM | …ocumentation/factorykit/factory/preview(factory:).json | 1 | {"primaryContentSections":[{"kind":"declarations","declarations":[{"platforms":["macOS"],"languages":["swift"],"tokens": | CODE |
| MEDIUM | …a/documentation/factorykit/factory/init(_:key:_:).json | 1 | {"schemaVersion":{"minor":3,"major":0,"patch":0},"abstract":[{"text":"Public initializer creates a Factory capable of ma | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | FactoryDemo/FactoryDemoTests/ContainerTrait.swift | 44 | /// That said, it's also possible to leverage this behavior in `XCTestCase` by using the `@TaskLocal` provided `withVal | COMMENT |
| LOW | docs/data/documentation/factorykit/testing.json | 1 | {"schemaVersion":{"major":0,"minor":3,"patch":0},"seeAlsoSections":[{"identifiers":["doc:\/\/FactoryKit\/documentation\/ | CODE |
| LOW | docs/data/documentation/factorykit/contexts.json | 1 | {"hierarchy":{"paths":[["doc:\/\/FactoryKit\/documentation\/FactoryKit"]]},"metadata":{"modules":[{"name":"FactoryKit"}] | CODE |
| LOW | docs/data/documentation/factorykit/modifiers.json | 1 | {"seeAlsoSections":[{"title":"Advanced Topics","generated":true,"anchor":"Advanced-Topics","identifiers":["doc:\/\/Facto | CODE |
| MEDIUM | Sources/FactoryTesting/ContainerTrait.swift | 44 | /// That said, it's also possible to leverage this behavior in `XCTestCase` by using the `@TaskLocal` provided `withVal | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/data/documentation/factorykit/scopes.json | 1 | {"sections":[],"seeAlsoSections":[{"identifiers":["doc:\/\/FactoryKit\/documentation\/FactoryKit\/GettingStarted","doc:\ | CODE |
| MEDIUM | docs/data/documentation/factorykit/testing.json | 1 | {"schemaVersion":{"major":0,"minor":3,"patch":0},"seeAlsoSections":[{"identifiers":["doc:\/\/FactoryKit\/documentation\/ | CODE |
| MEDIUM | docs/data/documentation/factorykit/containers.json | 1 | {"hierarchy":{"paths":[["doc:\/\/FactoryKit\/documentation\/FactoryKit"]]},"kind":"article","metadata":{"role":"article" | CODE |
| LOW | docs/data/documentation/factorykit/contexts.json | 1 | {"hierarchy":{"paths":[["doc:\/\/FactoryKit\/documentation\/FactoryKit"]]},"metadata":{"modules":[{"name":"FactoryKit"}] | CODE |
| LOW | docs/data/documentation/factorykit/modifiers.json | 1 | {"seeAlsoSections":[{"title":"Advanced Topics","generated":true,"anchor":"Advanced-Topics","identifiers":["doc:\/\/Facto | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/js/highlight-js-scss-js.6dc40f91.js | 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[672],{1611:function(e){const i= | CODE |
| LOW | docs/js/chunk-vendors.88e02fc3.js | 21 | var r=Object.freeze({}),o=Array.isArray;function i(t){return void 0===t||null===t}function a(t){return void 0!==t&&null! | CODE |
| LOW | docs/js/highlight-js-css-js.6a1f0b6c.js | 10 | (self["webpackChunkswift_docc_render"]=self["webpackChunkswift_docc_render"]||[]).push([[175],{8612:function(e){const i= | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | Sources/FactoryKit/FactoryKit/Factory.swift | 43 | /// ## Defining a Factory | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/data/documentation/factorykit/actors.json | 1 | {"kind":"article","hierarchy":{"paths":[["doc:\/\/FactoryKit\/documentation\/FactoryKit"]]},"identifier":{"interfaceLang | CODE |
| LOW | Sources/FactoryKit/FactoryKit.docc/Advanced/Actors.md | 104 | final class DataManager { | CODE |