Public report — stripe-ios, published 30 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_74644229fb4b43329648c06854b7f216 Filed 1 October 2026, 00:11 UTC Public

Stripe/stripe-Ios

Measured 30 September 2026, 23:52 UTC

45% Weak
CriticalWeakAdequateStrongExemplary

Large · 231,620 LoC · 16 projects · rebuild ~2.1 person-years · weakest lens: Accessibility (29%)

Findings by grade

44 critical 1178 serious 54 minor 41 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 September 2026, 23:52 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

44/48dimensions tool-verifieddeterministic · confidence 1.0 · 4 LLM-assisted, advisory
1245findings with an exact file:lineof 1276 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
48/120dimensions across the health lenses231620 LoC · 16 projects — wide & deep
Chapters

Executive summary

The system holds a weak overall standing at 45%, presenting a workable but risky asset for the business. While the core logic is sound and the architecture is robust, the platform carries significant exposure in areas that directly impact user trust and operational safety. This is a large investment, comprising over 230,000 lines of production code, with a rebuild cost estimated at €310,000. The value tied up here is substantial, and the cost of changing it is high, meaning every defect or compliance failure carries a heavy price tag in delay and reputation.

The most critical risk is accessibility failure, where the system scores only 29%. For a platform of this size, this is not just a technical debt but a legal and brand liability. Remediation here offers the highest protection, as the cost to fix is low compared to the annual drag on productivity caused by non-compliance. Ignoring this area costs the business significantly more in lost efficiency and potential litigation than the initial fix would require.

A secondary concern is the velocity tax on every change. Code complexity and duplication average a high score, meaning modifications in weaker areas cost 2–5% more effort than in clean code. This tax compounds as the codebase grows, silently eroding delivery speed and increasing the likelihood of defects. While the architecture is mature and event sourcing is perfect, these strengths are undermined by the friction introduced by poor code quality in daily operations.

The system is genuinely strong in its core architecture and event handling, providing a stable foundation for future growth. The code health is also respectable, indicating that the logic itself is maintainable. However, these strengths do not offset the immediate risks in accessibility and the hidden costs of technical debt.

Focus first on making custom controls keyboard-operable and adding proper labels. This single action breaks even in one to five months and eliminates the most severe compliance risk. It is the highest-leverage move available, offering immediate protection and freeing up resources for deeper architectural improvements later.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Accessibility 29% · 46% weightReadiness 47% · 25% weightMaturity 60% · 14% weightSecurity 61% · 8% weightCode Health 85% · 4% weightArchitecture 88% · 2% weightEvent Sourcing 100% · 1% weight

Raise Accessibility 29 → 70 (the Healthy floor) ⇒ headline 45 → ~57.

Code composition — where the lines go
Tests 100%
New since the last scan (100+)

214 finding(s) are new versus the previous scan (2026-09-15) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · NativeFlowController.swift.CreatePaneViewController (cyclomatic 42) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift
  • D1 · ConfirmButton.update (cyclomatic 36) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift
  • D1 · STPIntentAction.description (cyclomatic 33) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift
  • D1 · STPPaymentCardTextField.paymentMethodParams (cyclomatic 22) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift
  • D1 · STPConnectAccountIndividualParams.description (cyclomatic 18) StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift
  • D1 · Intent.fulfilledRequirements (cyclomatic 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift
  • D1 · STPFormTextField.autoFormattingBehavior (cyclomatic 17) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift
  • D1 · PaymentSheetVerticalViewController.selectedPaymentOption (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift
  • D2 · NativeFlowController.swift.CreatePaneViewController (cognitive 44) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift
  • D2 · ConfirmButton.update (cognitive 31) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift
  • D2 · STPPaymentCardTextField.paymentMethodParams (cognitive 31) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift
  • D2 · STPIntentAction.description (cognitive 29) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift
  • D2 · STPFormTextField.autoFormattingBehavior (cognitive 27) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift
  • D2 · BillingDetails.init (cognitive 23) StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift
  • D2 · NSMutableAttributedString.pmmePromoString (cognitive 22) StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/NSAttributedString+Extensions.swift
  • D2 · Intent.fulfilledRequirements (cognitive 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift
  • D2 · URLEncoder.swift.queryComponents (cognitive 18) StripeCore/StripeCore/Source/Helpers/URLEncoder.swift
  • D2 · LinkInlineSignupViewModel.action (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ViewModels/LinkInlineSignupViewModel.swift
  • D2 · TwoOptionSelectorView.handlePan (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/TwoOptionSelectorView.swift
  • D2 · PaymentMethodFormViewController.paymentOption (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift
  • D2 · STPConnectAccountIndividualParams.description (cognitive 17) StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift
  • D2 · STPCardScanner.setupCamera (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift
  • D2 · ExpressCheckoutElementUtilities.availablePaymentMethods (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElementUtilities.swift
  • D3 · MethodTooLong: STPPaymentMethodParams.nonnil_billingDetails StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift
  • D3 · FunctionTooLong: NativeFlowController.swift.CreatePaneViewController StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift
  • D3 · MethodTooLong: AddressDetails.stpAddress StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift
  • D3 · MethodTooLong: PaymentSheetFormFactory.makePix StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift
  • D3 · MethodTooLong: Result.success StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift
  • D3 · MethodTooLong: SelfieCaptureViewController.initialInstructionText StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • D3 · MethodTooLong: PaymentPagesAPIResponse.makeAmount StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse.swift
  • D3 · MethodTooLong: Intent.sellerDetails StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift
  • D3 · MethodTooLong: STPPaymentMethodType.displayName StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift
  • D3 · FileTooLong: Controllers/PayWithLinkViewController-WalletViewController.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController-WalletViewController.swift
  • D3 · MethodTooLong: STPPaymentMethodType.identifier StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift
  • D3 · MethodTooLong: ConfirmButton.update StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift
  • D3 · ClassTooLong: CryptoOnrampCoordinator REDACTED
  • D3 · MethodTooLong: STPIntentActionType.description StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift
  • D3 · MethodTooLong: STPPaymentIntentConfirmParams.nonnil_paymentMethodOptions StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift
  • D4 · Near-duplicate member family (4 members, 35 shared lines) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Near-duplicate member pair (48 shared lines) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift
  • D4 · Edited copy of a member (31 corresponding lines) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift
  • D4 · Members sharing a duplicated core (12 members, 50+ identical tokens) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift
  • D4 · Members sharing a duplicated core (4 members, 50+ identical tokens) StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift
  • D4 · Duplicated block (54 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Duplicated block (45 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Duplicated block (27–30 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift
  • D4 · Duplicated block (30 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift
  • D4 · Duplicated block (24–28 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift
  • D4 · Duplicated block (22 lines × 2) StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift
  • D4 · Duplicated block (21 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift
  • D4 · Duplicated block (20 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift
  • D4 · Duplicated block (18 lines × 2) StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift
  • D4 · Duplicated block (17 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift
  • D4 · Duplicated block (16 lines × 2) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift
  • D4 · Duplicated block (13–15 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentLogoView.swift
  • D4 · Duplicated block (15 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift
  • D4 · Duplicated block (15 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Duplicated block (14–15 lines × 2) Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift
  • D4 · Duplicated block (13–14 lines × 2) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/FCLiteImplementation.swift
  • D4 · Duplicated block (14 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/String+Extensions.swift
  • D4 · Duplicated block (12–13 lines × 11) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift
  • D4 · Duplicated block (12–13 lines × 3) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift
  • D4 · Duplicated block (13 lines × 2) StripeApplePay/StripeApplePay/Source/Extensions/PKPayment+Stripe.swift
  • D4 · Duplicated block (13 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift
  • D4 · Duplicated block (12 lines × 2) Example/AppClipExample/Shared/ContentView.swift
  • D4 · Duplicated block (11 lines × 3) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift
  • D4 · Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.swift
  • D4 · Duplicated block (10–11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Toast/LinkToast.swift
  • D4 · Duplicated block (11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift
  • D4 · Duplicated block (11 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift
  • D4 · Duplicated block (10 lines × 3) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift
  • D4 · Duplicated block (10 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift
  • D4 · Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift
  • D4 · Duplicated block (8 lines × 3) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift
  • D4 · Duplicated block (8 lines × 3) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift
  • D4 · Duplicated block (8 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift
  • D4 · Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift
  • D4 · Duplicated block (8 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Duplicated block (8 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift
  • D4 · Duplicated block (6 lines × 2) StripeConnect/StripeConnect/Source/Helpers/Appearance+Encoding.swift
  • D4 · Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift
  • D4 · Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift
  • D4 · Duplicated block (5 lines × 2) StripeUICore/StripeUICore/Source/Helpers/InputFormColors.swift
  • D4 · Duplicated block (31 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift
  • D4 · Duplicated block (88 lines × 2) Example/AppClipExample/Shared/PaymentButton.swift
  • D4 · Duplicated block (34 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift
  • D4 · Duplicated block (20 lines × 3) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift
  • D4 · Duplicated block (9 lines × 5) StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/InvalidWalletOwnershipChallengeError.swift
  • D4 · Duplicated block (12 lines × 2) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Helpers/STPVisionSupport.swift
  • D4 · Duplicated block (8 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift
  • D4 · Duplicated block (8 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift
  • D4 · Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift
  • D4 · Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift
  • D4 · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift
  • D4 · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/WalletHeaderView.swift
  • D4 · Duplicated block (12 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift
  • D4 · Duplicated block (9 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift
  • D4 · Duplicated block (6 lines × 7) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBacsDebit.swift
  • D4 · Duplicated block (6 lines × 5) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGoPay.swift
  • D4 · Duplicated block (8 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntentParams.swift

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €100,000–€520,000
Cost to rebuild€100,000–€520,000 (1.0–3.2 person-years (1,711–5,428 h), ~1–5 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 45% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~2.1 person-years of build effort (about ~€310,000 to rebuild). Its weakest lens is Accessibility at 29% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
+13.9 pts · Medium effort · Keyboard semantics
2
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
+13.7 pts · Medium effort · Forms & labels
3
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
+13.7 pts · Medium effort · Visual & motion safety

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~2.1 person-years to rebuild), and its weakest lens is Accessibility at 29%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~2.1 person-years rebuild (231,620 LoC) · weakest lens: Accessibility 29%
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 23.7–157.9 engineer-days every year, paid as drag on the ~473,709 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–5 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 2–5% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 116,805 line(s) changed over a 90-day window ⇒ ~473,709/year · D1/D2/D4/D6 code quality: averaging 7.5/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 5 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.5/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 7.5/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch Stripe Stripe Stripe3DS2 Stripe3DS2 Stripe->Stripe3DS2 StripeApplePay StripeApplePay Stripe->StripeApplePay StripeCore StripeCore Stripe->StripeCore StripeIssuing StripeIssuing Stripe->StripeIssuing StripePayments StripePayments Stripe->StripePayments StripePaymentsUI StripePaymentsUI Stripe->StripePaymentsUI StripeUICore StripeUICore Stripe->StripeUICore StripeApplePay->StripeCore StripeCameraCore StripeCameraCore StripeCameraCore->StripeCore StripeCardScan StripeCardScan StripeCardScan->StripeCore StripeConnect StripeConnect StripeConnect->StripeCore StripeFinancialConnections StripeFinancialConnections StripeConnect->StripeFinancialConnections StripeConnect->StripeUICore StripeCryptoOnramp StripeCryptoOnramp StripeCryptoOnramp->StripeApplePay StripeCryptoOnramp->StripeCore StripeIdentity StripeIdentity StripeCryptoOnramp->StripeIdentity StripePaymentSheet StripePaymentSheet StripeCryptoOnramp->StripePaymentSheet StripeCryptoOnramp->StripePayments StripeCryptoOnramp->StripePaymentsUI StripeCryptoOnramp->StripeUICore StripeFinancialConnections->StripeCore StripeFinancialConnections->StripeUICore StripeFinancialConnectionsLite StripeFinancialConnectionsLite StripeFinancialConnectionsLite->StripeCore StripeIdentity->StripeCameraCore StripeIdentity->StripeCore StripeIdentity->StripeUICore StripeIssuing->StripeCore StripeIssuing->StripePayments StripeIssuing->StripePaymentsUI StripePaymentSheet->StripeApplePay StripePaymentSheet->StripeCore StripePaymentSheet->StripeFinancialConnectionsLite StripePaymentSheet->StripePayments StripePaymentSheet->StripePaymentsUI StripePaymentSheet->StripeUICore StripePayments->Stripe3DS2 StripePayments->StripeCore StripePaymentsUI->Stripe3DS2 StripePaymentsUI->StripeCore StripePaymentsUI->StripePayments StripePaymentsUI->StripeUICore StripeUICore->StripeCore

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

78 modules, 698 dependencies. 1 dependency cycle across 65 modules, marked above the diagonal.

Showing the 40 most-connected modules; 38 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 StripeIdentity~StripeIdentity~WebWrapper2 StripePayments~StripePayments~Captcha3 StripePayments~StripePayments~PaymentHandler4 StripeUICore~StripeUICore~Controls5 StripePayments~StripePayments~Internal6 StripePayments~StripePayments~API Bindings7 StripePayments~StripePayments~Helpers8 StripePaymentSheet~StripePaymentSheet~PaymentSheet9 StripePaymentSheet~StripePaymentSheet~Helpers10 StripeIdentity~StripeIdentity~NativeComponents11 StripeIdentity~StripeIdentity~API Bindings12 StripeFinancialConnections~StripeFinancialConnections~Native13 repository14 StripeIdentity~StripeIdentity~Categories15 StripeFinancialConnections~StripeFinancialConnections~Helpers16 StripeFinancialConnections~StripeFinancialConnections17 StripeFinancialConnections~StripeFinancialConnections~Common18 StripeFinancialConnections~StripeFinancialConnections~API Bindings19 StripePaymentSheet~StripePaymentSheet~Internal20 StripeCore~StripeCore~UI21 StripeCryptoOnramp~StripeCryptoOnramp~Internal22 StripeCryptoOnramp~StripeCryptoOnramp~Components23 StripeCore~StripeCore~Connections Bindings24 StripeConnect~StripeConnect~Internal25 StripeCore~StripeCore~Helpers26 StripeCore~StripeCore~Categories27 StripeUICore~StripeUICore~Elements28 StripeUICore~StripeUICore~Categories29 StripeConnect~StripeConnect~Helpers30 StripeCore~StripeCore~Coder31 StripeCore~StripeCore~Analytics32 StripeCameraCore~StripeCameraCore~Coordinators33 StripeCardScan~StripeCardScan~CardScan34 StripeCameraCore~StripeCameraCore~Categories35 StripeCardScan~StripeCardScan~CardVerify36 StripeCore~StripeCore~API Bindings37 StripePaymentsUI~StripePaymentsUI~UI Components38 StripeApplePay~StripeApplePay~Extensions39 StripePaymentsUI~StripePaymentsUI~Internal40 StripeApplePay~StripeApplePay~ApplePayContext
1 StripeIdentity~StripeIdentity~WebWrapper1521211111
2 StripePayments~StripePayments~Captcha28113111
3 StripePayments~StripePayments~PaymentHandler593312513142
4 StripeUICore~StripeUICore~Controls121131261211
5 StripePayments~StripePayments~Internal91026161169
6 StripePayments~StripePayments~API Bindings3512821312134131342
7 StripePayments~StripePayments~Helpers111102914213141
8 StripePaymentSheet~StripePaymentSheet~PaymentSheet2153412333994435162745829411121114515222282611135
9 StripePaymentSheet~StripePaymentSheet~Helpers1922526221122222
10 StripeIdentity~StripeIdentity~NativeComponents1913113916313927152315529181021261991
11 StripeIdentity~StripeIdentity~API Bindings1311141611
12 StripeFinancialConnections~StripeFinancialConnections~Native1361384259432152124352129281122
13 repository222311036331621911081313931912189751564412545
14 StripeIdentity~StripeIdentity~Categories10111
15 StripeFinancialConnections~StripeFinancialConnections~Helpers1421312
16 StripeFinancialConnections~StripeFinancialConnections1311714211422112
17 StripeFinancialConnections~StripeFinancialConnections~Common1124261772312
18 StripeFinancialConnections~StripeFinancialConnections~API Bindings1812121047552
19 StripePaymentSheet~StripePaymentSheet~Internal1152272273221132546113320321351553
20 StripeCore~StripeCore~UI11111
21 StripeCryptoOnramp~StripeCryptoOnramp~Internal157921117121331
22 StripeCryptoOnramp~StripeCryptoOnramp~Components22414835110322
23 StripeCore~StripeCore~Connections Bindings1341932
24 StripeConnect~StripeConnect~Internal1037823152166125111
25 StripeCore~StripeCore~Helpers12423231
26 StripeCore~StripeCore~Categories71111
27 StripeUICore~StripeUICore~Elements2233471532216142424
28 StripeUICore~StripeUICore~Categories81
29 StripeConnect~StripeConnect~Helpers9111
30 StripeCore~StripeCore~Coder11191336
31 StripeCore~StripeCore~Analytics13035213
32 StripeCameraCore~StripeCameraCore~Coordinators5613116
33 StripeCardScan~StripeCardScan~CardScan42761321561269
34 StripeCameraCore~StripeCameraCore~Categories113
35 StripeCardScan~StripeCardScan~CardVerify2559512154344
36 StripeCore~StripeCore~API Bindings2482341161371152414131
37 StripePaymentsUI~StripePaymentsUI~UI Components712345151212133326
38 StripeApplePay~StripeApplePay~Extensions11
39 StripePaymentsUI~StripePaymentsUI~Internal9124810131412316
40 StripeApplePay~StripeApplePay~ApplePayContext6111111236
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…peIdentity~WebWrapper…tripePayments~Captcha…yments~PaymentHandler…StripeUICore~Controls…ripePayments~Internal…Payments~API Bindings…tripePayments~Helpers…entSheet~PaymentSheet…ePaymentSheet~Helpers…tity~NativeComponents…Identity~API Bindings…ialConnections~Nativerepository…peIdentity~Categories…alConnections~Helpers…eFinancialConnections…ialConnections~Common…nections~API Bindings…PaymentSheet~Internal…ipeCore~StripeCore~UI…CryptoOnramp~Internal…yptoOnramp~Components…~Connections Bindings…tripeConnect~Internal…re~StripeCore~Helpers…StripeCore~Categories…StripeUICore~Elements…ripeUICore~Categories…StripeConnect~Helpers…Core~StripeCore~Coder…~StripeCore~Analytics…meraCore~Coordinators…ripeCardScan~CardScan…CameraCore~Categories…peCardScan~CardVerify…ripeCore~API Bindings…mentsUI~UI Components…peApplePay~Extensions…pePaymentsUI~Internal…lePay~ApplePayContext…peIdentity~WebWrapper1…tripePayments~Captcha2…yments~PaymentHandler3…StripeUICore~Controls4…ripePayments~Internal5…Payments~API Bindings6…tripePayments~Helpers7…entSheet~PaymentSheet8…ePaymentSheet~Helpers9…tity~NativeComponents10…Identity~API Bindings11…ialConnections~Native12repository13…peIdentity~Categories14…alConnections~Helpers15…eFinancialConnections16…ialConnections~Common17…nections~API Bindings18…PaymentSheet~Internal19…ipeCore~StripeCore~UI20…CryptoOnramp~Internal21…yptoOnramp~Components22…~Connections Bindings23…tripeConnect~Internal24…re~StripeCore~Helpers25…StripeCore~Categories26…StripeUICore~Elements27…ripeUICore~Categories28…StripeConnect~Helpers29…Core~StripeCore~Coder30…~StripeCore~Analytics31…meraCore~Coordinators32…ripeCardScan~CardScan33…CameraCore~Categories34…peCardScan~CardVerify35…ripeCore~API Bindings36…mentsUI~UI Components37…peApplePay~Extensions38…pePaymentsUI~Internal39…lePay~ApplePayContext40152121111128113111593312513142121131261211910261611693512821312134131342111102914213141215341233399443516274582941112111451522228261113519225262211222221913113916313927152315529181021261991131114161113613842594321521243521292811222223110363316219110813139319121897515644125451011114213121311714211422112112426177231218121210475521152272273221132546113320321351553111111579211171213312241483511032213419321037823152166125111124232317111122334715322161424248191111119133613035213561311642761321561269113255951215434424823411613711524141317123451512121333261191248101314123166111111236+38 more modules (most-connected shown)

At a glance — Code Health · 85% · Strong ·

At a glance — Architecture · 88% · Adequate · gated by D26 ·

At a glance — Maturity · 60% · Adequate · gated by M2 ·

At a glance — Readiness · 47% · Weak · gated by D13, P3 ·

At a glance — Security · 61% · Adequate · gated by D28, D29 ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Accessibility · 29% · Weak · gated by AC2, AC4, AC6 ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2021 — Injection24High / Critical
A02:2021 — Cryptographic Failures15High / Critical
A06:2021 — Vulnerable & Outdated Components9High / Critical
A04:2021 — Insecure Design1Medium

Roadmap

First, ensure all interactive elements are fully keyboard-operable and every form control has a clear programmatic label. Next, maintain visible focus styles, respect reduced motion preferences, and fix low-contrast colors to support visual safety. Then, establish the page structure by defining the language, title, and main landmark while keeping headings in order. Finally, integrate automated accessibility checks into your existing test suite and CI pipeline to prevent future regressions.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+13.9 ptsMediumKeyboard semantics
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+13.7 ptsMediumForms & labels
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.+13.7 ptsMediumVisual & motion safety
Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.+13.6 ptsMediumA11y enforcement
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+13.1 ptsMediumPage structure
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+5.5 ptsLowREDACTED Scanning
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+5.6 ptsMediumSecurity & performance tooling
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.+5.2 ptsMediumObservability

File quality

Per-file score 0–10 — a quality signature. Of 483 files carrying findings, judged against the Production bar: 0% slop · 49% mixed · 51% near-clean.

FileScoreBandWorst signal
REDACTED1.2SlopDependency Vulnerabilities: High CVE: REDACTED
StripeCore/StripeCoreTests/External/TestJSONEncoder.swift3.9SlopTest Quality: Assertions commented out: test_codingOfDecimal
REDACTED4.0MixedData Compliance (PII/GDPR): Medium: REDACTED
REDACTED4.5MixedSecrets (history): REDACTED: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: High CVE: REDACTED
StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift5.1MixedGod Classes: TooManyMethods: FinancialConnectionsAsyncAPIClient
REDACTED5.4MixedStatic Analysis (SAST): Medium: REDACTED
StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift5.5MixedCyclomatic Complexity: DocumentCaptureViewController.scanningTextWithNoInput (cyclomatic 19)
Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift5.6MixedCode Duplication: Members sharing a duplicated core (5 members, 50+ identical tokens)
StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift5.6MixedCyclomatic Complexity: STPFormView.configureFooter (cyclomatic 18)
StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift5.6MixedCyclomatic Complexity: STPFormTextField.autoFormattingBehavior (cyclomatic 17)
StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift5.7MixedCyclomatic Complexity: STPCardScanner.processVNRequest (cyclomatic 16)
StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift5.7MixedGod Classes: MethodTooLong: STPPaymentMethodParams.nonnil_billingDetails
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift5.9MixedCyclomatic Complexity: ErrorViewController.viewDidLoad (cyclomatic 18)
StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift5.9MixedCognitive Complexity: STPCardFormView.shouldAutoAdvance (cognitive 20)
Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift5.9MixedCode Duplication: Duplicated block (42–43 lines × 2)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 44

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 1178

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 54

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 41

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 44 of 48 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 48 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D19D20D21D22D26D28D29D30D32D34D35D43D44AC2AC3AC4AC6AC7AX10AX3AX4AX9ES1ES2M1M2M3M4P1P10P2P3P6X29

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1245 of 1276 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0f4bb-90a8-73a6-b0cb-cf1113581dd4.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.swift) and this repository declares a SwiftPM test suite (Stripe), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `Example/CryptoOnramp Example/CryptoOnramp Example/AttachWalletAddressView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CheckoutSuccessView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift`, … (+70 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection singletons in C#, Spring/JSR-330/CDI singletons in Java and Kotlin, and module state in Python request handlers only, and this repository's product is written in Ruby and Swift, which was left unread, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 11 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, or an npm dev script. None was found, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P1 CI/CD gates — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A CI pipeline exists and the word "test" appears, but no explicit test-runner invocation (your stack's test command, or a test job) was matched — so either the gate runs tests through a step this pass could not recognise, or "test" is incidental here (a path, "latest", a reporter). Which of the two it is cannot be settled from this dimension's evidence; the coverage dimensions report whether a suite exists at all. You can widen what we reach: name the test runner explicitly in the pipeline step (your stack's test command, or a job named for the suite) so the gate is unambiguous to a reader and to this pass.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • PF3 Async & latency hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust and Go), and its Ruby, Swift source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.

Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity6.4 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 100% · ceiling Prevented

65 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was STPPaymentHandler._handleAuthenticationForCurrentAction at 68. A further 19 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being STPPaymentMethodType.displayName at 58 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift (STPPaymentMethodParams.init at 48), StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Compliance/ComplianceIdentifierType.swift (ComplianceIdentifierType.displayName at 32), StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift (CryptoOnrampAnalyticsEvent.eventName at 32), StripeIdentity/StripeIdentity/Source/Categories/VNBarcodeSymbology+StripeIdentity.swift (VNBarcodeSymbology.init at 24), StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKrCard.swift (STPPaymentMethodKrCardBrand.stringValue at 24), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111
STPPaymentMethodType.makeImage (cyclomatic 60)StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:219
STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1584
NativeFlowController.swift.CreatePaneViewController (cyclomatic 42)StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1477
STPPaymentCardTextField.recalculateSubviewLayout (cyclomatic 39)StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320

+ 57 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68) finding(s) in Cyclomatic Complexity — start with STPPaymentHandler.swift. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 STPPaymentMethodType.makeImage (cyclomatic 60) finding(s) in Cyclomatic Complexity — start with STPPaymentMethodEnums.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic… finding(s) in Cyclomatic Complexity — start with STPPaymentHandler.swift. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity5.7 / 10Adequate✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.7 / 10 · rule-coverage 100% · ceiling Prevented

117 method(s) exceeded the cognitive complexity threshold of 15; the worst was STPPaymentHandler._handleAuthenticationForCurrentAction at 139.

STPPaymentHandler._handleAuthenticationForCurrentAction (cognitive 139)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111
STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive 107)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1584
STPPaymentCardTextField.recalculateSubviewLayout (cognitive 86)StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320
HostedAuthUrlBuilder.build (cognitive 69)StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:12
STPApplePayContext._completePayment (cognitive 52)StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:660

+ 109 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 STPPaymentHandler._handleAuthenticationForCurrentAction (cognitive 139) finding(s) in Cognitive Complexity — start with STPPaymentHandler.swift. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive… finding(s) in Cognitive Complexity — start with STPPaymentHandler.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 STPPaymentCardTextField.recalculateSubviewLayout (cognitive 86) finding(s) in Cognitive Complexity — start with STPPaymentCardTextField.swift. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.8 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Prevented

100 god class(es) detected.

MethodTooLong: STPPaymentHandler.logConfirmSetupIntentCompleted · ×36StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:97
TooManyMethods: STPAPIClient · ×27StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13
FileTooLong: PaymentHandler/STPPaymentHandler.swift · ×25StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift
ClassTooLong: STPPaymentHandler · ×11StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:100
FunctionTooLong: NativeFlowController.swift.CreatePaneViewControllerStripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1477

What to do

  1. Resolve the 36 MethodTooLong finding(s) in God Classes — start with PaymentSheetFormFactory.swift (5), STPPaymentHandler.swift (3), ConfirmButton.swift (2). — One of this dimension's main actionable groups (36 warning-level).
  2. Resolve the 27 TooManyMethods finding(s) in God Classes — start with STPAPIClient.swift, STPAnalyticsClient.swift, NativeFlowController.swift. — One of this dimension's main actionable groups (27 warning-level).
  3. Resolve the 25 FileTooLong finding(s) in God Classes — start with STPPaymentHandler.swift, STPPaymentCardTextField.swift, NativeFlowController.swift. — One of this dimension's main actionable groups (25 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.1 / 10Stronggated by 423 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Verified

405 duplicated block group(s) detected. A further 18 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 138 of the 423 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (10 lines × 2) · ×27StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:108
Duplicated block (9 lines × 2) · ×25StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:97
Duplicated block (8 lines × 2) · ×25StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:444
Duplicated block (7 lines × 2) · ×24StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:71
Duplicated block (6 lines × 2) · ×23StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:45

+ 128 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 27 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with PaymentSheetTestPlaygroundSettings.swift (3), STPPaymentHandler.swift (2), PaymentSheet+DeferredAPI.swift. — One of this dimension's main actionable groups (27 warning-level).
  2. Resolve the 25 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with STPPaymentHandler.swift (2), AppearancePlaygroundView.swift (2), STPAnalyticsClient+Address.swift. — One of this dimension's main actionable groups (25 warning-level).
  3. Resolve the 25 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with STPBankAccountCollector.swift (2), RoundedTextField.swift (2), CustomerSavedPaymentMethodsCollectionViewController.swift (2). — One of this dimension's main actionable groups (25 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling8.9 / 10Strong✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Prevented

16 production modules (SwiftPM), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 15 of the 16 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).

Unstable project StripePaymentSheet
Off the main sequence: StripeCore

What to do

  1. Resolve the 1 Unstable project StripePaymentSheet finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.

D6 · Cohesion (LCOM4)8.7 / 10Strong✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Verified

67 of 621 classes have LCOM4 above 3.

Low cohesion: WalletViewController (LCOM4 16) · ×67StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController-WalletViewController.swift:436

What to do

  1. Resolve the 67 Low cohesion finding(s) in Cohesion (LCOM4) — start with SceneDelegate.swift (4), MainViewController.swift (2), PayWithLinkViewController-WalletViewController.swift. — One of this dimension's main actionable groups (67 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

2887 test methods: 2848 unit, 0 integration, 0 BDD, 39 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.4 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Prevented

1 skipped, 137 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2887 tests (1 harness-style project(s) excluded from the assertion penalty).

Assertions commented out: test_codingOfDecimal · ×2StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:578
No assertions (empty test): testNullTesters/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift:47
No assertions: testUpdateShouldCallTheCompletionBlock · ×106Stripe/StripeiOSTests/ConfirmButtonTests.swift:60
Test project verifies nothing: Extensions · ×3StripeConnect/StripeConnectTests/Internal/Extensions/URL+ExtensionTests.swift:12
Skipped test: testUpdatesSwiftUILayoutWhenDetailsChangeHeightStripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CurrencySelectorElementViewTests.swift:33

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 2 Assertions commented out finding(s) in Test Quality — start with TestJSONEncoder.swift, SPMTestUITests.swift. — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with IntegrationTesterUITests.swift. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 106 No assertions finding(s) in Test Quality — start with ConnectComponentWebViewControllerTests.swift (13), TextFieldElement+AccountFactoryTest.swift (6), DocumentCaptureViewControllerTest.swift (6). — One of this dimension's main actionable groups (106 warning-level).
  4. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D12 · Dependency Hygiene9.7 5.8 / 10Adequate✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 5.8 / 10 · rule-coverage 60% · ceiling Verified

2 outdated direct SwiftPM dependencies, 1 pinning defect(s). 3 of 5 direct dependencies had their releases listed (0 naming no readable repository, 2 pinned to a branch or a revision rather than a version). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.

Floating branch dependency: ohhttpstubs
Outdated: swift-custom-dump · ×2

What to do

  1. Resolve the 1 Floating branch dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Prevented

4 secret(s) detected.

REDACTED

What to do

  1. Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 142 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 142 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed REDACTED. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. 3 of them publish no licence on rubygems.org; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: colorize

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots9.8 / 10Stronggated by 19 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift (51×33=1683); StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift (31×32=992); StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift (13×68=884)

Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift · ×19StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:429

What to do

  1. Resolve the 19 Hotspot finding(s) in Churn × Complexity Hotspots — start with CheckoutController.swift, PaymentSheetFormFactory.swift, STPPaymentHandler.swift. — One of this dimension's main actionable groups (19 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

67 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift. Counted over 799 of the 1602 production source files in this repository: 802 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

Off-boarding risk: anonymized user #1 · ×8
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 234 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

234 deducted task-comment markers across 231620 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×195Example/CardImageVerification Example/CardImageVerification Example/View Controllers/VerificationExplanationViewController.swift:11
HackComment · ×37Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:615
FixmeComment · ×2StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:1104

What to do

  1. Resolve the 195 TodoComment finding(s) in Explicit Debt — start with Checkout+Confirm.swift (8), LinkController.swift (6), STPAPIClient+CheckoutSessionTest.swift (5). — One of this dimension's main actionable groups (195 warning-level).
  2. Resolve the 37 HackComment finding(s) in Explicit Debt — start with PlaygroundController.swift (4), EmbeddedPaymentMethodsView.swift (3), CustomerSheetTestPlaygroundController.swift (2). — One of this dimension's main actionable groups (37 warning-level).
  3. Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with TestJSONEncoder.swift (2). — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityExemplary◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

The Stripe iOS SDK repository is well documented: a root README covering the project overview, an extensive table of contents (Features, Releases, Requirements, Getting started with Integration/Examples, Contributing, Migrating from older versions, Code style, Licenses), and per-directory READMEs for each module (e.g. StripeCardScan, StripeConnect, StripeCryptoOnramp) that document their own directories rather than the repository as a whole. The documentation is clear, complete, and well-structured with an internal table of contents and cross-references. The Stripe payments SDK and its test-support documentation are clear and complete: each directory's README (StripePaymentsUI/, fastlane/) documents itself with installation, usage examples, and links to the project's own examples. The architecture/design docs (stripe3ds2-support/doc/html/*) provide detailed class references for the 3DS2 framework, covering inheritance, declared APIs, and a searchable hierarchy. All visible content is present and well-structured; the only unshown elements are the Stripe payment flow example itself and any architecture-level documentation not yet shown.

Documentation: no project overviewstripe3ds2-support/doc/html/index.html

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyStrong◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

Maturity: Documented → Verified → Prevented · effective Strong / 10 · rule-coverage 100% · ceiling Verified

4 API inconsistencies across a 400-member sample of 530 exposed types.

Inconsistent parameter naming for the view controller argument. One uses `from:` and the other uses `from:` (consistent), but the completion handler signature differs in payload type which is expected, however, looking at `FinancialConnectionsSheet`, there is a mix of `present` and `presentForToken`. More critically, `CardScanSheet` and `CardImageVerificationSheet` are distinct domains (Scan vs Verify), so this is actually consistent. Let's look for real issues.
Inconsistent method naming for similar intents. `present` is generic, while `presentForToken` is specific. This forces developers to choose between a generic method that returns a union type `Result` (likely an enum or protocol) and a specific method. While distinct, the generic `present` method's return type `Result` is ambiguous compared to the explicit `TokenResult` and `HostControllerResult` types used elsewhere.
Inconsistent parameter naming for the same operation across overloads. `presentApplePay` uses `from:` for a window and `on:` for a view controller. This is a minor inconsistency in preposition usage (`from` vs `on`) for similar contextual arguments.
Inconsistent parameter naming for the presenting view controller. Most sheets use `from:`, but `AccountOnboardingController` also uses `from:`. However, `CheckScanningController` uses `present(from: UIViewController, animated: Bool)` and `dismiss(animated: Bool, completion: ...)`. The inconsistency is subtle but present in `STPApplePayContext` which uses `on:` for UIViewController. Also, `CardScanSheet` and `CardImageVerificationSheet` use `from:` while `STPApplePayContext` uses `on:`.

What to do

  1. Resolve the 1 Inconsistent parameter naming for the view controller argument. One uses… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Inconsistent method naming for similar intents. `present` is generic,… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Inconsistent parameter naming for the same operation across overloads.… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 1 build units (Bundler) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

10 finding(s): 0 critical, 10 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 10 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.8 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.8 / 10 · rule-coverage 100% · ceiling Documented

24 finding(s): 0 critical, 11 high, 13 medium, 0 low. semgrep hit a parse error in 12 file(s) — `REDACTED`, `REDACTED`, `Stripe3DS2/Stripe3DS2/STDSChallengeResponse.h` (line 19, line 41, line 44, …), `Stripe3DS2/Stripe3DS2/include/STDSSwiftTryCatch.h` (line 32, line 37, line 41, …), `StripeCore/StripeCore/Source/Attestation/StripeAttest.swift` (lines 418–421), … (+7 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 1 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities6.6 / 10Adequate✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no REDACTED is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 6.6 / 10 · rule-coverage 100% · ceiling Documented

9 finding(s): 0 critical, 4 high, 5 medium, 0 low.

REDACTED
REDACTED

What to do

  1. Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using Watchdog's own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 0 high, 1 medium, 0 low. semgrep could not parse 75 file(s) — `Example/CryptoOnramp Example/CryptoOnramp Example/AttachWalletAddressView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CheckoutSuccessView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift`, `Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift`, … (+70 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.

REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d32_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness7.5 / 10Adequategated by 4 critical findings✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

200 of 800 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift. Counted over 800 of the 1602 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×4StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift
Further orphaned files (smaller)

What to do

  1. Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with RoundedTextField.swift, SheetViewController.swift, ScanBaseViewController.swift. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling9.8 / 10Stronggated by 16 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: DocumentScanner.swift↔DocumentCaptureViewController.swift 80%; STPPaymentIntent.swift↔STPSetupIntent.swift 80%; STPPaymentIntentConfirmParams.swift↔STPSetupIntentConfirmParams.swift 74%

Change coupling: DocumentScanner.swift ↔ DocumentCaptureViewController.swift · ×14StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/DocumentScanner/DocumentScanner.swift
Change-coupling hub: HostViewController.swift → FinancialConnectionsSheet.swift, NativeFlowController.swift, FinancialConnectionsWebFlowViewController.swiftStripeFinancialConnections/StripeFinancialConnections/Source/Common/HostViewController.swift
Change coupling clique: NetworkingLinkVerificationDataSource.swift, NetworkingSaveToLinkVerificationDataSource.swift, NetworkingOTPView.swiftStripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift

What to do

  1. Resolve the 14 Change coupling finding(s) in Change Coupling — start with DocumentScanner.swift, STPPaymentIntent.swift, STPPaymentIntentConfirmParams.swift. — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with HostViewController.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with NetworkingLinkVerificationDataSource.swift. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 16 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC2 · Forms & labels3.5 / 10Weak✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×4) — .jazzy/theme/assets/js/jquery.min.js:2, .jazzy/theme/assets/js/jquery.min.js:2, .jazzy/theme/assets/js/jquery.min.js:2, …
  • A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×2) — .jazzy/theme/assets/js/jquery.min.js:2, REDACTED:7

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure4.8 / 10Weak✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — REDACTED:2, Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:3
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — REDACTED:71
  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). — Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:3

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. — REDACTED:29

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC6 · Visual & motion safety3.5 / 10Weak✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • outline:none/0 with no :focus rule in the same stylesheet removes the focus ring. Provide a visible :focus / :focus-visible style. — Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:9

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 11 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.

What to do

  • Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.
AX10 · Code composition9.8 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

ES1 · Fold determinism10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.

Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (a `struct` with `let` fields) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

M1 · Documentation (README)7.3 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy7.0 / 10Strong◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README omits the StripePaymentsUI project entirely — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.

What to do

  • Reconcile the README with reality: README omits the StripePaymentsUI project entirely.
P1 · CI/CD gates8.5 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

What to do

  • Run the test suite in CI via an explicit runner step for your stack, and gate merges on it.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability6.1 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 5/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `Stripe`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 14061 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

WCAG coverage — what static analysis assessed

Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 43 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.1.1, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health85%StrongSolid.
Architecture88%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity60%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness47%Weak — gated by D13, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security61%Adequate — gated by D28, D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility29%Weak — gated by AC2, AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Unscored — 1 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 5 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 66 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Ruby, Swift source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift has 215,945 production line(s), 6 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
  • PF3 Async & latency hygiene — Sync-over-async was not assessed: this repository's async code is written in Swift, whose blocking calls this check does not model yet. That is a gap in the analyzer's language reach, not a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 44 finding(s)
D28 · Secrets (history) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D13 · REDACTED Scanning · Leaked secret · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×4
  • Orphaned knowledge StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/SheetViewController.swift — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge StripeCardScan/StripeCardScan/Source/CardScan/UI/ScanBaseViewController.swift — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
  • Orphaned knowledge StripeCardScan/StripeCardScan/Source/CardScan/UI/SimpleScanViewController.swift — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
AC2 · Forms & labels · Link with no accessible name · ×2
  • Link with no accessible name .jazzy/theme/assets/js/jquery.min.js:2 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
  • Link with no accessible name REDACTED:7 — A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
AC2 · Forms & labels · <input> without a programmatic label · ×2
  • <input> without a programmatic label .jazzy/theme/assets/js/jquery.min.js:2 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:139 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D10 · Test Quality · Assertions commented out · ×2
  • Assertions commented out: test_codingOfDecimal StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:578 — The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
  • Assertions commented out: testExample Tests/installation_tests/size_test/SPMTestUITests/SPMTestUITests.swift:26 — The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
AC2 · Forms & labels · <select> without a programmatic label · ×1
  • <select> without a programmatic label .jazzy/theme/assets/js/jquery.min.js:2 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label .jazzy/theme/assets/js/jquery.min.js:2 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC3 · Page structure · <html> without a lang · ×1
  • <html> without a lang Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:3 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
D10 · Test Quality · No assertions (empty test) · ×1
  • No assertions (empty test): testNull Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift:47 — Test method has an empty body — it asserts nothing and exercises no code.
D14 · License Compliance · Banned license · ×1
  • Banned license: colorize — `colorize` 1.1.0 is published on rubygems.org under GPL-2.0, which this policy bans, and it is in the RUNTIME closure of this repository's Bundler manifests — so it is installed by everything that installs this repository, not just by its test harness. Replace it, or record an accepted exception.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 1178 finding(s)
D17 · Explicit Debt · TodoComment · ×195
  • TodoComment Example/CardImageVerification Example/CardImageVerification Example/View Controllers/VerificationExplanationViewController.swift:11 — /// TODO(jaimepark) Internal structs. Find better place — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/CardImageVerification Example/CardImageVerification Example/Views/CTAButton.swift:11 — /// TODO(jaimepark): Make CTAButton with activity indicator an encapsulated object instead of extending uibutton. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:243 — // TODO(mats): Investigate failure and reenable. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:141 — // TODO(ccen) enable phoneOtpContainerView when backend adds support to PII — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/Non-Card Payment Examples/Non-Card Payment Examples/KeyboardAvoidingScrollView.swift:140 — // TODO: extract animation curve from `keyboardAnimationCurveUserInfoKey` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:51 — // TODO(https://jira.corp.stripe.com/browse/MOBILESDK-2577) Show client-side confirm, not server-side confirm.
  • TodoComment Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:239 — // TODO: Refactor this to make the ephemeral key and customerId fetching async — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetVerticalUITests.swift:226 — // TODO(porter) Use the vertical mode to save cards when ready — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetLinkUITests.swift:683 — // TODO(porter) Fill in embedded UI test steps — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Example/PaymentSheet Example/PaymentSheetUITest/PaymentSheetLinkUITests.swift:735 — // TODO: This is disabled until the Link team adds some hooks for testing. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Stripe/StripeiOSTests/TextFieldElement+IBANTest.swift:117 — // TODO(mludowise): These should get migrated to a shared StripeUICoreTestUtils target — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeUICore/StripeUICoreTests/Unit/Elements/TextFieldElement+AddressFactoryTest.swift:201 — // TODO(mludowise): These should get migrated to a shared StripeUICoreTestUtils target — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Stripe/StripeiOSTests/STPApplePayFunctionalTest.swift:22 — // TODO: regenerate these fixtures with a fresh/real PKPayment — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Stripe/StripeiOSTests/OneTimeCodeTextFieldTests.swift:85 — // TODO(RUN_MOBILESDK-1848): This test is broken on iOS 16, as it invokes the pasteboard permission dialog — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:754 — // TODO: (MOBILESDK-467) Grab the actual error from the SetupIntent
  • TodoComment StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:814 — // TODO: (MOBILESDK-467) Grab the actual error from the PaymentIntent
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/SetupIntent.swift:15 — // TODO: (MOBILESDK-467) Add modern bindings for more SetupIntent fields
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/SetupIntent.swift:37 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentMethod.swift:35 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentMethod.swift:71 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentMethod.swift:140 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntentParams.swift:82 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:82 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:95 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:109 — // TODO: This is @frozen because of a bug in the Xcode 12.2 Swift compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 170 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×106
  • No assertions: testUpdateShouldCallTheCompletionBlock Stripe/StripeiOSTests/ConfirmButtonTests.swift:60 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testUpdateShouldCallTheCompletionBlockWhenAnimated Stripe/StripeiOSTests/ConfirmButtonTests.swift:75 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testPaymentSheetAnalyticEvents Stripe/StripeiOSTests/HostedSurfaceTest.swift:31 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCustomerSheetAnalyticEvents Stripe/StripeiOSTests/HostedSurfaceTest.swift:36 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnqueueShouldDebounce Stripe/StripeiOSTests/OperationDebouncerTests.swift:19 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testExpiredCard Stripe/StripeiOSTests/STPCardFormViewTests.swift:272 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testIncorrectCVC Stripe/StripeiOSTests/STPCardFormViewTests.swift:276 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testIncorrectCardNumber Stripe/StripeiOSTests/STPCardFormViewTests.swift:280 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCardDeclined Stripe/StripeiOSTests/STPCardFormViewTests.swift:284 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testProcessingError Stripe/StripeiOSTests/STPCardFormViewTests.swift:288 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testTokenCreation_customer Stripe/StripeiOSTests/STPConnectAccountFunctionalTest.swift:47 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testTokenCreation_company Stripe/StripeiOSTests/STPConnectAccountFunctionalTest.swift:53 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testTokenCreation_empty_init Stripe/StripeiOSTests/STPConnectAccountFunctionalTest.swift:59 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCardIconMethods Stripe/StripeiOSTests/STPImageLibraryTests.swift:32 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testBrandImageForCardBrand Stripe/StripeiOSTests/STPImageLibraryTests.swift:67 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testCVCImageForCardBrand Stripe/StripeiOSTests/STPImageLibraryTests.swift:132 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testErrorImageForCardBrand Stripe/StripeiOSTests/STPImageLibraryTests.swift:151 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testUpdatingObservers Stripe/StripeiOSTests/STPInputTextFieldValidatorTests.swift:40 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testEnterForegroundDoesNotRefreshResourceKeyIfNotExpiring StripeIssuing/StripeIssuingTests/STPEphemeralKeyManagerTest.swift:141 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testThrottlingEnterForegroundRefreshes StripeIssuing/StripeIssuingTests/STPEphemeralKeyManagerTest.swift:148 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNewInstancesReportShownIndependently StripePaymentsUI/StripePaymentsUITests/CardElementAnalyticsTests.swift:67 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testTextChangesReportInteractionWithoutFocus StripePaymentsUI/StripePaymentsUITests/CardElementAnalyticsTests.swift:98 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testValidationChangesAloneDoNotReportInteraction StripePaymentsUI/StripePaymentsUITests/CardElementAnalyticsTests.swift:164 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testLaunchPerformance Example/CardImageVerification Example/CardImageVerification ExampleUITests/CardImageVerification_ExampleUITests.swift:62 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: testNativeNetworkingTestMode REDACTED:13 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • + 81 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×67
  • Low cohesion: WalletViewController (LCOM4 16) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController-WalletViewController.swift:436 — WalletViewController's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: View (LCOM4 16) Example/CryptoOnramp Example/CryptoOnramp Example/View+WalletOwnershipVerification.swift:10 — View's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: String (LCOM4 16) Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:1278 — String's methods fall into 16 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 16 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UIView (LCOM4 15) Example/PaymentSheet Example/PaymentSheet Example/AppDelegate+BrokenConstraints.swift:70 — UIView's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Dictionary (LCOM4 13) StripeCore/StripeCore/Source/Categories/Dictionary+Stripe.swift:11 — Dictionary's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: STPAPIClient (LCOM4 12) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13 — STPAPIClient's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: BottomSheetViewController (LCOM4 12) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/BottomSheetViewController.swift:17 — BottomSheetViewController's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ConnectWebViewController (LCOM4 10) StripeConnect/StripeConnect/Source/Internal/Webview/ConnectWebViewController.swift:26 — ConnectWebViewController's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: OneTimeCodeTextField (LCOM4 10) StripeUICore/StripeUICore/Source/Controls/OneTimeCodeTextField.swift:13 — OneTimeCodeTextField's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: Array (LCOM4 10) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:403 — Array's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PlaygroundController (LCOM4 9) Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:21 — PlaygroundController's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: DocumentCaptureViewController (LCOM4 8) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:15 — DocumentCaptureViewController's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AddressViewController (LCOM4 8) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/AddressViewController/AddressViewController.swift:25 — AddressViewController's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MainViewController (LCOM4 8) Example/IdentityVerification Example/IdentityVerification Example/MainViewController.swift:10 — MainViewController's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: UIViewController (LCOM4 8) Example/PaymentSheet Example/PaymentSheet Example/ViewController.swift:53 — UIViewController's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: VerificationFlowWebViewController (LCOM4 7) StripeIdentity/StripeIdentity/Source/WebWrapper/VerificationFlowWebViewController.swift:35 — VerificationFlowWebViewController's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: STPApplePayContext (LCOM4 6) StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:159 — STPApplePayContext's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SSDOcrOutput (LCOM4 6) StripeCardScan/StripeCardScan/Source/CardScan/MLModels/SSDOcr.swift:85 — SSDOcrOutput's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SelfieCaptureViewController (LCOM4 6) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:15 — SelfieCaptureViewController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ApplePayContextClosureDelegate (LCOM4 6) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:18 — ApplePayContextClosureDelegate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: AutoCompleteViewController (LCOM4 6) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/AutoComplete/AutoCompleteViewController.swift:23 — AutoCompleteViewController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SceneDelegate (LCOM4 6) StripePayments/StripePaymentsTestHostApp/SceneDelegate.swift:10 — SceneDelegate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SceneDelegate (LCOM4 6) Example/IdentityVerification Example/IdentityVerification Example/SceneDelegate.swift:10 — SceneDelegate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SceneDelegate (LCOM4 6) Example/PaymentSheet Example/PaymentSheet Example/SceneDelegate.swift:13 — SceneDelegate's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MainViewController (LCOM4 6) Example/StripeConnectExample/StripeConnectExample/MainViewController.swift:12 — MainViewController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • + 42 more in this group — see findings.md.
D17 · Explicit Debt · HackComment · ×37
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:615 — // Hack, should do this in SwiftUI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:717 — // Hack, should do this in SwiftUI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:60 — // Hack, should do this in SwiftUI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:644 — // Hack to ensure we don't force the native flow unless we're in a UI test — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:33 — // Hack to ensure we don't force the native flow unless we're in a UI test — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:672 — // Hack to enable incentives in Instant Debits — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetLocalizationScreenshotGenerator.swift:206 — // hacky to double tap but fixes transition if software keyboard is enabled — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetLocalizationScreenshotGenerator.swift:215 — // hacky to double tap but fixes transition if software keyboard is enabled — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment Example/PaymentSheet Example/PaymentSheetUITest/CustomerSheetUITest.swift:960 — // Hack - we do this twice since the first tap only dismisses the keyboard — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripeCardScan/StripeCardScan/Source/CardScan/UI/ScanBaseViewController.swift:485 — // hack to work around having to change our interface — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetAppearance+Helpers.swift:44 — // Hack: `ElementsAppearance` doesn't have a primary button corner radius. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElement.swift:187 — // Hacky solution: We determine which one to pick based on which one last reported a payment option update. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:284 — // Hack to get the accessory view to update — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:319 — // Hack to get the accessory view to update — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentMethodsView.swift:120 — /// Hacky - ideally we have a RowButtonViewModel type of object that keeps track of this state. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentMethodsView.swift:604 — // Hack: We assume the accessory view is "Change >" — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentMethodsView.swift:620 — // Hack: We assume the accessory view is "Change >" — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:196 — // Hack: If Embedded has not been presented yet, we may not have a VC. If that's the case, populate it with the default VC for the window. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:347 — // Hack: PaymentHandler calls the completion block while SafariVC is still being dismissed - "wait" until it's finished before updating UI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:726 — // Hack: PaymentHandler calls the completion block while SafariVC is still being dismissed - "wait" until it's finished before updating UI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:496 — // Hack: PaymentHandler calls the completion block while SafariVC is still being dismissed - "wait" until it's finished before updating UI — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/PaymentMethodTypeCollectionView.swift:345 — // Hacky workaround: If we update unconditionally, we'll overwrite the current PM's valid image with a 1x1 placeholder here — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:241 — // Hack: Payment container needs to extend to the edges, so we'll 'cancel out' the layout margins with negative padding — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:322 — // Hack: Payment container needs to extend to the edges, so we'll 'cancel out' the layout margins with negative padding — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:403 — // Hack: This line causes PaymentSheetSnapshotTests to fail on iOS 26 - the sheet becomes transparent. I can't figure out a fix, so just remove it out for tests. — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
  • + 12 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×36
  • MethodTooLong: STPPaymentHandler.logConfirmSetupIntentCompleted StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:97 — MethodTooLong — logConfirmSetupIntentCompleted runs 1519 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1419 over it, 15.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPPaymentMethodParams.nonnil_billingDetails StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:13 — MethodTooLong — nonnil_billingDetails runs 550 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 450 over it, 5.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: DocumentCaptureViewController.titleText StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:14 — MethodTooLong — titleText runs 418 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 318 over it, 4.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ConfirmButton.makeLinkButton StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift:13 — MethodTooLong — makeLinkButton runs 342 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 242 over it, 3.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetLoader.loadLink StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:12 — MethodTooLong — loadLink runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPPaymentHandler._handleAuthenticationForCurrentAction StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111 — MethodTooLong — _handleAuthenticationForCurrentAction runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AddressDetails.stpAddress StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift:9 — MethodTooLong — stpAddress runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetFormFactory.makeKlarna StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:11 — MethodTooLong — makeKlarna runs 296 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetFormFactory.makeAfterpayClearpay StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:12 — MethodTooLong — makeAfterpayClearpay runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetFormFactory.appendingAutomaticTaxAddressIfNecessary StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:17 — MethodTooLong — appendingAutomaticTaxAddressIfNecessary runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetFormFactory.makePix StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:13 — MethodTooLong — makePix runs 294 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 194 over it, 2.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentSheetFormFactory.makeEPS StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:15 — MethodTooLong — makeEPS runs 292 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Result.success StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift:12 — MethodTooLong — success runs 245 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Configuration.makeAddressViewControllerConfiguration StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift:10 — MethodTooLong — makeAddressViewControllerConfiguration runs 243 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 143 over it, 2.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CheckoutController.confirmApplePay StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:14 — MethodTooLong — confirmApplePay runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: CheckoutController.expressCheckoutElementShouldConfirm StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:15 — MethodTooLong — expressCheckoutElementShouldConfirm runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SelfieCaptureViewController.initialInstructionText StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:12 — MethodTooLong — initialInstructionText runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPPaymentCardTextField.recalculateSubviewLayout StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320 — MethodTooLong — recalculateSubviewLayout runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PaymentPagesAPIResponse.makeAmount StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse.swift:14 — MethodTooLong — makeAmount runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Button.primary StripeUICore/StripeUICore/Source/Controls/Button.swift:13 — MethodTooLong — primary runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: LinkAccountPickerViewController.didSelectConnectAccounts StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerViewController.swift:246 — MethodTooLong — didSelectConnectAccounts runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Intent.sellerDetails StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift:11 — MethodTooLong — sellerDetails runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPAUBECSDebitFormView.init StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPAUBECSDebitFormView.swift:45 — MethodTooLong — init runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPPaymentHandler._retrieveAndCheckIntentForCurrentAction StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1584 — MethodTooLong — _retrieveAndCheckIntentForCurrentAction runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: STPApplePayContext._completePayment StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:660 — MethodTooLong — _completePayment runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 11 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×27
  • TooManyMethods: STPAPIClient StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13 — TooManyMethods — 198 methods. The bar is 30 methods; this is 168 over it, 6.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: STPAnalyticsClient StripeCore/StripeCore/Source/Analytics/STPAnalyticsClient.swift:26 — TooManyMethods — 104 methods. The bar is 30 methods; this is 74 over it, 3.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NativeFlowController StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:31 — TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaymentSheetFormFactory StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:20 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: STPPaymentMethodParams StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:16 — TooManyMethods — 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: STPPaymentCardTextField StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:19 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: STPPaymentHandler StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:100 — TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FinancialConnectionsAsyncAPIClient StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:11 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaymentSheet StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:46 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LinkController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:17 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EmbeddedPaymentElement StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:15 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaymentSheetVerticalViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:14 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CryptoOnrampCoordinator REDACTED:240 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ScanBaseViewController StripeCardScan/StripeCardScan/Source/CardScan/UI/ScanBaseViewController.swift:9 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CheckoutController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:18 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OneTimeCodeTextField StripeUICore/StripeUICore/Source/Controls/OneTimeCodeTextField.swift:13 — TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AddressViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/AddressViewController/AddressViewController.swift:25 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CustomerSavedPaymentMethodsViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:21 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: STPPaymentMethod StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:15 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SimpleScanViewController StripeCardScan/StripeCardScan/Source/CardScan/UI/SimpleScanViewController.swift:67 — TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ConnectWebViewController StripeConnect/StripeConnect/Source/Internal/Webview/ConnectWebViewController.swift:26 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: VerificationSheetController StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:132 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PayWithLinkViewController StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift:72 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PaymentSheetFlowControllerViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:17 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PartnerAuthViewController StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift:34 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×27
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:108 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:108-117 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:100-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:108` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/AddressViewController/AddressViewController.swift:765 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/AddressViewController/AddressViewController.swift:765-774 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:323-332 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/AddressViewController/AddressViewController.swift:765` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:644 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:644-653 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:557-566 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentFooterView.swift:73 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentFooterView.swift:73-83 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/PaneLayoutView/PaneLayoutView+Extensions.swift:251-260 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentFooterView.swift:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift:133 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift:133-142 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupViewController.swift:177-186 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift:133` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:421 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:421-430 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:434-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:318 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:318-327 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:341-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:381 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:381-390 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:612-621 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:278 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:278-287 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:294-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:453 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:453-462 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:744-753 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:453` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `intentID` to `paymentIntentID` in one and `setupIntentID` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:585 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:585-594 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:776-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:585` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:583` calls `isNextActionSuccessState` and `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:774` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/ConnectionsFCLiteVsNative.swift:17 — StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/ConnectionsFCLiteVsNative.swift:17-26 | StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/ConnectionsFCLiteVsNativeAA.swift:17-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:328 — StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:328-337 | StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Controllers/FCLiteContainerViewController.swift:309-318 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:447 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:447-456 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:271-280 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:61 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:61-70 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:663-672 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/WalletHeaderView.swift:253 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/WalletHeaderView.swift:253-262 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RightAccessoryButton.swift:148-157 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift:75 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift:75-84 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupDataSource.swift:73-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:18 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:18-27 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/LegalDetailsNoticeViewController.swift:18-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerPreviewView.swift:180 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerPreviewView.swift:180-189 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:676-685 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerPreviewView.swift:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:672` calls `VStack`, `Text`, `font` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerPreviewView.swift:179` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIViews.swift:113 — Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIViews.swift:113-122 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:676-685 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIViews.swift:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/AttachWalletAddressView.swift:39 — Example/CryptoOnramp Example/CryptoOnramp Example/AttachWalletAddressView.swift:39-48 | Example/CryptoOnramp Example/CryptoOnramp Example/RegistrationView.swift:61-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/AttachWalletAddressView.swift:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:180 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:180-189 | Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:202-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:28 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:28-37 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:28-37 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:203 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:203-212 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:203-212 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:610 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:610-619 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:610-619 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • + 2 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×25
  • FileTooLong: PaymentHandler/STPPaymentHandler.swift StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift — FileTooLong — 1797 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: STPPaymentHandler (100-2444). The bar is 500 significant lines; this is 1297 over it, 3.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: UI Components/STPPaymentCardTextField.swift StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift — FileTooLong — 1420 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: STPPaymentCardTextField (21-2434). The bar is 500 significant lines; this is 920 over it, 2.84× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Native/NativeFlowController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift — FileTooLong — 1237 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 737 over it, 2.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: PaymentSheetFormFactory/PaymentSheetFormFactory.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift — FileTooLong — 984 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 484 over it, 1.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Link/LinkController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift — FileTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 474 over it, 1.95× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: PaymentMethods/STPPaymentMethodParams.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift — FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: STPPaymentMethodParams (16-992). The bar is 500 significant lines; this is 347 over it, 1.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Vertical Main Screen/PaymentSheetVerticalViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift — FileTooLong — 807 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: PaymentSheetVerticalViewController (14-880). The bar is 500 significant lines; this is 307 over it, 1.61× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: PaymentSheet/PaymentSheet+API.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift — FileTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 265 over it, 1.53× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: CustomerSheet/CustomerSavedPaymentMethodsViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift — FileTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: CustomerSavedPaymentMethodsViewController (22-847). The bar is 500 significant lines; this is 208 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Helpers/STPBankAccountCollector.swift StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift — FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded), about 90% of them inside a single declaration: STPBankAccountCollector (29-966). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: PaymentSheet/PaymentSheetFlowController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFlowController.swift — FileTooLong — 706 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 206 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: API Bindings/FinancialConnectionsAsyncAPIClient.swift StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift — FileTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 200 over it, 1.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 693 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: CryptoOnrampCoordinator (241-863). The bar is 500 significant lines; this is 193 over it, 1.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Saved Payment Method Screen/SavedPaymentOptionsViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift — FileTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 172 over it, 1.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Link/STPAPIClient+Link.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift — FileTooLong — 609 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 109 over it, 1.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Controllers/PayWithLinkViewController.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift — FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 85 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Embedded/EmbeddedPaymentElement+Internal.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift — FileTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 84 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ApplePayContext/STPApplePayContext.swift StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift — FileTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: STPApplePayContext (160-939). The bar is 500 significant lines; this is 79 over it, 1.16× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Controllers/PayWithLinkViewController-WalletViewController.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController-WalletViewController.swift — FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 62 over it, 1.12× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ViewControllers/PaymentSheetFlowControllerViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift — FileTooLong — 558 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: PaymentSheetFlowControllerViewController (17-613). The bar is 500 significant lines; this is 58 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Coordinators/VerificationSheetFlowController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetFlowController.swift — FileTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 57 over it, 1.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ViewControllers/DocumentCaptureViewController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift — FileTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: DocumentCaptureViewController (15-640). The bar is 500 significant lines; this is 50 over it, 1.10× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: ViewControllers/PaymentMethodFormViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift — FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: PartnerAuth/PartnerAuthViewController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift — FileTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: PartnerAuthViewController (34-723). The bar is 500 significant lines; this is 27 over it, 1.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Vertical Main Screen/RowButton.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButton.swift — FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 19 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×25
  • Duplicated block (9 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:97 — StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:97-105 | StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:113-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:541 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:541-549 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:841-849 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:541` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:550` calls `reloadData` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:850` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:831 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:831-839 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:857-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:831` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:129 — StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:129-137 | StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:221-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:129` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1418 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1418-1426 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1429-1437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2635 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2635-2643 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2670-2678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2635` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Example/AppClipExample/Shared/BackendModel.swift:43 — Example/AppClipExample/Shared/BackendModel.swift:43-51 | Testers/IntegrationTester/IntegrationTester/Source/Models/BackendModel.swift:54-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Example/AppClipExample/Shared/BackendModel.swift:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:427 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:427-435 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:721-729 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:388 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:388-396 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/AttachLinkedPaymentAccount/AttachLinkedPaymentAccountViewController.swift:164-172 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:245 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:245-253 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:322-330 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodOXXO.swift:31 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodOXXO.swift:31-39 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSwish.swift:30-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:224 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:224-232 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkLoginWarmup/NetworkingLinkLoginWarmupBodyView.swift:111-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextField.swift:50 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextField.swift:50-58 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextField.swift:29-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNetBanking.swift:21 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNetBanking.swift:21-29 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAutomaticPaymentMethods.swift:17-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/HitTestStackView.swift:16 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/HitTestStackView.swift:16-24 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/HitTestView.swift:16-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/UI Helpers/PrimaryButtonStyle.swift:11 — Example/CryptoOnramp Example/CryptoOnramp Example/UI Helpers/PrimaryButtonStyle.swift:11-19 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:721-729 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:92 — Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:92-100 | Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:68-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:174 — Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:174-182 | Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:188-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:174` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:413 — Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:413-421 | Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:445-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `selection` to `customHeadlineFontBinding` in one and `primaryButtonFontBinding` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:913 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:913-921 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:913-921 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 2) Example/CardImageVerification Example/CardImageVerification Example/View Controllers/VerificationExplanationViewController.swift:68 — Example/CardImageVerification Example/CardImageVerification Example/View Controllers/VerificationExplanationViewController.swift:68-76 | Example/CardImageVerification Example/CardImageVerification Example/View Controllers/ViewController.swift:13-21 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:521 — Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:521-529 | Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:541-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:222 — StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:222-230 | StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:313-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:53 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:53-61 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:52-60 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:110 — Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:110-118 | Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift:105-113 — before extracting anything, compare `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift` and `Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×25
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:444 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:444-451 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:229-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:35 — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:35-42 | StripeApplePay/StripeApplePay/Source/PaymentsCore/API/SetupIntent+API.swift:34-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:35` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping PaymentIntentCompletionBlock` in one and `@escaping SetupIntentCompletionBlock` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (8 lines × 2) StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/OcrPriorsGen.swift:95 — StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/OcrPriorsGen.swift:95-102 | StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/OcrPriorsGen.swift:109-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/OcrPriorsGen.swift:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:72 — StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:72-79 | StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:151-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:71` calls `escaping` and `StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:150` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:339 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:339-346 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:383-390 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:339` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:423 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:423-430 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:35-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:185 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:185-192 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:199-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift:618 — StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift:618-625 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:2415-2422 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:130 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:130-137 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:215-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:555 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:555-562 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:639-646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:555` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1650 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1650-1659 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1747-1754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1650` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:655 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:655-662 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:568-575 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:543 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:543-550 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift:296-303 — before extracting anything, compare `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift` and `StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:557 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:557-564 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift:311-318 — before extracting anything, compare `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift` and `StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:139 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:139-146 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:172-179 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:344 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:344-351 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:496-503 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntentParams.swift:96 — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntentParams.swift:96-103 | StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntentConfirmParams.swift:199-206 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/Views/BottomAlignedLabel.swift:85 — StripeIdentity/StripeIdentity/Source/NativeComponents/Views/BottomAlignedLabel.swift:85-92 | StripeIdentity/StripeIdentity/Source/NativeComponents/Views/IdentityHTMLView/IconLabelHTMLView.swift:92-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift:73 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift:73-80 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:53-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:214 — StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:214-221 | StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:263-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:68 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:68-75 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:605-612 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:207 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:207-214 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:801-808 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:120 — Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:120-127 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift:115-122 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:75 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:75-82 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:75-82 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:127 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:127-134 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:127-134 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×24
  • Duplicated block (7 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:71 — StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:71-77 | StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:219-225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:64 — StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:64-70 | StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:78-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:64` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Address.swift:45 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Address.swift:45-56 | StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift:61-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Address.swift:45` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (7 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionOXXODisplayDetails.swift:54 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionOXXODisplayDetails.swift:54-60 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionVerifyWithMicrodeposits.swift:72-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElement.swift:30 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElement.swift:30-36 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Shipping Address Element/ShippingAddressElement.swift:75-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:187 — StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:187-193 | StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardViewController.swift:302-308 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:806 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:806-812 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:659-665 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:668` calls `set` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:816` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Consent/LinkFullConsent-EmailView.swift:47 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Consent/LinkFullConsent-EmailView.swift:47-53 | StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Consent/LinkFullConsent-ScopesView.swift:125-131 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentMethodsView.swift:341 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentMethodsView.swift:341-347 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift:224-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextFieldFormatter.swift:30 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextFieldFormatter.swift:30-36 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPNumericDigitInputTextFormatter.swift:43-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift:599 — StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift:599-605 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:2396-2402 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionBoletoDisplayDetails.swift:61 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionBoletoDisplayDetails.swift:61-67 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionMultibancoDisplayDetails.swift:66-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlipay.swift:29 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlipay.swift:29-35 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBLIK.swift:30-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:69 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:69-75 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/AttachLinkedPaymentAccount/AttachLinkedPaymentAccountViewController.swift:53-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationVerticalViewController.swift:23 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationVerticalViewController.swift:23-29 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationViewController.swift:56-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:1001 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:1001-1007 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2459-2465 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `code` to `STPCollectBankAccountError` in one and `STPPaymentHandlerErrorCode` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:382 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:382-388 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:400-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:298 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:298-304 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:549-555 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:548` calls `constraint` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:297` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:887 — Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:887-893 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:1000-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/BoletoExampleViewController.swift:167 — Example/Non-Card Payment Examples/Non-Card Payment Examples/BoletoExampleViewController.swift:167-173 | Example/PaymentSheet Example/PaymentSheet Example/EmbeddedPaymentElementWrapperViewController.swift:46-52 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:216 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:216-222 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:28-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:32 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:32-38 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:248-254 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:32` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:181 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:181-187 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:334-340 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (7 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:59 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:59-65 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:614-620 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×23
  • Duplicated block (6 lines × 2) StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:45 — StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:45-50 | StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:182-187 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) StripeConnect/StripeConnect/Source/Helpers/Appearance+Encoding.swift:68 — StripeConnect/StripeConnect/Source/Helpers/Appearance+Encoding.swift:68-73 | StripeConnect/StripeConnect/Source/Helpers/Appearance+Encoding.swift:83-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:1087 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:1087-1097 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:1138-1143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:1087` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) StripeCore/StripeCore/Source/Analytics/AnalyticsClientV2.swift:128 — StripeCore/StripeCore/Source/Analytics/AnalyticsClientV2.swift:128-133 | StripeCore/StripeCore/Source/Analytics/STPAnalyticsClient.swift:211-216 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetDeferredValidator.swift:60 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetDeferredValidator.swift:60-65 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetDeferredValidator.swift:77-82 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetDeferredValidator.swift:60` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+SEPADebit.swift:22 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+SEPADebit.swift:22-27 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+USBankAccount.swift:25-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+SEPADebit.swift:22` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountCompanyParams.swift:107 — StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountCompanyParams.swift:107-112 | StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift:124-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountCompanyParams.swift:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountCompanyParams.swift:104` calls `NSNumber` and `StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift:123` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:44 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:44-49 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsParams.swift:58-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:44` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:84 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:84-89 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodAddress.swift:76-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift:149 — StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift:149-154 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccountParams.swift:100-105 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift:149` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedAllBoxes.swift:12 — StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedAllBoxes.swift:12-17 | StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedAllOcrBoxes.swift:13-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKrCard.swift:32 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKrCard.swift:32-37 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNaverPay.swift:32-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:52 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:52-57 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/AttachLinkedPaymentAccount/AttachLinkedPaymentAccountViewController.swift:36-41 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionPickerViewController.swift:296 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionPickerViewController.swift:296-301 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkLoginWarmup/NetworkingLinkLoginWarmupBodyView.swift:28-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionSearchBar.swift:183 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionSearchBar.swift:183-188 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerNewAccountRowView.swift:55-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPCard.swift:174 — StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPCard.swift:174-179 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPSourceCardDetails.swift:105-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) Example/StripeConnectExample/StripeConnectExample/NotificationBannerExampleViewController.swift:230 — Example/StripeConnectExample/StripeConnectExample/NotificationBannerExampleViewController.swift:230-235 | StripeUICore/StripeUICore/Source/Elements/SubtitleElement.swift:28-33 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:316 — Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:316-322 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CurrencySelectorAppearancePlaygroundView.swift:94-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/AppearancePlaygroundView.swift:316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:412 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:412-417 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:121-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:412` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:57 — Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:57-62 | Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:68-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:630 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:630-636 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:674-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:630` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:636 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:636-641 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:743-748 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:636` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:259 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:259-264 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:326-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:259` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D15 · Churn × Complexity Hotspots · Hotspot · ×19
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:429 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift changed 51 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in CheckoutController.confirmCheckoutSession at line 429. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:241 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in PaymentSheetFormFactory.makePaymentMethodForm at line 241. 1 of those changes was a fix/bug commit, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in STPPaymentHandler._handleAuthenticationForCurrentAction at line 1111. 2 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:219 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in STPPaymentMethodType.makeImage at line 219. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:1349 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in STPPaymentMethodParams.init at line 1349. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:238 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in PaymentSheet.confirmAfterHandlingLocalActions at line 238. 1 of those changes was a fix/bug commit, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:180 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in EmbeddedPaymentElement.performUpdate at line 180. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:182 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PaymentSheetFlowControllerViewController.init at line 182. 5 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift:629 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in PayWithLinkViewController.launchFinancialConnections at line 629. 1 of those changes was a fix/bug commit, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:60 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in PaymentSheetLoader.load at line 60. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift:68 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in CryptoOnrampAnalyticsEvent.eventName at line 68. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:466 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PaymentMethodFormViewController.handleCollectBankAccount at line 466. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:353 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in STPIntentAction.decodedObject at line 353. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift:354 — StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in AddressSectionElement.updateAddressFields at line 354. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift:244 — Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in CryptoOnrampFlowCoordinator.advanceToNextStep at line 244. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampFlowCoordinator.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift:53 — Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in CryptoOnrampExampleView.body at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetExampleAppRootView.swift Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetExampleAppRootView.swift:138 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetExampleAppRootView.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in NavigationDestination.displayTitle at line 138. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetExampleAppRootView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift:186 — Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in KYCInfoView.body at line 186. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:153 — StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in FinancialConnectionsWebFlowViewController.startAuthenticationSession at line 153. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:57:13 +00:00' --until='2026-09-30 17:57:13 +00:00' --full-history --no-merges -- StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×18
  • Duplicated block (12 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift:162 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift:162-173 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift:177-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:429 — StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:429-440 | StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:593-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:429` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:399 — StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:399-410 | StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:411-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:81 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:81-92 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:107-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:81` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:119` calls `complete` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:93` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:53 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:53-64 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift:62-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetails.swift:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionAlipayHandleRedirect.swift:67 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionAlipayHandleRedirect.swift:67-78 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionRedirectToURL.swift:84-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionAlipayHandleRedirect.swift:66` calls `URL` and `StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionRedirectToURL.swift:83` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) Example/AppClipExample/Shared/ContentView.swift:41 — Example/AppClipExample/Shared/ContentView.swift:41-52 | Testers/IntegrationTester/IntegrationTester/Source/HelperViews/HelperViews.swift:39-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Example/AppClipExample/Shared/ContentView.swift:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Testers/IntegrationTester/IntegrationTester/Source/HelperViews/HelperViews.swift:52` calls `Text` and `Example/AppClipExample/Shared/ContentView.swift:53` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Helpers/STPVisionSupport.swift:13 — StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Helpers/STPVisionSupport.swift:13-24 | StripePaymentSheet/StripePaymentSheet/Source/Internal/Helpers/STPVisionSupport.swift:13-24 — before extracting anything, compare `StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Helpers/STPVisionSupport.swift` and `StripePaymentSheet/StripePaymentSheet/Source/Internal/Helpers/STPVisionSupport.swift` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:189 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:189-200 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:260-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationViewController.swift:204 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationViewController.swift:204-215 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingSaveToLinkVerification/NetworkingSaveToLinkVerificationViewController.swift:206-217 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:439 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:439-450 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:477-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:46 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:46-57 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:43-54 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:63 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:63-74 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:66-77 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 103 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:258 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:258-269 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:258-269 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:493 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:493-504 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:493-504 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartContentView.swift:246 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartContentView.swift:246-257 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartPaymentButton.swift:46-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartContentView.swift:246` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:115 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:115-126 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:115-126 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (12 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:506 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:506-517 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:506-517 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×17
  • Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:614 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:614-624 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:635-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:614` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:652 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:652-662 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:905-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Common/FinancialConnectionsNavigationController.swift:162 — StripeFinancialConnections/StripeFinancialConnections/Source/Common/FinancialConnectionsNavigationController.swift:162-172 | StripeFinancialConnections/StripeFinancialConnections/Source/Common/FinancialConnectionsNavigationController.swift:179-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Common/FinancialConnectionsNavigationController.swift:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.swift:109 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.swift:109-119 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/AfterpayPriceBreakdownView.swift:135-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.swift:109` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/PaneLayoutView/PaneLayoutView+Extensions.swift:252 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/PaneLayoutView/PaneLayoutView+Extensions.swift:252-262 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/PaneLayoutView/PaneLayoutView+Extensions.swift:306-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:96 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:96-106 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/AddPaymentMethodViewController.swift:131-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:96` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift:222 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift:222-232 | StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntentConfirmParams.swift:137-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift:222` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (11 lines × 2) StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:24 — StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:24-34 | StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:114-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:24` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPConfirmLinkOptions.swift:25 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPConfirmLinkOptions.swift:25-35 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPConfirmUSBankAccountOptions.swift:18-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPConfirmLinkOptions.swift:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentDataSource.swift:103 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentDataSource.swift:103-113 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift:135-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:197 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:197-207 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:257-267 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:625 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:625-635 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift:388-398 — before extracting anything, compare `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift` and `StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:245 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:245-255 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFlowController+AsyncPublicAPIs.swift:104-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:453 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:453-463 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:491-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:290 — StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:290-300 | StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:305-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePaymentsTestUtils/STPFixtures+Swift.swift:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:373 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:373-383 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:75-85 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:93 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:93-103 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:94-104 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×16
  • Duplicated block (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:782 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:782-795 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:805-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:782` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Radar.swift:27 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Radar.swift:27-40 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Radar.swift:83-96 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Radar.swift:27` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:555 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:555-568 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:678-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:555` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/API Client/FCLiteApiClient.swift:40 — StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/API Client/FCLiteApiClient.swift:40-53 | StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/API Client/FCLiteApiClient.swift:61-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/API Client/FCLiteApiClient.swift:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:131 — StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:131-144 | StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:156-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEMultiPartnerView.swift:50 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEMultiPartnerView.swift:50-63 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.swift:31-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEMultiPartnerView.swift:50` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:29 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:29-42 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift:39-52 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Card.swift:63 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Card.swift:63-76 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Link.swift:52-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Card.swift:63` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/String+Extensions.swift:100 — StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/String+Extensions.swift:100-113 | StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/String+Extensions.swift:119-132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:651 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:651-664 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:338-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:666 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:666-679 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:353-366 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:652 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:652-665 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:689-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:652` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:649` calls `InfoRow` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:687` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/PaymentView.swift:787 — Example/CryptoOnramp Example/CryptoOnramp Example/PaymentView.swift:787-800 | Example/CryptoOnramp Example/CryptoOnramp Example/PaymentView.swift:838-851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/PaymentView.swift:787` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:66 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:66-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:65-78 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:66 — Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:66-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:68-81 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:60 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:60-73 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:60-73 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D35 · Change Coupling · Change coupling · ×14
  • Change coupling: DocumentScanner.swift ↔ DocumentCaptureViewController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/DocumentScanner/DocumentScanner.swift — `StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/DocumentScanner/DocumentScanner.swift` and `StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift` change together 80% of the time (16 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c8d7c3d0` Remove CaptureCore dependency (#3702); `49cf867d` [Identity] Add blur detector for document scanner (#2873); `d5b7e12c` Log analytics to track image scanning performance (#1250) — run `git show` on any of them.
  • Change coupling: STPPaymentIntent.swift ↔ STPSetupIntent.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift — `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift` and `StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift` change together 80% of the time (12 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `e3ceaf35` Fix more NSNumber? to Bool? in API Bindings (#5771); `b3a233e0` Replace optional NSNumber with Bool (#4735); `ceaca9de` Revert "Bindings and update CS & PS to get SPMS from elements/session… — run `git show` on any of them.
  • Change coupling: STPPaymentIntentConfirmParams.swift ↔ STPSetupIntentConfirmParams.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift — `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentConfirmParams.swift` and `StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntentConfirmParams.swift` change together 74% of the time (14 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `79686d93` Add Kakao Pay API bindings (#7052); `38a76509` Add Korean cards API bindings (#7053); `8e9fd1d8` Add Naver Pay API bindings (#7051) — run `git show` on any of them.
  • Change coupling: STPPaymentMethodParams.swift ↔ STPPaymentHandler.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift — `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift` and `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift` change together 64% of the time (29 of the 45 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 29 shared commits counted here, the most recent 3 are `2d72f6b4` Add Scalapay API bindings (#7124); `79686d93` Add Kakao Pay API bindings (#7052); `9e45cce1` Add SeQura API bindings (#7070) — run `git show` on any of them.
  • Change coupling: FinancialConnectionsSheet.swift ↔ FinancialConnectionsSessionFetcher.swift StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift — `StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift` and `StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsSessionFetcher.swift` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f13aff64` [BANKCON-11476] Refactor FinancialConnectionsAPIClient to support usi…; `9c97eab2` Renames Host View Controller (#1156); `514d3455` Adds FinancialConnections iOS docs (#1056) (at that commit the file was still `StripeFinancialConnections/StripeFinancialConnections/Source/Host/FinancialConnectionsSessionFetcher.swift`) — run `git show` on any of them.
  • Change coupling: PaymentSheetFormFactory+Card.swift ↔ PaymentSheetFormFactoryConfig.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+Card.swift — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+Card.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactoryConfig.swift` change together 61% of the time (14 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `ea332fb3` Require flag for funding filter (#5895); `df72a2a2` Filtering funding type in card field (#5880); `a47b7642` opensCardScannerAutomatically implementation (#5431) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ STPAPIClient+CryptoOnramp.swift REDACTED — `REDACTED` and `StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/API Bindings/STPAPIClient+CryptoOnramp.swift` change together 59% of the time (13 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `9b60765a` Thread a country hint through crypto onramp platform settings and pay…; `82f6ebd5` Allow crypto onramp Apple Pay before Link authentication (#7183); `eec2c28b` CryptoOnramp SDK: Swapped Terms and Conditions + Terms of Service (#7… — run `git show` on any of them.
  • Change coupling: LinkController.swift ↔ LinkFlowControllerHelpers.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkFlowControllerHelpers.swift` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `4304e191` Return from Link early when no funding sources available (#6851); `abf45a91` Return to login screen after logging out of Link wallet in standalone…; `1e2bcd27` Use Nil as Default Value for Link Supported Payment Methods (#6349) — run `git show` on any of them.
  • Change coupling: STPPaymentMethod.swift ↔ STPPaymentHandler.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift — `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift` and `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift` change together 55% of the time (23 of the 42 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 23 shared commits counted here, the most recent 3 are `2d72f6b4` Add Scalapay API bindings (#7124); `79686d93` Add Kakao Pay API bindings (#7052); `9e45cce1` Add SeQura API bindings (#7070) — run `git show` on any of them.
  • Change coupling: STPCardScanner.swift ↔ CardSectionWithScannerView.swift StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift — `StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionWithScannerView.swift` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `716c2a7c` Refactor card scanner (#5672); `b8433aad` Revert "Restore direct to card scan (#5307)" (#5342); `fb53e637` Restore direct to card scan (#5307) — run `git show` on any of them.
  • Change coupling: FinancialConnectionsAsyncAPIClient.swift ↔ NativeFlowController.swift StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift — `StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift` and `StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `73c091ba` Add generic error pane for FC SDK (#6900); `a6405f19` [link] Refactor FC link brand resolution (#6489); `3a8f641f` Add client_attribution_metadata to payment details and adjust for Lin… — run `git show` on any of them.
  • Change coupling: PayWithLinkController.swift ↔ PaymentSheet+Link.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+Link.swift` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f4d8cc5c` PS MainActor Isolate Link coordinators (#6950); `bbf6bf5c` Refactor Checkout confirm ownership (#6817); `242cbf85` Adjust when hcaptcha token fetched (#5527) — run `git show` on any of them.
  • Change coupling: CustomerSheetDataSource.swift ↔ PaymentSheetLoader.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheetDataSource.swift — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheetDataSource.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `7dcc2002` Make API calls to internal endpoint to set defaults (#4588); `171edb3d` Read the default_payment_method field from elements session and use t…; `4ddc1cc1` Filter card brands in Apple Pay and CBC (#4131) — run `git show` on any of them.
  • Change coupling: CustomerSheet+API.swift ↔ PaymentSheet+API.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet+API.swift — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet+API.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `dc3f8c99` Only attach tokens for card pms (#5846); `0097be55` [v25] Async everywhere pt 2.1 - STPPaymentHandler (#5293); `7399be71` Send top-level in addition to under payment_method_data or payment_me… — run `git show` on any of them.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×14
  • Duplicated block (13 lines × 2) StripeApplePay/StripeApplePay/Source/Extensions/PKPayment+Stripe.swift:19 — StripeApplePay/StripeApplePay/Source/Extensions/PKPayment+Stripe.swift:19-31 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+ApplePay.swift:198-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (13 lines × 2) StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:113 — StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:113-125 | StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift:150-162 — before extracting anything, compare `StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift` and `StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:237 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:237-249 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:284-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:84 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:84-96 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:122-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) StripeCore/StripeCore/Source/Connections Bindings/BillingAddress.swift:21 — StripeCore/StripeCore/Source/Connections Bindings/BillingAddress.swift:21-33 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Address.swift:43-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCore/StripeCore/Source/Connections Bindings/BillingAddress.swift:21` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift:43 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift:43-55 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingSaveToLinkVerification/NetworkingSaveToLinkVerificationDataSource.swift:37-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift:43` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:285 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:285-297 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:535-547 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:548` calls `constraint` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:298` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:514 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:514-526 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:532-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:514` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+BankDebits.swift:24 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+BankDebits.swift:24-36 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+BankDebits.swift:48-60 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+BankDebits.swift:24` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:251 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:251-263 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:272-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:251` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (13 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1675 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1675-1687 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1761-1773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1675` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2646 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2646-2658 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2681-2694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2646` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) StripeCameraCore/StripeCameraCore/Source/Coordinators/Torch.swift:22 — StripeCameraCore/StripeCameraCore/Source/Coordinators/Torch.swift:22-36 | StripeCardScan/StripeCardScan/Source/CardScan/UI/Torch.swift:14-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:157 — StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:157-169 | StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:176-188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:157` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×14
  • Duplicated block (5 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:180 — StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:180-184 | StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift:218-222 — before extracting anything, compare `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift` and `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:180` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Address/AddressAutocompleteModels.swift:185 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Address/AddressAutocompleteModels.swift:185-189 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift:89-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:450 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:450-454 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:531-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:248 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:248-252 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:264-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) StripeUICore/StripeUICore/Source/Helpers/InputFormColors.swift:18 — StripeUICore/StripeUICore/Source/Helpers/InputFormColors.swift:18-22 | StripeUICore/StripeUICore/Source/Helpers/InputFormColors.swift:40-44 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (5 lines × 2) StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/API Bindings/RegisterWalletRequest.swift:26 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/API Bindings/RegisterWalletRequest.swift:26-30 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/API Bindings/WalletOwnershipChallengeRequest.swift:27-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) StripeIdentity/StripeIdentity/Source/Elements/IdentityTextButtonElement.swift:49 — StripeIdentity/StripeIdentity/Source/Elements/IdentityTextButtonElement.swift:49-53 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/CountryNotListedViewController.swift:100-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:206 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:206-210 | StripeCore/StripeCore/Source/Helpers/STPDeviceUtils.swift:15-19 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:655 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:655-659 | StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:171-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPCard.swift:218 — StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPCard.swift:218-222 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPSourceCardDetails.swift:125-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:383 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:383-387 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:422-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:383` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:248 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:248-252 | Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:477-482 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (5 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIEmbeddedPaymentElement.swift:40 — Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIEmbeddedPaymentElement.swift:40-44 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIEmbeddedPaymentElement.swift:138-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIEmbeddedPaymentElement.swift:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:422 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:422-426 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:1243-1247 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×12
  • Duplicated block (16 lines × 2) StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:127 — StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:127-142 | StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift:164-179 — before extracting anything, compare `StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift` and `StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:120 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:120-135 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.swift:149-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `configuration` to `PaymentElementConfiguration ) async throws -> (STPPaymentIntent` in one and `PaymentElementConfiguration ) async throws -> (STPSetupIntent` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:222 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:222-237 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:172-187 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:222` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:53 — StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:53-68 | StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift:73-88 — before extracting anything, compare `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift` and `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Elements/InlineSignup/LinkInlineSignupView.swift:341 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Elements/InlineSignup/LinkInlineSignupView.swift:341-356 | StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewController.swift:417-432 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Elements/InlineSignup/LinkInlineSignupView.swift:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:241 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:241-256 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:355-370 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift:85 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift:85-100 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithNativeLinkController.swift:302-317 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift:85` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMME+Initialization.swift:21 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMME+Initialization.swift:21-36 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMME+Initialization.swift:80-95 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMME+Initialization.swift:21` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:392 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:392-407 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:815-830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:392` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:223 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:223-238 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:466-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:223` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36 — Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36-51 | Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift:61-76 — before extracting anything, compare `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift` and `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:698 — Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:698-713 | Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:723-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · ClassTooLong · ×11
  • ClassTooLong: STPPaymentHandler StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:100 — ClassTooLong — 1519 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 1119 over it, 3.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: STPPaymentCardTextField StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:19 — ClassTooLong — 1390 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 400 significant lines; this is 990 over it, 3.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: STPBankAccountCollector StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:29 — ClassTooLong — 635 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 235 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CustomerSavedPaymentMethodsViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:21 — ClassTooLong — 601 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 201 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PaymentSheetVerticalViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:14 — ClassTooLong — 579 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 179 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: STPPaymentMethodParams StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:16 — ClassTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 400 significant lines; this is 150 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: STPApplePayContext StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:159 — ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 80 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CryptoOnrampCoordinator REDACTED:240 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 43 methods. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PartnerAuthViewController StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift:34 — ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 19 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DocumentCaptureViewController StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:15 — ClassTooLong — 418 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 18 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IdentityAnalyticsClient StripeIdentity/StripeIdentity/Source/Analytics/IdentityAnalyticsClient.swift:45 — ClassTooLong — 405 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 5 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×10
  • Duplicated block (15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:457 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:457-471 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:751-765 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:457` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewModel.swift:200 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewModel.swift:200-214 | StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ViewModels/LinkInlineSignupViewModel.swift:469-483 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewModel.swift:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:338 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:338-352 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:717-731 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:338` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:405 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:405-419 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:821-835 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:405` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:213 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:213-227 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:284-298 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/STPInputTextField.swift:213` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (15 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:337 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:337-351 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:761-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:337` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:190 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:190-204 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:1210-1224 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:190` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:163 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:163-177 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:67-81 — before extracting anything, compare `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift` and `Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:163` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:86 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:86-100 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:354-368 — before extracting anything, compare `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift` and `Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutSessionDetailsComponents.swift:44 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutSessionDetailsComponents.swift:44-58 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutSessionDetailsComponents.swift:71-85 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutSessionDetailsComponents.swift:44` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `4` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×9
  • Duplicated block (17 lines × 2) StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:20 — StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:20-36 | StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:106-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:105` calls `init` and `StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:19` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:124 — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:124-140 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:354-370 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (17 lines × 2) StripeCardScan/StripeCardScan/Source/CardScan/UI/SimpleScanViewController.swift:259 — StripeCardScan/StripeCardScan/Source/CardScan/UI/SimpleScanViewController.swift:259-275 | StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:98-114 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:290 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:290-306 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:210-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:538 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:538-554 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:660-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:538` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:145 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:145-161 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:170-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:232 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:232-248 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:504-520 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:232` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:243 — Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:243-259 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:360-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:66 — Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:66-82 | Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift:67-83 — before extracting anything, compare `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift` and `Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×7
  • Duplicated block (22 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:21 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:21-42 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+LinkAccountSession.swift:44-65 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (22 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:755 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:755-776 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:590-611 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (22 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:167 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:167-188 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:208-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (22 lines × 2) StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:83 — StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:83-104 | StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:175-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:83` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (22 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:248 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:248-269 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:487-508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:248` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:482 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:482-503 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:522-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:69 — Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:69-90 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:117-138 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:206 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:206-241 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationViewController.swift:85-119 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:298-342 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:224-263 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37 — StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37-80 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:262-427 | StripePayments/StripePayments/Source/API Bindings/Models/STPFile.swift:106-133 | StripePayments/StripePayments/Source/API Bindings/Models/STPToken.swift:104-132 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:388 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:388-424 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:796-828 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1119-1152 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:496-528 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:29 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:29-91 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift:39-102 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithRadioView.swift:64-112 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFloating.swift:87-131 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:129 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:392-405 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:392-405 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:108 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:108-121 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:146-161 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:159-172 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:128-142 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×6
  • Duplicated block (18 lines × 2) StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:218 — StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift:218-235 | StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift:249-266 — before extracting anything, compare `StripeConnect/StripeConnect/Source/Internal/ConnectActivityIndicator.swift` and `StripeUICore/StripeUICore/Source/Controls/ActivityIndicator.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (18 lines × 2) StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift:55 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift:55-72 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift:77-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/LinkGlobalHoldback.swift:25 — StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/LinkGlobalHoldback.swift:25-42 | StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/LinkGlobalHoldbackAA.swift:25-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCardWalletMasterpass.swift:48 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCardWalletMasterpass.swift:48-65 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCardWalletVisaCheckout.swift:29-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (18 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:538 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:538-555 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:609-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:538` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:537` calls `paymentSheet` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:608` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (18 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:52 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:52-69 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:103-120 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×5
  • Duplicated block (21 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:221 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:221-241 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:268-288 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:84 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:84-104 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:124-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:84` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (21 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:30 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:30-50 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:83-103 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:30` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:81 — Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:81-101 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift:79-99 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (21 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:33 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:33-53 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:37-57 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×5
  • Duplicated block (19 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:437 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:437-455 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:731-749 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (19 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:588 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:588-606 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:356-374 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:588` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/CountryNotListedViewController.swift:51 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/CountryNotListedViewController.swift:51-69 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SuccessViewController.swift:33-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/CountryNotListedViewController.swift:51` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:123 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:123-141 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:145-163 — before extracting anything, compare `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:142` calls `setNeedsStatusBarAppearanceUpdate` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:120` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (19 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:167 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:167-185 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:221-239 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:24 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:24-32 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:64-72 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:91-99 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:24` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:42 — StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:42-50 | StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:52-60 | StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:75-83 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:204 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:204-212 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:236-244 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:228-236 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:96 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:96-104 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:116-124 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:381-389 — before extracting anything, compare `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 3) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:280 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:280-288 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:311-319 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:346-354 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:356` calls `UIFont`, `monospacedSystemFont` and `Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:290` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:314 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:314-323 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:360-367 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:405-412 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:314` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (8 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:433 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:433-440 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:847-854 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1160-1167 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:433` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 3) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift:50 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift:50-57 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:57-64 | StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountAddress.swift:53-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddress.swift:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift:140 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift:140-147 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/LinkSignupFormView.swift:215-222 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupBodyView.swift:141-148 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:88 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:88-95 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:125-132 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:146-153 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×4
  • Duplicated block (20 lines × 2) StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedSSDBox.swift:16 — StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedSSDBox.swift:16-35 | StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/DetectedSSDOcrBox.swift:16-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (20 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:308 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:308-327 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:844-863 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:182 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:182-201 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:301-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:202` calls `STPLocalizedString` and `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:321` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (20 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:89 — Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:89-108 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift:49-68 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:89` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:482 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:482-496 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:589-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:482` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+iDEAL.swift:11 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+iDEAL.swift:11-25 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:719-732 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (14–15 lines × 2) Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift:20 — Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift:20-34 | Testers/IntegrationTester/IntegrationTester/Source/Views/CardView.swift:20-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift:20` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (14–15 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:81 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:81-94 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:100-114 — before extracting anything, compare `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:81` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×4
  • Duplicated block (11 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:289 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:289-299 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:536-546 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:658-668 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36 — Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36-46 | Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift:61-71 | Testers/IntegrationTester/IntegrationTester/Source/Views/SEPADebitView.swift:43-53 — before extracting anything, compare `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift` and `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:36` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (11 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:252 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:252-262 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:309-319 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:306-316 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:252` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:74 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:74-84 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:94-104 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:110-120 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:74` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:122` calls `deferredSwitchDidChangeValue`, `loadBackend` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:108` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×4
  • Duplicated block (9–10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:429 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:429-437 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1155-1164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `paymentMethod` to `StripePayments.STPPaymentMethod` in one and `STPPaymentMethod` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (9–10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEPromotionTextView.swift:51 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEPromotionTextView.swift:51-59 | StripeUICore/StripeUICore/Source/Views/LinkOpeningTextView.swift:47-56 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeUICore/StripeUICore/Source/Views/LinkOpeningTextView.swift:47` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9–10 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionBoletoDisplayDetails.swift:47 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionBoletoDisplayDetails.swift:47-55 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionMultibancoDisplayDetails.swift:50-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9–10 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:367 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:367-376 | Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:401-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:367` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:366` calls `arrayValue` and `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:400` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D10 · Test Quality · Test project verifies nothing · ×3
  • Test project verifies nothing: Extensions StripeConnect/StripeConnectTests/Internal/Extensions/URL+ExtensionTests.swift:12 — No conventional assertion call was detected in 1 of 1 tests in `Extensions` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
  • Test project verifies nothing: IntegrationTesterUITests Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift:47 — No conventional assertion call was detected in 1 of 1 tests in `IntegrationTesterUITests` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
  • Test project verifies nothing: PaymentsCore StripeApplePay/StripeApplePayTests/PaymentsCore/PaymentIntentCodableTest.swift:9 — No conventional assertion call was detected in 1 of 1 tests in `PaymentsCore` — the project as a whole, not one method. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a suite that genuinely checks nothing. If it is the latter, this project passes unconditionally and cannot fail.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×3
  • Duplicated block (34 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:258 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:258-291 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:322-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:258` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (34 lines × 2) Example/AppClipExample/Shared/ApplePayModel.swift:16 — Example/AppClipExample/Shared/ApplePayModel.swift:16-49 | Testers/IntegrationTester/IntegrationTester/Source/Models/ApplePayModel.swift:16-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (34 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift:12 — StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift:12-45 | StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift:15-579 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×3
  • Duplicated block (13–14 lines × 2) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/FCLiteImplementation.swift:16 — StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/FCLiteImplementation.swift:16-28 | StripePayments/StripePayments/Source/Internal/Helpers/ConnectionsSDKAvailability.swift:96-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/FCLiteImplementation.swift:16` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1462 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1462-1474 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1491-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1462` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13–14 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:154 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:154-167 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:187-199 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:832 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:832-842 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Shipping Address Element/ShippingAddressElement+AddressViewController.swift:20-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:832` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Toast/LinkToast.swift:75 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Toast/LinkToast.swift:75-85 | StripeUICore/StripeUICore/Source/Categories/UIView+StripeUICore.swift:17-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Toast/LinkToast.swift:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:19 — StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:19-28 | StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:71-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×3
  • Duplicated block (10 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:85 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:85-94 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:125-134 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:168-177 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:209-218 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:85` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:179` calls `validatePaymentMethod` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:97` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 4) StripeUICore/StripeUICore/Source/Elements/PickerField/PickerFieldView.swift:231 — StripeUICore/StripeUICore/Source/Elements/PickerField/PickerFieldView.swift:231-240 | StripeUICore/StripeUICore/Source/Elements/Section/SectionContainerView.swift:188-197 | StripeUICore/StripeUICore/Source/Elements/TextField/FloatingPlaceholderTextFieldView.swift:197-206 | StripeUICore/StripeUICore/Source/Elements/TextField/TextFieldView.swift:340-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
  • Duplicated block (10 lines × 4) StripeApplePay/StripeApplePay/Source/PaymentsCore/Analytics/STPAnalyticsClient+PaymentsAPI.swift:13 — StripeApplePay/StripeApplePay/Source/PaymentsCore/Analytics/STPAnalyticsClient+PaymentsAPI.swift:13-22 | StripeApplePay/StripeApplePay/Source/PaymentsCore/Analytics/STPAnalyticsClient+PaymentsAPI.swift:24-33 | StripeApplePay/StripeApplePay/Source/PaymentsCore/Analytics/STPAnalyticsClient+PaymentsAPI.swift:35-46 | StripePayments/StripePayments/Source/Internal/Analytics/STPAnalyticsClient+Payments.swift:27-38 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×3
  • Duplicated block (10 lines × 3) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:415 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:415-428 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:836-850 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:941-950 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:415` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:19 — Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:19-28 | Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift:22-31 | Testers/IntegrationTester/IntegrationTester/Source/Views/SEPADebitView.swift:19-28 — before extracting anything, compare `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift` and `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:19` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:141 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:141-150 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:174-183 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:186-195 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:141` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×3
  • Duplicated block (7 lines × 4) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBancontactParams.swift:15 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBancontactParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodEPSParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGrabPayParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTwintParams.swift:14-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (7 lines × 4) StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift:77 — StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift:77-84 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift:109-116 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/STPSource.swift:138-145 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift:103-109 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (7 lines × 4) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:371 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:371-377 | Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:404-410 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:73-79 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:113-119 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:373 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:373-377 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:210-214 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:75-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
  • Duplicated block (5 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:631 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:631-636 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:675-679 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:739-743 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:631` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 3) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:271 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:271-275 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:303-307 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:337-341 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
AC3 · Page structure · Page without a main landmark · ×2
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
  • Page without a main landmark Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:3 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D17 · Explicit Debt · FixmeComment · ×2
  • FixmeComment StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:1104 — // FIXME: Import from %S/Inputs/Coding/SharedTypes.swift somehow. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • FixmeComment StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:1224 — // FIXME: This property is present only in order to test the expected result of Codable synthesis in the compiler. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×2
  • Duplicated block (30 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:66 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:66-95 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:107-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift:66` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (30 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:207 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:207-236 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:326-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:206` calls `STPLocalizedString` and `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:325` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×2
  • Duplicated block (24 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:62 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:62-85 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:88-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (24 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:472 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:472-495 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:498-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:472` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 4) · ×2
  • Duplicated block (14 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:97 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:97-110 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:137-150 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:181-194 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:222-235 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:179` calls `validatePaymentMethod` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:94` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 4) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:129 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:392-405 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:392-405 — `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×2
  • Duplicated block (13 lines × 5) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:105 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:105-117 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:236-248 | StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:88-100 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:335-347 | StripePayments/StripePayments/Source/Internal/API Bindings/STPIntentActionUseStripeSDK.swift:68-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:105` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 5) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:174 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:174-186 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:205-217 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:206-218 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:237-249 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:199-211 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:109 — StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:109-119 | StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift:137-149 — before extracting anything, compare `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift` and `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/FaceDetector/FaceDetectorOutput.swift:109` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11–13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:409 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:409-419 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:643-655 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:342 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:342-351 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:721-730 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:492-500 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:342` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9–10 lines × 3) StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:179 — StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:179-188 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPBankAccount.swift:159-167 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPCard.swift:250-258 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • Duplicated block (7 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:147 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:147-153 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Card.swift:66-72 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/SavedPaymentMethodFormFactory/SavedPaymentMethodFormFactory+Link.swift:55-61 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:147` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:196 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:196-202 | Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:204-210 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:406-412 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:52 — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:52-82 | StripeApplePay/StripeApplePay/Source/PaymentsCore/API/SetupIntent+API.swift:51-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping PaymentIntentCompletionBlock` in one and `@escaping SetupIntentCompletionBlock` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (31 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:34 — Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:34-64 | Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift:35-65 — before extracting anything, compare `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift` and `Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionCashAppRedirectToApp.swift:37 — StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionCashAppRedirectToApp.swift:37-44 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionPayNowDisplayQrCode.swift:35-42 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionPromptPayDisplayQrCode.swift:35-42 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionSwishHandleRedirect.swift:35-42 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentActionWeChatPayRedirectToApp.swift:36-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
  • Duplicated block (8 lines × 5) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:122 — Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:122-129 | Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift:117-124 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:108-115 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:128-135 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:402-409 — before extracting anything, compare `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift` and `Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:120` calls `displayAlert`, `UIAlertController` and `Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:401` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirm.swift:28 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirm.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMobilePay.swift:26-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMultibanco.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodVipps.swift:25-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (9 lines × 4) Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:111 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:111-119 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:151-159 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:162-170 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:131-139 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:111` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:116 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:116-177 | Example/CryptoOnramp Example/CryptoOnramp Example/IdentityVerificationView.swift:27-79 | Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:38-86 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:35-81 | Example/CryptoOnramp Example/CryptoOnramp Example/WalletSelectionView.swift:60-161 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:120 — Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift:120-129 | Example/FinancialConnections Example/FinancialConnections Example/ConnectAccountViewController.swift:115-124 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:106-115 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:126-135 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:391-409 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
AC3 · Page structure · Heading level jumps from h1 to h4 · ×1
  • Heading level jumps from h1 to h4 REDACTED:71 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC4 · Keyboard semantics · Anchor without href · ×1
  • Anchor without href REDACTED:29 — An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:9 — outline:none/0 with no :focus rule in the same stylesheet removes the focus ring. Provide a visible :focus / :focus-visible style.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung — No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 11 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68) · ×1
  • STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111 — STPPaymentHandler._handleAuthenticationForCurrentAction has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentMethodType.makeImage (cyclomatic 60) · ×1
  • STPPaymentMethodType.makeImage (cyclomatic 60) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:219 — STPPaymentMethodType.makeImage has cyclomatic complexity 60 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51) · ×1
  • STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1584 — STPPaymentHandler._retrieveAndCheckIntentForCurrentAction has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeFlowController.swift.CreatePaneViewController (cyclomatic 42) · ×1
  • NativeFlowController.swift.CreatePaneViewController (cyclomatic 42) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1477 — NativeFlowController.swift.CreatePaneViewController has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentCardTextField.recalculateSubviewLayout (cyclomatic 39) · ×1
  • STPPaymentCardTextField.recalculateSubviewLayout (cyclomatic 39) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320 — STPPaymentCardTextField.recalculateSubviewLayout has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HostedAuthUrlBuilder.build (cyclomatic 38) · ×1
  • HostedAuthUrlBuilder.build (cyclomatic 38) StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:12 — HostedAuthUrlBuilder.build has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConfirmButton.update (cyclomatic 36) · ×1
  • ConfirmButton.update (cyclomatic 36) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift:292 — ConfirmButton.update has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · STPDecodingContainerProtocol.castFromNSObject (cyclomatic 35) · ×1
  • STPDecodingContainerProtocol.castFromNSObject (cyclomatic 35) StripeCore/StripeCore/Source/Coder/StripeJSONDecoder.swift:567 — STPDecodingContainerProtocol.castFromNSObject has cyclomatic complexity 35 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · PaymentSheet.confirmAfterHandlingLocalActions (cyclomatic 35) · ×1
  • PaymentSheet.confirmAfterHandlingLocalActions (cyclomatic 35) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:238 — PaymentSheet.confirmAfterHandlingLocalActions has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheetVerticalViewController.calculateInitialSelection (cyclomatic 35) · ×1
  • PaymentSheetVerticalViewController.calculateInitialSelection (cyclomatic 35) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:373 — PaymentSheetVerticalViewController.calculateInitialSelection has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPIntentAction.decodedObject (cyclomatic 35) · ×1
  • STPIntentAction.decodedObject (cyclomatic 35) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:353 — STPIntentAction.decodedObject has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPApplePayContext._completePayment (cyclomatic 33) · ×1
  • STPApplePayContext._completePayment (cyclomatic 33) StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:660 — STPApplePayContext._completePayment has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CheckoutController.confirmCheckoutSession (cyclomatic 33) · ×1
  • CheckoutController.confirmCheckoutSession (cyclomatic 33) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:429 — CheckoutController.confirmCheckoutSession has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · STPIntentAction.description (cyclomatic 33) · ×1
  • STPIntentAction.description (cyclomatic 33) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:232 — STPIntentAction.description has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CardVerifyAccurateStateMachine.transition (cyclomatic 30) · ×1
  • CardVerifyAccurateStateMachine.transition (cyclomatic 30) StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:215 — CardVerifyAccurateStateMachine.transition has cyclomatic complexity 30 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PaymentSheetAnalyticsHelper.logPayment (cyclomatic 30) · ×1
  • PaymentSheetAnalyticsHelper.logPayment (cyclomatic 30) StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift:364 — PaymentSheetAnalyticsHelper.logPayment has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StripeEncodingContainer.castToNSObject (cyclomatic 26) · ×1
  • StripeEncodingContainer.castToNSObject (cyclomatic 26) StripeCore/StripeCore/Source/Coder/StripeJSONEncoder.swift:489 — StripeEncodingContainer.castToNSObject has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Appearance.init (cyclomatic 25) · ×1
  • Appearance.init (cyclomatic 25) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PaymentMethodMessagingElement.swift:141 — Appearance.init has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · EmbeddedPaymentElement.performUpdate (cyclomatic 24) · ×1
  • EmbeddedPaymentElement.performUpdate (cyclomatic 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:180 — EmbeddedPaymentElement.performUpdate has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PaymentSheetFormFactory.makeCard (cyclomatic 24) · ×1
  • PaymentSheetFormFactory.makeCard (cyclomatic 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:42 — PaymentSheetFormFactory.makeCard has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: PaymentSheetFormFactory.makePaymentMethodForm (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · LinkAccountPickerViewController.didSelectConnectAccounts (cyclomatic 22) · ×1
  • LinkAccountPickerViewController.didSelectConnectAccounts (cyclomatic 22) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerViewController.swift:246 — LinkAccountPickerViewController.didSelectConnectAccounts has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentCardTextField.paymentMethodParams (cyclomatic 22) · ×1
  • STPPaymentCardTextField.paymentMethodParams (cyclomatic 22) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:441 — STPPaymentCardTextField.paymentMethodParams has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · STPAPIClient.makeElementsSessionsParams (cyclomatic 21) · ×1
  • STPAPIClient.makeElementsSessionsParams (cyclomatic 21) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:16 — STPAPIClient.makeElementsSessionsParams has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AccountPickerViewController.pollAuthSessionAccounts (cyclomatic 21) · ×1
  • AccountPickerViewController.pollAuthSessionAccounts (cyclomatic 21) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:146 — AccountPickerViewController.pollAuthSessionAccounts has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentHandler._handleRedirect (cyclomatic 21) · ×1
  • STPPaymentHandler._handleRedirect (cyclomatic 21) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1836 — STPPaymentHandler._handleRedirect has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeFlowController.closeAuthFlow (cyclomatic 20) · ×1
  • NativeFlowController.closeAuthFlow (cyclomatic 20) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:360 — NativeFlowController.closeAuthFlow has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CustomerSession.decoded (cyclomatic 20) · ×1
  • CustomerSession.decoded (cyclomatic 20) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/CustomerSession.swift:21 — CustomerSession.decoded has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · STPElementsSession.decodedObject (cyclomatic 20) · ×1
  • STPElementsSession.decodedObject (cyclomatic 20) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:167 — STPElementsSession.decodedObject has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VerificationSheetFlowController.nextViewController (cyclomatic 19) · ×1
  • VerificationSheetFlowController.nextViewController (cyclomatic 19) StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetFlowController.swift:420 — VerificationSheetFlowController.nextViewController has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DocumentCaptureViewController.scanningTextWithNoInput (cyclomatic 19) · ×1
  • DocumentCaptureViewController.scanningTextWithNoInput (cyclomatic 19) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:18 — DocumentCaptureViewController.scanningTextWithNoInput has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPAnalyticsEventTranslator.translateEvent (cyclomatic 18) · ×1
  • STPAnalyticsEventTranslator.translateEvent (cyclomatic 18) StripeCore/StripeCore/Source/Analytics/Eventing/STPAnalyticsEventTranslator.swift:27 — STPAnalyticsEventTranslator.translateEvent has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ErrorViewController.viewDidLoad (cyclomatic 18) · ×1
  • ErrorViewController.viewDidLoad (cyclomatic 18) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift:41 — ErrorViewController.viewDidLoad has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerAuthViewController.openInstitutionAuthenticationWebView (cyclomatic 18) · ×1
  • PartnerAuthViewController.openInstitutionAuthenticationWebView (cyclomatic 18) StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift:393 — PartnerAuthViewController.openInstitutionAuthenticationWebView has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DocumentSide.instruction (cyclomatic 18) · ×1
  • DocumentSide.instruction (cyclomatic 18) StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift:16 — DocumentSide.instruction has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPImageLibrary.brandImage (cyclomatic 18) · ×1
  • STPImageLibrary.brandImage (cyclomatic 18) StripePaymentsUI/StripePaymentsUI/Source/Helpers/STPImageLibrary.swift:140 — STPImageLibrary.brandImage has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPFormView.configureFooter (cyclomatic 18) · ×1
  • STPFormView.configureFooter (cyclomatic 18) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift:346 — STPFormView.configureFooter has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · STPConnectAccountIndividualParams.description (cyclomatic 18) · ×1
  • STPConnectAccountIndividualParams.description (cyclomatic 18) StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift:78 — STPConnectAccountIndividualParams.description has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FinancialConnectionsWebFlowViewController.startAuthenticationSession (cyclomatic 17) · ×1
  • FinancialConnectionsWebFlowViewController.startAuthenticationSession (cyclomatic 17) StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:153 — FinancialConnectionsWebFlowViewController.startAuthenticationSession has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PayWithLinkViewController.launchFinancialConnections (cyclomatic 17) · ×1
  • PayWithLinkViewController.launchFinancialConnections (cyclomatic 17) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift:629 — PayWithLinkViewController.launchFinancialConnections has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Intent.fulfilledRequirements (cyclomatic 17) · ×1
  • Intent.fulfilledRequirements (cyclomatic 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift:206 — Intent.fulfilledRequirements has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheet.createConfirmationTokenParams (cyclomatic 17) · ×1
  • PaymentSheet.createConfirmationTokenParams (cyclomatic 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:158 — PaymentSheet.createConfirmationTokenParams has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheet.handleDeferredIntentConfirmation (cyclomatic 17) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation (cyclomatic 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:63 — PaymentSheet.handleDeferredIntentConfirmation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPFormTextField.autoFormattingBehavior (cyclomatic 17) · ×1
  • STPFormTextField.autoFormattingBehavior (cyclomatic 17) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:77 — STPFormTextField.autoFormattingBehavior has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentCardTextField.formTextFieldTextDidChange (cyclomatic 17) · ×1
  • STPPaymentCardTextField.formTextFieldTextDidChange (cyclomatic 17) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1760 — STPPaymentCardTextField.formTextFieldTextDidChange has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPCustomer.sources (cyclomatic 17) · ×1
  • STPCustomer.sources (cyclomatic 17) StripePayments/StripePayments/Source/API Bindings/Models/STPCustomer.swift:150 — STPCustomer.sources has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPPaymentIntent.decodedObject (cyclomatic 17) · ×1
  • STPPaymentIntent.decodedObject (cyclomatic 17) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:254 — STPPaymentIntent.decodedObject has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · STPPaymentHandler.confirmPaymentIntent (cyclomatic 17) · ×1
  • STPPaymentHandler.confirmPaymentIntent (cyclomatic 17) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:200 — STPPaymentHandler.confirmPaymentIntent has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · STPPaymentHandler.handleNextAction (cyclomatic 17) · ×1
  • STPPaymentHandler.handleNextAction (cyclomatic 17) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:439 — STPPaymentHandler.handleNextAction has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AddressSectionElement.updateAddressFields (cyclomatic 17) · ×1
  • AddressSectionElement.updateAddressFields (cyclomatic 17) StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift:354 — AddressSectionElement.updateAddressFields has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StackViewWithSeparator.layoutSubviews (cyclomatic 17) · ×1
  • StackViewWithSeparator.layoutSubviews (cyclomatic 17) StripeUICore/StripeUICore/Source/Helpers/StackViewWithSeparator.swift:142 — StackViewWithSeparator.layoutSubviews has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPCardScanner.processVNRequest (cyclomatic 16) · ×1
  • STPCardScanner.processVNRequest (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:275 — STPCardScanner.processVNRequest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheet.handleDeferredIntentConfirmation_confirmationToken (cyclomatic 16) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation_confirmationToken (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:12 — PaymentSheet.handleDeferredIntentConfirmation_confirmationToken has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheetVerticalViewController.selectedPaymentOption (cyclomatic 16) · ×1
  • PaymentSheetVerticalViewController.selectedPaymentOption (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:20 — PaymentSheetVerticalViewController.selectedPaymentOption has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PaymentMethodFormViewController.handleCollectBankAccount (cyclomatic 16) · ×1
  • PaymentMethodFormViewController.handleCollectBankAccount (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:466 — PaymentMethodFormViewController.handleCollectBankAccount has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PaymentMethodFormViewController.handleCollectInstantDebits (cyclomatic 16) · ×1
  • PaymentMethodFormViewController.handleCollectInstantDebits (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:576 — PaymentMethodFormViewController.handleCollectInstantDebits has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · PaymentSheetFlowControllerViewController.init (cyclomatic 16) · ×1
  • PaymentSheetFlowControllerViewController.init (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:182 — PaymentSheetFlowControllerViewController.init has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PaymentSheetViewController.updateUI (cyclomatic 16) · ×1
  • PaymentSheetViewController.updateUI (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:310 — PaymentSheetViewController.updateUI has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPTextFieldDelegateProxy.textField (cyclomatic 16) · ×1
  • STPTextFieldDelegateProxy.textField (cyclomatic 16) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:383 — STPTextFieldDelegateProxy.textField has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · STPCardExpiryInputTextFieldFormatter.isAllowedInput (cyclomatic 16) · ×1
  • STPCardExpiryInputTextFieldFormatter.isAllowedInput (cyclomatic 16) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:15 — STPCardExpiryInputTextFieldFormatter.isAllowedInput has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · STPPaymentCardTextField.updateImage (cyclomatic 16) · ×1
  • STPPaymentCardTextField.updateImage (cyclomatic 16) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:2168 — STPPaymentCardTextField.updateImage has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · STPPaymentHandler.confirmSetupIntent (cyclomatic 16) · ×1
  • STPPaymentHandler.confirmSetupIntent (cyclomatic 16) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:538 — STPPaymentHandler.confirmSetupIntent has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SectionContainerView.updateUI (cyclomatic 16) · ×1
  • SectionContainerView.updateUI (cyclomatic 16) StripeUICore/StripeUICore/Source/Elements/Section/SectionContainerView.swift:99 — SectionContainerView.updateUI has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: testUpdatesSwiftUILayoutWhenDetailsChangeHeight StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CurrencySelectorElementViewTests.swift:33 — Skipped — throws XCTSkip
D12 · Dependency Hygiene · Floating branch dependency · ×1
  • Floating branch dependency: ohhttpstubs — Dependency `ohhttpstubs` is resolved in Stripe.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `stripe-mock` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
D2 · Cognitive Complexity · STPPaymentHandler._handleAuthenticationForCurrentAction (cognitive 139) · ×1
  • STPPaymentHandler._handleAuthenticationForCurrentAction (cognitive 139) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1111 — STPPaymentHandler._handleAuthenticationForCurrentAction has cognitive complexity 139 (threshold 15). Drivers by points: if/else 57 (126 pts), ternaries 2 (8 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 77). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive 107) · ×1
  • STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive 107) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1584 — STPPaymentHandler._retrieveAndCheckIntentForCurrentAction has cognitive complexity 107 (threshold 15). Drivers by points: if/else 32 (80 pts), boolean chains 27 (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · STPPaymentCardTextField.recalculateSubviewLayout (cognitive 86) · ×1
  • STPPaymentCardTextField.recalculateSubviewLayout (cognitive 86) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320 — STPPaymentCardTextField.recalculateSubviewLayout has cognitive complexity 86 (threshold 15). Drivers by points: if/else 34 (56 pts), loops 5 (19 pts), ternaries 4 (7 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HostedAuthUrlBuilder.build (cognitive 69) · ×1
  • HostedAuthUrlBuilder.build (cognitive 69) StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:12 — HostedAuthUrlBuilder.build has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (53 pts), boolean chains 15, ternaries 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · STPApplePayContext._completePayment (cognitive 52) · ×1
  • STPApplePayContext._completePayment (cognitive 52) StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:660 — STPApplePayContext._completePayment has cognitive complexity 52 (threshold 15). Drivers by points: if/else 27 (42 pts), boolean chains 6, error handling 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheet.confirmAfterHandlingLocalActions (cognitive 45) · ×1
  • PaymentSheet.confirmAfterHandlingLocalActions (cognitive 45) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:238 — PaymentSheet.confirmAfterHandlingLocalActions has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 6 (11 pts), ternaries 2 (6 pts), boolean chains 1 (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NativeFlowController.swift.CreatePaneViewController (cognitive 44) · ×1
  • NativeFlowController.swift.CreatePaneViewController (cognitive 44) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1477 — NativeFlowController.swift.CreatePaneViewController has cognitive complexity 44 (threshold 15). Drivers by points: if/else 26 (38 pts), boolean chains 5, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetAnalyticsHelper.logPayment (cognitive 44) · ×1
  • PaymentSheetAnalyticsHelper.logPayment (cognitive 44) StripePaymentSheet/StripePaymentSheet/Source/Analytics/PaymentSheetAnalyticsHelper.swift:364 — PaymentSheetAnalyticsHelper.logPayment has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 9 (26 pts), if/else 8 (12 pts), match/switch 4 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckoutController.confirmCheckoutSession (cognitive 44) · ×1
  • CheckoutController.confirmCheckoutSession (cognitive 44) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:429 — CheckoutController.confirmCheckoutSession has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (21 pts), match/switch 7 (15 pts), error handling 4 (8 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetVerticalViewController.calculateInitialSelection (cognitive 42) · ×1
  • PaymentSheetVerticalViewController.calculateInitialSelection (cognitive 42) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:373 — PaymentSheetVerticalViewController.calculateInitialSelection has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 10, match/switch 3 (5 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheet.handleDeferredIntentConfirmation (cognitive 41) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation (cognitive 41) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:63 — PaymentSheet.handleDeferredIntentConfirmation has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 2 (4 pts), error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ErrorViewController.viewDidLoad (cognitive 40) · ×1
  • ErrorViewController.viewDidLoad (cognitive 40) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift:41 — ErrorViewController.viewDidLoad has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeFlowController.closeAuthFlow (cognitive 38) · ×1
  • NativeFlowController.closeAuthFlow (cognitive 38) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:360 — NativeFlowController.closeAuthFlow has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 2 (6 pts), boolean chains 3, ternaries 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPDecodingContainerProtocol.castFromNSObject (cognitive 36) · ×1
  • STPDecodingContainerProtocol.castFromNSObject (cognitive 36) StripeCore/StripeCore/Source/Coder/StripeJSONDecoder.swift:567 — STPDecodingContainerProtocol.castFromNSObject has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 3 (5 pts), boolean chains 4, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LinkAccountPickerViewController.didSelectConnectAccounts (cognitive 36) · ×1
  • LinkAccountPickerViewController.didSelectConnectAccounts (cognitive 36) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerViewController.swift:246 — LinkAccountPickerViewController.didSelectConnectAccounts has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheet.handleDeferredIntentConfirmation_confirmationToken (cognitive 36) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation_confirmationToken (cognitive 36) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:12 — PaymentSheet.handleDeferredIntentConfirmation_confirmationToken has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentHandler._handleRedirect (cognitive 36) · ×1
  • STPPaymentHandler._handleRedirect (cognitive 36) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1836 — STPPaymentHandler._handleRedirect has cognitive complexity 36 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StackViewWithSeparator.layoutSubviews (cognitive 36) · ×1
  • StackViewWithSeparator.layoutSubviews (cognitive 36) StripeUICore/StripeUICore/Source/Helpers/StackViewWithSeparator.swift:142 — StackViewWithSeparator.layoutSubviews has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (8 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AccountPickerViewController.pollAuthSessionAccounts (cognitive 34) · ×1
  • AccountPickerViewController.pollAuthSessionAccounts (cognitive 34) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:146 — AccountPickerViewController.pollAuthSessionAccounts has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 8, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPCustomer.sources (cognitive 34) · ×1
  • STPCustomer.sources (cognitive 34) StripePayments/StripePayments/Source/API Bindings/Models/STPCustomer.swift:150 — STPCustomer.sources has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 7, loops 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · AccountPickerNoAccountEligibleErrorView.init (cognitive 33) · ×1
  • AccountPickerNoAccountEligibleErrorView.init (cognitive 33) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerNoAccountEligibleErrorView.swift:16 — AccountPickerNoAccountEligibleErrorView.init has cognitive complexity 33 (threshold 15). Drivers by points: if/else 22 (33 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentCardTextField.formTextFieldTextDidChange (cognitive 33) · ×1
  • STPPaymentCardTextField.formTextFieldTextDidChange (cognitive 33) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1760 — STPPaymentCardTextField.formTextFieldTextDidChange has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 1, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ElementsCustomer.parsePaymentMethods (cognitive 31) · ×1
  • ElementsCustomer.parsePaymentMethods (cognitive 31) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/ElementsCustomer.swift:56 — ElementsCustomer.parsePaymentMethods has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConfirmButton.update (cognitive 31) · ×1
  • ConfirmButton.update (cognitive 31) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift:292 — ConfirmButton.update has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 5 (8 pts), match/switch 5 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentCardTextField.paymentMethodParams (cognitive 31) · ×1
  • STPPaymentCardTextField.paymentMethodParams (cognitive 31) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:441 — STPPaymentCardTextField.paymentMethodParams has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · STPIntentAction.decodedObject (cognitive 31) · ×1
  • STPIntentAction.decodedObject (cognitive 31) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:353 — STPIntentAction.decodedObject has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkAccountPickerViewController.linkAccountPickerBodyView (cognitive 30) · ×1
  • LinkAccountPickerViewController.linkAccountPickerBodyView (cognitive 30) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerViewController.swift:569 — LinkAccountPickerViewController.linkAccountPickerBodyView has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPIntentAction.description (cognitive 29) · ×1
  • STPIntentAction.description (cognitive 29) StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:232 — STPIntentAction.description has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 1 (nesting depth added 14). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · STPAPIClient.updatePaymentMethodParameters (cognitive 28) · ×1
  • STPAPIClient.updatePaymentMethodParameters (cognitive 28) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:244 — STPAPIClient.updatePaymentMethodParameters has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (28 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentSide.instruction (cognitive 28) · ×1
  • DocumentSide.instruction (cognitive 28) StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift:16 — DocumentSide.instruction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 4 (11 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Appearance.init (cognitive 28) · ×1
  • Appearance.init (cognitive 28) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PaymentMethodMessagingElement.swift:141 — Appearance.init has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 3, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PartnerAuthViewController.openInstitutionAuthenticationWebView (cognitive 27) · ×1
  • PartnerAuthViewController.openInstitutionAuthenticationWebView (cognitive 27) StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PartnerAuthViewController.swift:393 — PartnerAuthViewController.openInstitutionAuthenticationWebView has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DocumentCaptureViewController.scanningTextWithNoInput (cognitive 27) · ×1
  • DocumentCaptureViewController.scanningTextWithNoInput (cognitive 27) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:18 — DocumentCaptureViewController.scanningTextWithNoInput has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 8 (9 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPFormTextField.autoFormattingBehavior (cognitive 27) · ×1
  • STPFormTextField.autoFormattingBehavior (cognitive 27) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:77 — STPFormTextField.autoFormattingBehavior has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · STPAPIClient.makeElementsSessionsParams (cognitive 26) · ×1
  • STPAPIClient.makeElementsSessionsParams (cognitive 26) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:16 — STPAPIClient.makeElementsSessionsParams has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FinancialConnectionsWebFlowViewController.startAuthenticationSession (cognitive 24) · ×1
  • FinancialConnectionsWebFlowViewController.startAuthenticationSession (cognitive 24) StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:153 — FinancialConnectionsWebFlowViewController.startAuthenticationSession has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), error handling 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPCardScanner.processVNRequest (cognitive 24) · ×1
  • STPCardScanner.processVNRequest (cognitive 24) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:275 — STPCardScanner.processVNRequest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerSession.decoded (cognitive 24) · ×1
  • CustomerSession.decoded (cognitive 24) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/CustomerSession.swift:21 — CustomerSession.decoded has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (11 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CustomerSavedPaymentMethodsViewController.updateUI (cognitive 24) · ×1
  • CustomerSavedPaymentMethodsViewController.updateUI (cognitive 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:252 — CustomerSavedPaymentMethodsViewController.updateUI has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 3 (8 pts), match/switch 2, boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BillingDetails.init (cognitive 23) · ×1
  • BillingDetails.init (cognitive 23) StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:67 — BillingDetails.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPAPIClient.billingDetails (cognitive 23) · ×1
  • STPAPIClient.billingDetails (cognitive 23) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:92 — STPAPIClient.billingDetails has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CryptoOnrampCoordinator.collectPaymentMethod (cognitive 23) · ×1
  • CryptoOnrampCoordinator.collectPaymentMethod (cognitive 23) REDACTED:670 — CryptoOnrampCoordinator.collectPaymentMethod has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), error handling 1 (2 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PaymentSheetLoader.load (cognitive 23) · ×1
  • PaymentSheetLoader.load (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:60 — PaymentSheetLoader.load has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkController.authorize (cognitive 23) · ×1
  • LinkController.authorize (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:699 — LinkController.authorize has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 3 (12 pts), if/else 5 (11 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PaymentSheetFlowControllerViewController.updateButton (cognitive 23) · ×1
  • PaymentSheetFlowControllerViewController.updateButton (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:455 — PaymentSheetFlowControllerViewController.updateButton has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (6 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · AppleCreditCardOcr.recognizeCard (cognitive 22) · ×1
  • AppleCreditCardOcr.recognizeCard (cognitive 22) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/AppleCreditCardOcr.swift:11 — AppleCreditCardOcr.recognizeCard has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, loops 1 (nesting depth added 11). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · CryptoOnrampCoordinator.performCheckout (cognitive 22) · ×1
  • CryptoOnrampCoordinator.performCheckout (cognitive 22) REDACTED:787 — CryptoOnrampCoordinator.performCheckout has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NSMutableAttributedString.pmmePromoString (cognitive 22) · ×1
  • NSMutableAttributedString.pmmePromoString (cognitive 22) StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/NSAttributedString+Extensions.swift:80 — NSMutableAttributedString.pmmePromoString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetLoader.fetchElementsSessionAndIntent (cognitive 22) · ×1
  • PaymentSheetLoader.fetchElementsSessionAndIntent (cognitive 22) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:241 — PaymentSheetLoader.fetchElementsSessionAndIntent has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (6 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UpdatePaymentMethodViewController.update (cognitive 22) · ×1
  • UpdatePaymentMethodViewController.update (cognitive 22) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:236 — UpdatePaymentMethodViewController.update has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPostalCodeValidator.validationState (cognitive 22) · ×1
  • STPPostalCodeValidator.validationState (cognitive 22) StripePaymentsUI/StripePaymentsUI/Source/Helpers/STPPostalCodeValidator.swift:116 — STPPostalCodeValidator.validationState has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (22 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPFormView.set (cognitive 22) · ×1
  • STPFormView.set (cognitive 22) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift:125 — STPFormView.set has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextFieldFormatter.applyFormat (cognitive 22) · ×1
  • TextFieldFormatter.applyFormat (cognitive 22) StripeUICore/StripeUICore/Source/Elements/TextField/TextFieldFormatter.swift:51 — TextFieldFormatter.applyFormat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPFakeAddPaymentPassViewController.next (cognitive 21) · ×1
  • STPFakeAddPaymentPassViewController.next (cognitive 21) StripeIssuing/StripeIssuing/Source/STPFakeAddPaymentPassViewController.swift:207 — STPFakeAddPaymentPassViewController.next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PayWithLinkViewController.launchFinancialConnections (cognitive 21) · ×1
  • PayWithLinkViewController.launchFinancialConnections (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift:629 — PayWithLinkViewController.launchFinancialConnections has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CheckoutSessionPoller.poll (cognitive 21) · ×1
  • CheckoutSessionPoller.poll (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutSessionPoller.swift:72 — CheckoutSessionPoller.poll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 1 (2 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerSavedPaymentMethodsViewController.didTapActionButton (cognitive 21) · ×1
  • CustomerSavedPaymentMethodsViewController.didTapActionButton (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:399 — CustomerSavedPaymentMethodsViewController.didTapActionButton has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (4 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PaymentMethodMessagingElement.init (cognitive 21) · ×1
  • PaymentMethodMessagingElement.init (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PaymentMethodMessagingElement.swift:15 — PaymentMethodMessagingElement.init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetFormFactory.makeCard (cognitive 21) · ×1
  • PaymentSheetFormFactory.makeCard (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:42 — PaymentSheetFormFactory.makeCard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5, boolean chains 4, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PaymentSheetViewController.updateUI (cognitive 21) · ×1
  • PaymentSheetViewController.updateUI (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:310 — PaymentSheetViewController.updateUI has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (9 pts), match/switch 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPFormView.configureFooter (cognitive 21) · ×1
  • STPFormView.configureFooter (cognitive 21) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift:346 — STPFormView.configureFooter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · STPPaymentHandler.confirmSetupIntent (cognitive 21) · ×1
  • STPPaymentHandler.confirmSetupIntent (cognitive 21) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:538 — STPPaymentHandler.confirmSetupIntent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Intent.fulfilledRequirements (cognitive 20) · ×1
  • Intent.fulfilledRequirements (cognitive 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Intent.swift:206 — Intent.fulfilledRequirements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 6, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ApplePayContextClosureDelegate.applePayContext (cognitive 20) · ×1
  • ApplePayContextClosureDelegate.applePayContext (cognitive 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:64 — ApplePayContextClosureDelegate.applePayContext has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · STPCardFormView.shouldAutoAdvance (cognitive 20) · ×1
  • STPCardFormView.shouldAutoAdvance (cognitive 20) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPCardFormView.swift:436 — STPCardFormView.shouldAutoAdvance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (20 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentHandler._markChallengeCompleted (cognitive 20) · ×1
  • STPPaymentHandler._markChallengeCompleted (cognitive 20) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2228 — STPPaymentHandler._markChallengeCompleted has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · SectionContainerView.updateUI (cognitive 20) · ×1
  • SectionContainerView.updateUI (cognitive 20) StripeUICore/StripeUICore/Source/Elements/Section/SectionContainerView.swift:99 — SectionContainerView.updateUI has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · StripeAttest._attest (cognitive 19) · ×1
  • StripeAttest._attest (cognitive 19) StripeCore/StripeCore/Source/Attestation/StripeAttest.swift:296 — StripeAttest._attest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPElementsSession.decodedObject (cognitive 19) · ×1
  • STPElementsSession.decodedObject (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:167 — STPElementsSession.decodedObject has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PaymentSheet.createConfirmationTokenParams (cognitive 19) · ×1
  • PaymentSheet.createConfirmationTokenParams (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet.swift:158 — PaymentSheet.createConfirmationTokenParams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3, boolean chains 2 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PaymentSheetFlowControllerViewController.init (cognitive 19) · ×1
  • PaymentSheetFlowControllerViewController.init (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:182 — PaymentSheetFlowControllerViewController.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, match/switch 1 (3 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPTextFieldDelegateProxy.textField (cognitive 19) · ×1
  • STPTextFieldDelegateProxy.textField (cognitive 19) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:383 — STPTextFieldDelegateProxy.textField has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPCardExpiryInputTextFieldFormatter.isAllowedInput (cognitive 19) · ×1
  • STPCardExpiryInputTextFieldFormatter.isAllowedInput (cognitive 19) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:15 — STPCardExpiryInputTextFieldFormatter.isAllowedInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · STPPaymentHandler.confirmPaymentIntent (cognitive 19) · ×1
  • STPPaymentHandler.confirmPaymentIntent (cognitive 19) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:200 — STPPaymentHandler.confirmPaymentIntent has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · STPPaymentHandler.handleNextAction (cognitive 19) · ×1
  • STPPaymentHandler.handleNextAction (cognitive 19) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:439 — STPPaymentHandler.handleNextAction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · STPAnalyticsEventTranslator.translateEvent (cognitive 18) · ×1
  • STPAnalyticsEventTranslator.translateEvent (cognitive 18) StripeCore/StripeCore/Source/Analytics/Eventing/STPAnalyticsEventTranslator.swift:27 — STPAnalyticsEventTranslator.translateEvent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · URLEncoder.swift.queryComponents (cognitive 18) · ×1
  • URLEncoder.swift.queryComponents (cognitive 18) StripeCore/StripeCore/Source/Helpers/URLEncoder.swift:54 — URLEncoder.swift.queryComponents has cognitive complexity 18 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 4 (5 pts), ternaries 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AccountPickerViewController.didSelectLinkAccounts (cognitive 18) · ×1
  • AccountPickerViewController.didSelectLinkAccounts (cognitive 18) StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:398 — AccountPickerViewController.didSelectLinkAccounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AuthenticationSessionManager.start (cognitive 18) · ×1
  • AuthenticationSessionManager.start (cognitive 18) StripeFinancialConnections/StripeFinancialConnections/Source/Web/AuthenticationSessionManager.swift:38 — AuthenticationSessionManager.start has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · STPEphemeralKey.decodedObject (cognitive 18) · ×1
  • STPEphemeralKey.decodedObject (cognitive 18) StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37 — STPEphemeralKey.decodedObject has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkInlineSignupViewModel.action (cognitive 18) · ×1
  • LinkInlineSignupViewModel.action (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ViewModels/LinkInlineSignupViewModel.swift:264 — LinkInlineSignupViewModel.action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetLoader.filterSavedPaymentMethods (cognitive 18) · ×1
  • PaymentSheetLoader.filterSavedPaymentMethods (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:352 — PaymentSheetLoader.filterSavedPaymentMethods has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TwoOptionSelectorView.handlePan (cognitive 18) · ×1
  • TwoOptionSelectorView.handlePan (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/TwoOptionSelectorView.swift:294 — TwoOptionSelectorView.handlePan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmbeddedPaymentElement.performUpdate (cognitive 18) · ×1
  • EmbeddedPaymentElement.performUpdate (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:180 — EmbeddedPaymentElement.performUpdate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, match/switch 2 (3 pts), ternaries 3, boolean chains 2, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · PaymentMethodFormViewController.paymentOption (cognitive 18) · ×1
  • PaymentMethodFormViewController.paymentOption (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:33 — PaymentMethodFormViewController.paymentOption has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPImageLibrary.brandImage (cognitive 18) · ×1
  • STPImageLibrary.brandImage (cognitive 18) StripePaymentsUI/StripePaymentsUI/Source/Helpers/STPImageLibrary.swift:140 — STPImageLibrary.brandImage has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 1, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · STPCardValidator.validationState (cognitive 18) · ×1
  • STPCardValidator.validationState (cognitive 18) StripePayments/StripePayments/Source/Helpers/STPCardValidator.swift:333 — STPCardValidator.validationState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (6 pts), boolean chains 4, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPApplePayContext.makePaymentSummaryItems (cognitive 17) · ×1
  • STPApplePayContext.makePaymentSummaryItems (cognitive 17) StripeApplePay/StripeApplePay/Source/ApplePayContext/STPApplePayContext.swift:19 — STPApplePayContext.makePaymentSummaryItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 2 (4 pts), ternaries 1 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FCLiteContainerViewController.completeFlow (cognitive 17) · ×1
  • FCLiteContainerViewController.completeFlow (cognitive 17) StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Controllers/FCLiteContainerViewController.swift:113 — FCLiteContainerViewController.completeFlow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (3 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FinancialConnectionsWebFlowViewController.fetchSession (cognitive 17) · ×1
  • FinancialConnectionsWebFlowViewController.fetchSession (cognitive 17) StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:255 — FinancialConnectionsWebFlowViewController.fetchSession has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstantDebitsOnlyAuthenticationSessionManager.start (cognitive 17) · ×1
  • InstantDebitsOnlyAuthenticationSessionManager.start (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ACH/InstantDebitsOnlyFinancialConnectionsAuthManager.swift:71 — InstantDebitsOnlyAuthenticationSessionManager.start has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 1 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · IntentConfirmParams.setAllowRedisplay (cognitive 17) · ×1
  • IntentConfirmParams.setAllowRedisplay (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/IntentConfirmParams.swift:144 — IntentConfirmParams.setAllowRedisplay has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (17 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomerSheet.retrievePaymentOptionSelection (cognitive 17) · ×1
  • CustomerSheet.retrievePaymentOptionSelection (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet.swift:364 — CustomerSheet.retrievePaymentOptionSelection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VerticalListMandateProvider.mandate (cognitive 17) · ×1
  • VerticalListMandateProvider.mandate (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/MandateTextProvider.swift:38 — VerticalListMandateProvider.mandate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PaymentSheetVerticalViewController.updatePrimaryButton (cognitive 17) · ×1
  • PaymentSheetVerticalViewController.updatePrimaryButton (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:296 — PaymentSheetVerticalViewController.updatePrimaryButton has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 4 (7 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · VerticalPaymentMethodListViewController.renderContent (cognitive 17) · ×1
  • VerticalPaymentMethodListViewController.renderContent (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift:99 — VerticalPaymentMethodListViewController.renderContent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AutoCompleteViewController.tableView (cognitive 17) · ×1
  • AutoCompleteViewController.tableView (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/AutoComplete/AutoCompleteViewController.swift:439 — AutoCompleteViewController.tableView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPFormView.previousField (cognitive 17) · ×1
  • STPFormView.previousField (cognitive 17) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift:273 — STPFormView.previousField has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (STPFormView.nextInSequenceFirstResponderField) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · STPFormView.nextInSequenceFirstResponderField (cognitive 17) · ×1
  • STPFormView.nextInSequenceFirstResponderField (cognitive 17) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFormView.swift:305 — STPFormView.nextInSequenceFirstResponderField has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (STPFormView.previousField) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · STPConnectAccountIndividualParams.description (cognitive 17) · ×1
  • STPConnectAccountIndividualParams.description (cognitive 17) StripePayments/StripePayments/Source/API Bindings/Models/STPConnectAccountIndividualParams.swift:78 — STPConnectAccountIndividualParams.description has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 17. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · STPBINController.retrieveBINRanges (cognitive 17) · ×1
  • STPBINController.retrieveBINRanges (cognitive 17) StripePayments/StripePayments/Source/Helpers/STPBINController.swift:270 — STPBINController.retrieveBINRanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddressSectionElement.updateAddressFields (cognitive 17) · ×1
  • AddressSectionElement.updateAddressFields (cognitive 17) StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift:354 — AddressSectionElement.updateAddressFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · CreditCardUtils.determineCardType (cognitive 16) · ×1
  • CreditCardUtils.determineCardType (cognitive 16) StripeCardScan/StripeCardScan/Source/CardScan/CardUtils/CreditCardUtils.swift:252 — CreditCardUtils.determineCardType has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PostDetectionAlgorithm.combineCloseBoxes (cognitive 16) · ×1
  • PostDetectionAlgorithm.combineCloseBoxes (cognitive 16) StripeCardScan/StripeCardScan/Source/CardScan/MLRuntime/PostDetectionAlgorithm.swift:102 — PostDetectionAlgorithm.combineCloseBoxes has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 2 (6 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoFeed.configureSession (cognitive 16) · ×1
  • VideoFeed.configureSession (cognitive 16) StripeCardScan/StripeCardScan/Source/CardScan/UI/VideoFeed.swift:75 — VideoFeed.configureSession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InstitutionTableView.load (cognitive 16) · ×1
  • InstitutionTableView.load (cognitive 16) StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift:212 — InstitutionTableView.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LinkAccountPickerViewController.presentAccountUpdateRequiredDrawer (cognitive 16) · ×1
  • LinkAccountPickerViewController.presentAccountUpdateRequiredDrawer (cognitive 16) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerViewController.swift:456 — LinkAccountPickerViewController.presentAccountUpdateRequiredDrawer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · STPCardScanner.setupCamera (cognitive 16) · ×1
  • STPCardScanner.setupCamera (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:177 — STPCardScanner.setupCamera has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ExpressCheckoutElementUtilities.availablePaymentMethods (cognitive 16) · ×1
  • ExpressCheckoutElementUtilities.availablePaymentMethods (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElementUtilities.swift:18 — ExpressCheckoutElementUtilities.availablePaymentMethods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentCardTextField.textFieldDidEndEditing (cognitive 16) · ×1
  • STPPaymentCardTextField.textFieldDidEndEditing (cognitive 16) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:2010 — STPPaymentCardTextField.textFieldDidEndEditing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · STPPaymentCardTextField.updateImage (cognitive 16) · ×1
  • STPPaymentCardTextField.updateImage (cognitive 16) StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:2168 — STPPaymentCardTextField.updateImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · STPPaymentIntent.decodedObject (cognitive 16) · ×1
  • STPPaymentIntent.decodedObject (cognitive 16) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:254 — STPPaymentIntent.decodedObject has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 6, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · STPFormEncoder.formEncodableValue (cognitive 16) · ×1
  • STPFormEncoder.formEncodableValue (cognitive 16) StripePayments/StripePayments/Source/Internal/API Bindings/STPFormEncoder.swift:58 — STPFormEncoder.formEncodableValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · STPPaymentHandler._markChallengeCanceled (cognitive 16) · ×1
  • STPPaymentHandler._markChallengeCanceled (cognitive 16) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2139 — STPPaymentHandler._markChallengeCanceled has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency · Inconsistent parameter naming for the view controller argument. One uses `from · ×1
  • Inconsistent parameter naming for the view controller argument. One uses `from:` and the other uses `from:` (consistent), but the completion handler signature differs in payload type which is expected, however, looking at `FinancialConnectionsSheet`, there is a mix of `present` and `presentForToken`. More critically, `CardScanSheet` and `CardImageVerificationSheet` are distinct domains (Scan vs Verify), so this is actually consistent. Let's look for real issues. — N/A (signatures: CardScanSheet.present(from: UIViewController, completion: @escaping (CardScanSheetResult) -> Void, animated: Bool) | CardImageVerificationSheet.present(from: UIViewController, completion: @escaping (CardImageVerificationResult) -> Void, animated: Bool))
D22 · Internal API Consistency · Inconsistent method naming for similar intents. `present` is generic, while `presentForToken` is specific. This forces developers to choose between a generic method that returns a union type `Result` (likely an enum or protocol) and a specific method. While distinct, the generic `present` method's return type `Result` is ambiguous compared to the explicit `TokenResult` and `HostControllerResult` types used elsewhere. · ×1
  • Inconsistent method naming for similar intents. `present` is generic, while `presentForToken` is specific. This forces developers to choose between a generic method that returns a union type `Result` (likely an enum or protocol) and a specific method. While distinct, the generic `present` method's return type `Result` is ambiguous compared to the explicit `TokenResult` and `HostControllerResult` types used elsewhere. — Rename `present` to `presentGeneric` or ensure the `Result` type is clearly documented as a union. Alternatively, if `presentForToken` is the primary use case, consider making the generic `present` return a more descriptive type or deprecating the ambiguity. (signatures: FinancialConnectionsSheet.present(from: UIViewController, completion: @escaping (Result) -> Void) | FinancialConnectionsSheet.presentForToken(from: UIViewController, completion: @escaping (TokenResult) -> Void))
D22 · Internal API Consistency · Inconsistent parameter naming for the same operation across overloads. `presentApplePay` uses `from · ×1
  • Inconsistent parameter naming for the same operation across overloads. `presentApplePay` uses `from:` for a window and `on:` for a view controller. This is a minor inconsistency in preposition usage (`from` vs `on`) for similar contextual arguments. — Standardize on `from:` for all presentation contexts or `on:` for all, e.g., `presentApplePay(from: UIViewController)` and `presentApplePay(from: UIWindow?)`. (signatures: STPApplePayContext.presentApplePay(completion: STPVoidBlock?) | STPApplePayContext.presentApplePay(from: UIWindow?, completion: STPVoidBlock?) | STPApplePayContext.presentApplePay(on: UIViewController, completion: STPVoidBlock?))
D22 · Internal API Consistency · Inconsistent parameter naming for the presenting view controller. Most sheets use `from · ×1
  • Inconsistent parameter naming for the presenting view controller. Most sheets use `from:`, but `AccountOnboardingController` also uses `from:`. However, `CheckScanningController` uses `present(from: UIViewController, animated: Bool)` and `dismiss(animated: Bool, completion: ...)`. The inconsistency is subtle but present in `STPApplePayContext` which uses `on:` for UIViewController. Also, `CardScanSheet` and `CardImageVerificationSheet` use `from:` while `STPApplePayContext` uses `on:`. — Standardize all presentation methods to use `from:` for the presenting context (UIViewController or UIWindow) to maintain consistency across the SDK. (signatures: CardScanSheet.present(from: UIViewController, ...) | CardImageVerificationSheet.present(from: UIViewController, ...) | FinancialConnectionsSheet.present(from: UIViewController, ...) | IdentityVerificationSheet.present(from: UIViewController, ...) | PaymentSheet.present(from: UIViewController, ...) | AccountOnboardingController.present(from: UIViewController, animated: Bool))
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · FunctionTooLong · ×1
  • FunctionTooLong: NativeFlowController.swift.CreatePaneViewController StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1477 — FunctionTooLong — CreatePaneViewController runs 324 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 224 over it, 3.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D32 · Data Compliance (PII/GDPR) · REDACTED · ×1
  • REDACTED
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: HostViewController.swift → FinancialConnectionsSheet.swift, NativeFlowController.swift, FinancialConnectionsWebFlowViewController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Common/HostViewController.swift — `StripeFinancialConnections/StripeFinancialConnections/Source/Common/HostViewController.swift` changes together with 3 other files — `StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSheet.swift`, `StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift`, `StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D35 · Change Coupling · Change coupling clique · ×1
  • Change coupling clique: NetworkingLinkVerificationDataSource.swift, NetworkingSaveToLinkVerificationDataSource.swift, NetworkingOTPView.swift StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift — 3 files — `StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationDataSource.swift`, `StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingSaveToLinkVerification/NetworkingSaveToLinkVerificationDataSource.swift`, `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/NetworkingOTPView/NetworkingOTPView.swift` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication · Near-duplicate member family (4 members, 35 shared lines) · ×1
  • Near-duplicate member family (4 members, 35 shared lines) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:126 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:126-196 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:210-282 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:551-620 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:634-706 — These 4 members are variants of one another: a block of 35 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Near-duplicate member pair (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63-241 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:12-156 — These two members are variants of one another: 48 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:77 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:77-162 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:45-81 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (12 members, 50+ identical tokens) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:49 — StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:49-76 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/KycInfo.swift:102-126 | StripeIdentity/StripeIdentity/Source/Categories/NSAttributedString+HTML.swift:55-93 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift:66-92 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:76-117 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:155-205 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift:55-89 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:199-248 | StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:65-100 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/LinkSettings.swift:55-93 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:312-347 | StripePayments/StripePayments/Source/Internal/API Bindings/STPIntentActionUseStripeSDK.swift:51-80 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication · Duplicated block (54 lines × 2) · ×1
  • Duplicated block (54 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:138 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:138-191 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:223-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:138` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (47 lines × 2) · ×1
  • Duplicated block (47 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:453 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:453-499 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift:198-244 — before extracting anything, compare `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift` and `StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:453` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (44–45 lines × 2) · ×1
  • Duplicated block (44–45 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:410 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:410-454 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:832-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:410` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (45 lines × 2) · ×1
  • Duplicated block (45 lines × 2) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:563 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:563-607 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:647-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:563` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:45 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:45-76 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift:56-87 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27–30 lines × 2) · ×1
  • Duplicated block (27–30 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:52 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:52-78 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:92-121 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (24–28 lines × 3) · ×1
  • Duplicated block (24–28 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift:71 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift:71-98 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupBodyView.swift:80-105 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:167-190 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentBodyView.swift:71` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) StripeIssuing/StripeIssuing/Source/STPPinManagementService.swift:59 — StripeIssuing/StripeIssuing/Source/STPPinManagementService.swift:59-86 | StripeIssuing/StripeIssuing/Source/STPPinManagementService.swift:115-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIssuing/StripeIssuing/Source/STPPinManagementService.swift:59` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:988 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:988-1015 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1060-1087 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:988` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (23–27 lines × 2) · ×1
  • Duplicated block (23–27 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1621 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1621-1647 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1722-1744 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1621` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:364 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:364-388 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:488-511 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:364` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:393 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:393-415 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:801-823 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1124-1146 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:502-524 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `paymentMethod` to `StripePayments.STPPaymentMethod` in one and `STPPaymentMethod` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:825` calls `updateUI` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:526` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–23 lines × 2) · ×1
  • Duplicated block (13–23 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/USBankAccount/InstantDebitsPaymentMethodElement.swift:295 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/USBankAccount/InstantDebitsPaymentMethodElement.swift:295-317 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/USBankAccount/USBankAccountPaymentMethodElement.swift:224-236 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/USBankAccount/USBankAccountPaymentMethodElement.swift:224` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:156 — StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:156-176 | StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardViewController.swift:202-223 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardAddViewController.swift:156` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/ManualEntry/ManualEntryFormView.swift:151 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/ManualEntry/ManualEntryFormView.swift:151-172 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/NetworkingOTPView/NetworkingOTPView.swift:128-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/ManualEntry/ManualEntryFormView.swift:151` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–22 lines × 2) · ×1
  • Duplicated block (19–22 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:223 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:223-241 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:242-263 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:223` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:432 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:432-450 | StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift:176-195 — before extracting anything, compare `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift` and `StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPFloatingPlaceholderTextField.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:432` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:964 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:964-981 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1033-1051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:964` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:389 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:389-401 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:285-301 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 105 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:348 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:348-361 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:384-397 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:280-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:348` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:120 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:120-135 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:158-173 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:186-201 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:221 — StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:221-236 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/LinkSettings.swift:147-161 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:491-505 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:128 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:128-142 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:201-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentLogoView.swift:130 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentLogoView.swift:130-142 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PrepaneImageView.swift:101-115 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (3–15 lines × 3) · ×1
  • Duplicated block (3–15 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:77 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:77-91 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift:88-102 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithRadioView.swift:98-100 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:411 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:411-424 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:435-448 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:461-474 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (12–13 lines × 11) · ×1
  • Duplicated block (12–13 lines × 11) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62 — StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62-74 | StripeIdentity/StripeIdentity/Source/Categories/NSAttributedString+HTML.swift:74-85 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift:79-90 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:96-107 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:173-184 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/VerticalPaymentMethodListViewController.swift:71-82 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift:223-234 | StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:82-93 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/LinkSettings.swift:74-85 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:329-340 | StripePayments/StripePayments/Source/Internal/API Bindings/STPIntentActionUseStripeSDK.swift:65-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 11 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 11 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:50 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:50-62 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift:61-73 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithRadioView.swift:73-85 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFloating.swift:97-109 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithDisclosure.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButtonFlatWithCheckmark.swift:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:152 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:152-164 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:237-249 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:577-588 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:661-672 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:152` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62 — StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62-74 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/KycInfo.swift:114-125 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift:79-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×1
  • Duplicated block (12 lines × 4) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:139 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:139-150 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:224-235 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:564-575 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:648-659 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:139` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) StripeConnect/StripeConnect/Source/Components/AccountOnboardingController.swift:112 — StripeConnect/StripeConnect/Source/Components/AccountOnboardingController.swift:112-122 | StripeConnect/StripeConnect/Source/Components/CheckScanningController.swift:83-93 | StripeConnect/StripeConnect/Source/Internal/NotificationBanner/NotificationBannerTaskController.swift:61-72 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripeConnect/StripeConnect/Source/Components/AccountOnboardingController.swift:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:94 — StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:94-105 | StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:297-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `STPTokenCompletionBlock?` in one and `STPTokenCompletionBlock? = nil` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:177 — StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:177-187 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:262-272 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:601-611 | StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:685-695 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/Helpers/STPBankAccountCollector.swift:177` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButton.swift:90 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButton.swift:90-100 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButton.swift:356-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5–10 lines × 4) · ×1
  • Duplicated block (5–10 lines × 4) StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37 — StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37-45 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:262-270 | StripePayments/StripePayments/Source/API Bindings/Models/STPFile.swift:106-115 | StripePayments/StripePayments/Source/API Bindings/Models/STPToken.swift:104-108 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:232 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:232-238 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationViewController.swift:110-116 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:328-334 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:252-260 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (6–8 lines × 3) · ×1
  • Duplicated block (6–8 lines × 3) StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:78 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:78-83 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodAddress.swift:70-75 | StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:254-261 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntentShippingDetailsAddressParams.swift:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:15 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:15-22 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:19-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:15` calls `init` and `StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldFormatter.swift:13` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1418 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1418-1423 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1429-1434 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1465-1470 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1494-1499 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1418` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1427` calls `presentPollingVCForAction` and `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1464` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2590 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2590-2595 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2610-2615 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2704-2709 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 8) · ×1
  • Duplicated block (5 lines × 8) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:86 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:86-90 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:102-106 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:126-130 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:142-146 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:169-173 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:186-190 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:210-214 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:227-231 — there are 8 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (88 lines × 2) · ×1
  • Duplicated block (88 lines × 2) Example/AppClipExample/Shared/PaymentButton.swift:20 — Example/AppClipExample/Shared/PaymentButton.swift:20-107 | Testers/IntegrationTester/IntegrationTester/Source/HelperViews/PaymentButton.swift:20-107 — before extracting anything, compare `Example/AppClipExample/Shared/PaymentButton.swift` and `Testers/IntegrationTester/IntegrationTester/Source/HelperViews/PaymentButton.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/AppClipExample/Shared/PaymentButton.swift:20` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift:12 — StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift:12-45 | StripeIdentity/StripeIdentity/Source/Helpers/String+Localized.swift:15-579 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController+Strings.swift:12-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 6) · ×1
  • Duplicated block (9 lines × 6) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirmParams.swift:14 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirmParams.swift:14-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAfterpayClearpayParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCashAppParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKlarnaParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMultibancoParams.swift:14-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodRevolutPayParams.swift:12-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 23) · ×1
  • Duplicated block (7 lines × 23) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlipayParams.swift:18 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlipayParams.swift:18-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlmaParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAmazonPayParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBLIKParams.swift:18-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBillieParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCryptoParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGoPayParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKakaoPayParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKrCardParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMobilePayParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodOXXOParams.swift:16-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPalParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPayParams.swift:14-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPaycoParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPrzelewy24Params.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSatispayParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodScalapayParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSequraParams.swift:15-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSunbitParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSwishParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodVippsParams.swift:13-21 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWeChatPayParams.swift:15-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWeroParams.swift:15-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 23 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/InvalidWalletOwnershipChallengeError.swift:45 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/InvalidWalletOwnershipChallengeError.swift:45-53 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/InvalidWalletOwnershipSignatureError.swift:45-53 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/UnsupportedNetworkError.swift:45-53 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/WalletNotFoundError.swift:45-53 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/WalletOwnershipChallengeExpiredError.swift:45-53 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift:147 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift:147-154 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupViewController.swift:194-202 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkVerification/NetworkingLinkVerificationViewController.swift:71-79 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingSaveToLinkVerification/NetworkingSaveToLinkVerificationViewController.swift:88-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (7 lines × 19) · ×1
  • Duplicated block (7 lines × 19) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAfterpayClearpay.swift:28 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAfterpayClearpay.swift:28-35 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlma.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAmazonPay.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBillie.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBoleto.swift:48-55 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCashApp.swift:29-37 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCrypto.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKlarna.swift:29-37 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNetBanking.swift:32-38 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayByBank.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPal.swift:28-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPay.swift:27-33 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPrzelewy24.swift:28-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodRevolutPay.swift:26-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSEPADebit.swift:48-54 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSatispay.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSunbit.swift:28-36 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWeChatPay.swift:28-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWero.swift:28-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 19 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 7) · ×1
  • Duplicated block (6 lines × 7) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBacsDebit.swift:38 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBacsDebit.swift:38-43 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBancontact.swift:28-33 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodEPS.swift:28-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGrabPay.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodLink.swift:29-34 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTwint.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/Sources/Types/STPSourceCardDetails.swift:54-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 7 times.
D4 · Code Duplication · Duplicated block (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGoPay.swift:27 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGoPay.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKakaoPay.swift:26-31 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayco.swift:26-31 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodScalapay.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSequra.swift:26-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 35) · ×1
  • Duplicated block (6 lines × 35) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirm.swift:18 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirm.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAfterpayClearpay.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlipay.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAlma.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAmazonPay.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBLIK.swift:19-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBancontact.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodBillie.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCardPresent.swift:17-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCashApp.swift:19-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodCrypto.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodEPS.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGoPay.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGrabPay.swift:17-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKakaoPay.swift:18-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKlarna.swift:19-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodLink.swift:19-26 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMobilePay.swift:16-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMultibanco.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodOXXO.swift:17-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayByBank.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPal.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayPay.swift:17-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayco.swift:18-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPrzelewy24.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodRevolutPay.swift:16-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSatispay.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodScalapay.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSequra.swift:18-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSunbit.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSwish.swift:16-23 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTwint.swift:17-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodVipps.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWeChatPay.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodWero.swift:18-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 35 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodOXXO.swift:27` calls `init` and `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodAffirm.swift:28` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Near-duplicate member family (11 members, 26 shared lines) · ×1
  • Near-duplicate member family (11 members, 26 shared lines) Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:66 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:66-101 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:68-110 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:68-110 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:68-110 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:66-112 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:69-111 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:67-109 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:66-108 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:67-109 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:68-110 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:65-100 — These 11 members are variants of one another: a block of 26 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication · Near-duplicate member family (5 members, 19 shared lines) · ×1
  • Near-duplicate member family (5 members, 19 shared lines) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:19 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:19-67 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:20-77 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:234-304 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:80-128 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift:40-80 — These 5 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member pair (20 shared lines) · ×1
  • Near-duplicate member pair (20 shared lines) Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:259 — Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:259-291 | Example/StripeConnectExample/StripeConnectExample/Settings/Appearance/AppSettings+AppearanceInfo.swift:326-361 — These two members are variants of one another: 20 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:156 — StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:156-174 | StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift:175-192 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (17 members, 50+ identical tokens) Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:33 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:32-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:35-52 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:37-54 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:32-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:32-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:33-50 — These 17 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 17 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 17 times.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:346 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:346-390 | Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:392-417 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:206-220 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:66-92 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:109-126 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:800-817 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication · Duplicated block (71 lines × 2) · ×1
  • Duplicated block (71 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:816 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:816-886 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:816-886 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (3–57 lines × 3) · ×1
  • Duplicated block (3–57 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:144 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:144-146 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:170-226 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:296-352 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (42–43 lines × 2) · ×1
  • Duplicated block (42–43 lines × 2) Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:1024 — Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:1024-1065 | Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:1099-1141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundViewModel.swift:1024` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:214 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:214-255 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:214-255 — `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 249 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:36 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:36-73 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:46-83 — before extracting anything, compare `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:40 — Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:40-72 | Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:255-287 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleWalletButtonsView.swift:255` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–30 lines × 3) · ×1
  • Duplicated block (29–30 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:171 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:171-200 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:203-232 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:197-225 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:193` calls `addAction`, `present` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:166` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:434 — Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:434-458 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:475-500 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:475` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:193 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:193-218 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:193-218 — `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:264 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:264-288 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:321-345 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:264` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21 lines × 4) · ×1
  • Duplicated block (21 lines × 4) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:117 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:117-137 | Example/CryptoOnramp Example/CryptoOnramp Example/IdentityVerificationView.swift:28-48 | Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:39-59 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:36-56 — before extracting anything, compare `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift` and `Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:117` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–18 lines × 18) · ×1
  • Duplicated block (14–18 lines × 18) Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:93 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:93-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:103-116 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:86-99 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:89-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:89-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:89-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:91-108 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:90-107 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:88-105 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:92-105 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:89-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:91-108 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:87-104 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:88-105 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:89-106 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:84-97 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:198-212 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift:166-179 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17–18 lines × 17) · ×1
  • Duplicated block (17–18 lines × 17) Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:33 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:33-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:35-52 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:37-54 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:32-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:32-49 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:33-50 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:34-51 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:33-50 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:39 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:39-54 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:43-58 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:94-109 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift:54-69 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–14 lines × 11) · ×1
  • Duplicated block (11–14 lines × 11) Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:66 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:66-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:68-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:68-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:68-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:66-76 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:69-80 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:67-78 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:66-77 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:67-78 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:68-79 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:65-76 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • Duplicated block (14 lines × 5) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:44 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:44-57 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:48-61 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:268-281 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:99-112 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift:59-72 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:266` calls `ComputedTotals` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:42` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:67 — Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:67-79 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:64-75 — before extracting anything, compare `Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift` and `Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:116 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:116-127 | Example/CryptoOnramp Example/CryptoOnramp Example/IdentityVerificationView.swift:27-38 | Example/CryptoOnramp Example/CryptoOnramp Example/TermsOfServicePresentingView.swift:38-49 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:35-46 | Example/CryptoOnramp Example/CryptoOnramp Example/WalletSelectionView.swift:60-71 — before extracting anything, compare `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift` and `Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:116` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) Example/UI Examples/UI Examples/Source/MockCustomerContext.swift:38 — Example/UI Examples/UI Examples/Source/MockCustomerContext.swift:38-49 | Example/UI Examples/UI Examples/Source/MockCustomerContext.swift:53-64 | Example/UI Examples/UI Examples/Source/MockCustomerContext.swift:66-75 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/UI Examples/UI Examples/Source/MockCustomerContext.swift:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×1
  • Duplicated block (10–12 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:75 — Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:75-84 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift:159-170 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:75` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:93 — Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:93-102 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BoletoExampleViewController.swift:237-244 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–9 lines × 3) · ×1
  • Duplicated block (4–9 lines × 3) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:224 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:224-232 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:256-264 | Example/PaymentSheet Example/PaymentSheet Example/ExampleEmbeddedElementCheckoutViewController.swift:245-248 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:70 — Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:70-78 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:111-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomerSheet.swift:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:219 — Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift:219-223 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutViewController.swift:31-35 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomCheckoutViewController.swift:35-39 | Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift:251-255 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkPaymentCheckoutViewController.swift:40-44 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUICustomPaymentFlow.swift:87-91 | Example/PaymentSheet Example/PaymentSheet Example/ExampleSwiftUIPaymentSheet.swift:47-51 — before extracting anything, compare `Example/PaymentSheet Example/PaymentSheet Example/ExampleCheckoutDeferredViewController.swift` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleCustomDeferredCheckoutViewController.swift` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×1
  • Duplicated block (18 lines × 3) Example/IdentityVerification Example/IdentityVerification Example/AppDelegate.swift:13 — Example/IdentityVerification Example/IdentityVerification Example/AppDelegate.swift:13-30 | Example/StripeConnectExample/StripeConnectExample/AppDelegate.swift:13-30 | StripePayments/StripePaymentsTestHostApp/AppDelegate.swift:13-30 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (9 lines × 7) · ×1
  • Duplicated block (9 lines × 7) Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:72 — Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift:72-80 | Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift:33-41 | Example/CryptoOnramp Example/CryptoOnramp Example/PaymentSummaryView.swift:50-58 | Example/CryptoOnramp Example/CryptoOnramp Example/PaymentView.swift:172-180 | Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift:25-33 | Example/CryptoOnramp Example/CryptoOnramp Example/WalletOwnershipVerificationSheet.swift:33-41 | Example/CryptoOnramp Example/CryptoOnramp Example/WalletSelectionView.swift:32-40 — before extracting anything, compare `Example/CryptoOnramp Example/CryptoOnramp Example/ComplianceIdentifiersEntryView.swift` and `Example/CryptoOnramp Example/CryptoOnramp Example/UserAttestationPresentingView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Example/CryptoOnramp Example/CryptoOnramp Example/CryptoOnrampExampleView.swift:29` calls `AppStorage`, `Environment` and `Example/CryptoOnramp Example/CryptoOnramp Example/PaymentSummaryView.swift:48` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 18) · ×1
  • Duplicated block (6 lines × 18) Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:14 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:14-19 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlipayExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BacsDebitViewController.swift:21-26 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:13-18 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:16-21 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:14-19 | Example/Non-Card Payment Examples/Non-Card Payment Examples/GrabPayExampleViewController.swift:18-23 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:14-19 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:13-18 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:13-18 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:14-19 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:15-20 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SwishExampleViewController.swift:14-19 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 16) · ×1
  • Duplicated block (9 lines × 16) Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:52 — Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift:52-60 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift:53-61 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AlmaExampleViewController.swift:53-63 | Example/Non-Card Payment Examples/Non-Card Payment Examples/AmazonPayExampleViewController.swift:53-63 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BillieExampleViewController.swift:53-63 | Example/Non-Card Payment Examples/Non-Card Payment Examples/BlikExampleViewController.swift:51-61 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CashAppExampleViewController.swift:54-64 | Example/Non-Card Payment Examples/Non-Card Payment Examples/CryptoExampleViewController.swift:52-62 | Example/Non-Card Payment Examples/Non-Card Payment Examples/KlarnaExampleViewController.swift:52-60 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MobilePayExampleViewController.swift:51-61 | Example/Non-Card Payment Examples/Non-Card Payment Examples/MultibancoExampleViewController.swift:53-63 | Example/Non-Card Payment Examples/Non-Card Payment Examples/RevolutPayExampleViewController.swift:51-61 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SatispayExampleViewController.swift:52-62 | Example/Non-Card Payment Examples/Non-Card Payment Examples/SunbitExampleViewController.swift:53-63 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountConnectionsExampleViewController.swift:129-137 | Example/Non-Card Payment Examples/Non-Card Payment Examples/USBankAccountExampleViewController.swift:124-132 — before extracting anything, compare `Example/Non-Card Payment Examples/Non-Card Payment Examples/AffirmExampleViewController.swift` and `Example/Non-Card Payment Examples/Non-Card Payment Examples/AfterpayClearpayExampleViewController.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:220 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift:220-224 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:903-907 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:220-224 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:903-907 — `Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundSettings.swift` and `Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D5 · Coupling · Unstable project StripePaymentSheet · ×1
  • Unstable project StripePaymentSheet — StripePaymentSheet has instability 0.86 with 1 dependents.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: StripeCore — StripeCore: abstractness 0.21, instability 0.00, distance 0.79 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — Swift suite — Coverage NOT MEASURED: the Swift half could not be measured — the Swift suite in . produced no coverage export. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
Minor — 52 finding(s)
D10 · Test Quality · No direct assertions · ×28
  • No direct assertions: test_encodingTopLevelEmptyStruct StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:72 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelEmptyClass StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:77 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelSingleValueEnum StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:85 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelSingleValueStruct StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:95 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelSingleValueClass StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:102 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelStructuredStruct StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:108 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelStructuredClass StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:114 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelStructuredSingleStruct StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:123 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelStructuredSingleClass StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:129 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingTopLevelDeepStructuredType StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:135 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingOutputFormattingDefault StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:142 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingOutputFormattingSortedKeys StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:262 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingOutputFormattingPrettyPrintedSortedKeys StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:280 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingDate StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:304 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingDateSecondsSince1970 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:311 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingBase64Data StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:326 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_encodingNonConformingFloatStrings StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:335 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfNil StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:475 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfInt8 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:480 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfUInt8 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:484 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfInt16 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:488 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfUInt16 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:492 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfInt32 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:496 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfUInt32 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:500 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • No direct assertions: test_codingOfInt64 StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:504 — No conventional assertion call was detected, and 29 of 44 tests in `External` read the same way — so this is treated as that project's convention rather than a broken test, and it does not drag the score. Two things look like this: verification that happens indirectly (an approval/verifier harness or BDD step methods), or a project of runnable samples compiled as tests, where a run that does not throw is the only check. If it is the latter, these methods genuinely verify nothing.
  • + 3 more in this group — see findings.md.
D16 · Bus Factor · Off-boarding risk · ×8
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/TwoOptionSelectorView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Currency Selector Element/CurrencySelectorElementUIView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader+Link.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/ExpandableDetailView.swift, StripePayments/StripePayments/Source/API Bindings/Models/ConfirmationTokens/STPConfirmationTokenParams.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/FlowControllerSelectionSnapshot.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedIconView.swift (+8 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingPromotionsHelper.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Shipping Address Element/ShippingAddressElement+Appearance.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PaymentMethodMessagingElement.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/RowButton+PaymentMethodMessagingSublabelView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMEUIView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/BNPLFormHeaderView.swift, ci_scripts/changelog_utils.rb (+3 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 9 significant file(s) lose their only recent owner: StripeCore/StripeCore/Source/API Bindings/STPAPIClient+FileUpload.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/HTML Confirmation/HTMLConfirmationContentViewController.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/String+Localized.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/StripeCryptoOnrampErrorRenderer.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Compliance/ComplianceIdentifierType.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verify KYC/VerifyKYCInfoRowView.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/API Bindings/KYCDataCollectionRequest.swift (+1 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 7 significant file(s) lose their only recent owner: REDACTED, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Session+DebugDescription.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutSessionPoller.swift, StripePayments/StripePayments/Source/PaymentHandler/STPAnalyticsClient+STPPaymentHandler.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElementUIView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/AutoComplete/String+AutoComplete.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 4 significant file(s) lose their only recent owner: StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift, StripeCameraCore/StripeCameraCore/Source/Coordinators/CameraSession.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Views/HeaderView.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/FaceScanner/FaceScanner.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 4 significant file(s) lose their only recent owner: StripeUICore/StripeUICore/Source/Elements/SegmentedSelectorElement.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Address/AddressAutocompleteModels.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElement+Configuration.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElementUtilities.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 4 significant file(s) lose their only recent owner: StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardViewController.swift, ci_scripts/build_documentation.rb, StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift, StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPPostalCodeInputTextField.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 4 significant file(s) lose their only recent owner: StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentLogoView.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginViewController.swift, StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Controllers/FCLiteAuthFlowViewController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Common/FlowRouter.swift. Pair on, review, or document these before any departure.
X10 · Duplicated predicate · Duplicated predicate · ×4
  • Duplicated predicate ci_scripts/push_snapshots.rb:24 — `ENV['BITRISE_GIT_BRANCH'] || `git rev-parse --abbrev-ref HEAD`.strip` appears character-identically in 2 files — ci_scripts/push_snapshots.rb, ci_scripts/trigger_react_native_ci_for_release.rb. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate StripeCore/StripeCore/Source/Analytics/STPAnalyticsClient.swift:104 — `NSClassFromString("XCTest") != nil || ProcessInfo.processInfo.environment["UITesting"] != nil` appears character-identically in 2 files — StripeCore/StripeCore/Source/Analytics/STPAnalyticsClient.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/RotatingCardBrandsView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/SetupIntent.swift:52 — `components.count >= 2 && components[0].hasPrefix("seti_")` appears character-identically in 2 files — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/SetupIntent.swift, StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift:125 — `secretComponents.count >= 2 && secretComponents[0].hasPrefix("pi_") && !secretComponents[1].isEmpty` appears character-identically in 2 files — StripeApplePay/StripeApplePay/Source/PaymentsCore/API/Models/PaymentIntent.swift, StripePayments/StripePayments/Source/API Bindings/Models/PaymentIntents/STPPaymentIntent.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 5 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (67 single-owned of 799 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 799 of the 1602 production source files in this repository met that bar). They are anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (2 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no project overview stripe3ds2-support/doc/html/index.html — The top-level index page (Stripe3DS2 Reference) is a single HTML file with no header stating what the reference does or its scope, unlike the StripePaymentsUI README. Add an overview section describing what the 3DS2 reference covers and where to find each class.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (226474 LoC, 779 public types across 134 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 196 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: StripeUICore/StripeUICore/Source/Controls/Button.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift, StripeCardScan/StripeCardScan/Source/CardScan/CardUtils/CreditCardUtils.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerNoAccountEligibleErrorView.swift, StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/OcrMainLoop.swift, StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/GenericInfoScreen/GenericInfoBodyView.swift (and 188 more) (200 orphaned of 800 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 800 of the 1602 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift — README omits the StripePaymentsUI project entirely — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 5/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `Stripe`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 14061 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
Minor — 2 finding(s)
D12 · Dependency Hygiene · Outdated · ×2
  • Outdated: swift-custom-dump — `swift-custom-dump` is resolved at 1.3.3, but 1.7.3 is the newest release tagged on https://github.com/pointfreeco/swift-custom-dump within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-custom-dump` reaches this one with no change to Package.swift.
  • Outdated: xctest-dynamic-overlay — `xctest-dynamic-overlay` is resolved at 1.6.1, but 1.13.1 is the newest release tagged on https://github.com/pointfreeco/xctest-dynamic-overlay within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update xctest-dynamic-overlay` reaches this one with no change to Package.swift.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e29fb4e923c84603b224bbc5e178dced/history.json --exit-code 0 --source .11artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-e29fb4e923c84603b224bbc5e178dced/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .24artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive .9artifacts/raw/osv-scanner.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .1artifacts/raw/semgrep-gdpr.json
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive .0artifacts/raw/osv-scanner.json

Run 01a0f4bb-90a8-73a6-b0cb-cf1113581dd4 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md