Public report of stripe/stripe-ios, published 29 October 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 29 October 2026, 00:37 UTC · Survey ID cd_3275f59e18bb4c88bd6ad4b5425fca3c

stripe/stripe-ios

Measured 29 October 2026, 00:31 UTC, at code version 6094c48

No regression since the last survey Supply-chain provenance & signing: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 43out of 100 Weak
CriticalWeakAdequateStrongExemplary
Down 3 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 243,483 lines of product code in 21 projects, tests not counted · Estimated rebuild effort: about 2.2 person-years · Weakest lens: Accessibility, 25

Findings by how serious they are

46 critical 1274 serious 272 minor

16 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 October 2026, 00:31 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that implements it, and today Watchdog is the only one that does.

The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

67of 67 dimensions measured by tools.
1567of 1592 findings point to an exact file and line, so you can open each one in the code. The other 25 concern the repository as a whole, such as missing documentation.
67dimensions across 8 lenses, read from 243,483 lines of product code in 21 projects.
Chapters

Executive summary

stripe/stripe-ios falls short of our standard for production, held back most by its Accessibility lens, the interface's usability with a keyboard or assistive technology. It scores 43 out of 100 and is rated Weak, and 33 of its 46 critical findings are security problems.

Accessibility, at 25, is the weakest lens and counts most in the score. The best first step for the work it takes is replacing the four exposed passwords or keys and switching the old ones off, worth about 5 points. Making the controls keyboard-usable would lift Accessibility itself, worth about 7 points. Raising Accessibility to 70 would lift the score to about 57.

Nineteen passwords or keys in the code's history and four in the code are open to anyone who can read the repository. Five places in the code run text as code, which an attacker could use, and four known security holes in the packages the code depends on can be used by attackers. Replacing each exposed password or key, replacing text run as code with direct calls and updating the vulnerable packages would close these risks. The pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The six parts of the code nobody has worked on for a long time need someone to learn and document them before anyone changes them.

The product code is 243,483 lines, about €320,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Accessibility 25 · counts for 45%Production Readiness 47 · counts for 25%Code Health 62 · counts for 14%Maturity 62 · counts for 8%Security and Compliance 62 · counts for 4%Performance 85 · counts for 2%Architecture 90 · counts for 1%Event Sourcing 100 · counts for 1%

If Accessibility rose from 25 to 70, the lowest score rated Strong, the score would rise from 43 to about 57.

Code composition: what the lines of code are
Product code 65%Tests 35%
New since the last survey: 95 findings

These 95 critical or serious findings weren't in the previous survey, on 15 October 2026.

  • Cyclomatic Complexity · SelfieCaptureViewController.statusText (cyclomatic 23) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • Cyclomatic Complexity · LinkAuthFlowViewController.render (cyclomatic 19) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowViewController.swift
  • Cyclomatic Complexity · CheckoutController.confirm (cyclomatic 19) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Cyclomatic Complexity · LinkAuthFlowCoordinator.sendCode (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowCoordinator.swift
  • Cyclomatic Complexity · PaymentSheetLoader.load (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift
  • Cognitive Complexity · CheckoutController.confirm (cognitive 25) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Cognitive Complexity · LinkAuthFlowViewController.render (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowViewController.swift
  • Cognitive Complexity · SelfieCaptureViewController.statusText (cognitive 21) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • Cognitive Complexity · CheckoutController.applyDefaults (cognitive 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Cognitive Complexity · LinkAuthFlowCoordinator.sendCode (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowCoordinator.swift
  • Cognitive Complexity · CheckoutApplePayContext.makeSummaryItems (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift
  • Cognitive Complexity · SelfieCaptureViewController.imageScanningSessionDidScanImage (cognitive 16) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • God Classes · FileTooLong: ViewControllers/SelfieCaptureViewController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • God Classes · ClassTooLong: CaptureTickMarksView StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/CaptureTickMarksView.swift
  • God Classes · TooManyMethods: SelfieCaptureViewController StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • God Classes · FileTooLong: Selfie/SelfieScanningView.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/SelfieScanningView.swift
  • God Classes · ClassTooLong: SelfieScanningView StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/SelfieScanningView.swift
  • God Classes · FileTooLong: Selfie/CaptureTickMarksView.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/CaptureTickMarksView.swift
  • God Classes · TooManyMethods: CaptureTickMarksView StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/CaptureTickMarksView.swift
  • God Classes · TooManyMethods: PaymentSheetLinkAccount StripePaymentSheet/StripePaymentSheet/Source/Helpers/PaymentSheetLinkAccount.swift
  • God Classes · FileTooLong: Helpers/PaymentSheetLinkAccount.swift StripePaymentSheet/StripePaymentSheet/Source/Helpers/PaymentSheetLinkAccount.swift
  • God Classes · FileTooLong: Controls/OneTimeCodeTextField.swift StripeUICore/StripeUICore/Source/Controls/OneTimeCodeTextField.swift
  • God Classes · FileTooLong: Coordinators/VerificationSheetController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift
  • God Classes · ClassTooLong: PaymentSheetFlowControllerViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift
  • Code Duplication · Duplicated block (35 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift
  • Code Duplication · Duplicated block (26 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (18–19 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift
  • Code Duplication · Duplicated block (18 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/LinkGlobalHoldback.swift
  • Code Duplication · Duplicated block (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Code Duplication · Duplicated block (11–12 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift
  • Code Duplication · Duplicated block (9–10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/ConsumerSession.swift
  • Code Duplication · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Code Duplication · Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Services/LinkAccountService.swift
  • Code Duplication · Duplicated block (6 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (34 lines × 3) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift
  • Code Duplication · Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift
  • Code Duplication · Duplicated block (11 lines × 3) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift
  • Code Duplication · Duplicated block (23 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift
  • Code Duplication · Duplicated block (18 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift
  • Code Duplication · Duplicated block (16 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift
  • Cohesion (LCOM4) · Low cohesion: STPAPIClient (LCOM4 11) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift
  • Cohesion (LCOM4) · Low cohesion: SuccessViewController (LCOM4 4) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Success/SuccessViewController.swift
  • Test Quality · Skipped test: testHorizontalNativeSheetSelectionBadgeIsOpaque StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift
  • Test Quality · Skipped test: testShortVerticalFlowControllerUsesFinalHeightDuringPresentation StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift
  • Test Quality · Skipped test: testNativeSheetScrollsBehindTransparentKeyboardToolbar StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift
  • Test Quality · Skipped test: testNativeSheetResizesNestedContentAcrossMaximumHeight StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift
  • Test Quality · Skipped test: testApplyPromotionCodeSendsCodeAndCommitsReturnedSession StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutUnitTests.swift
  • Test Quality · Skipped test: testRemovePromotionCodeSendsEmptyCodeAndCommitsReturnedSession StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutUnitTests.swift
  • Test Quality · No assertions: testAuthorizationConfirmsWithPaymentElementSource StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutApplePayContextTests.swift
  • Test Quality · No assertions: testAuthorizationConfirmsWithExpressCheckoutElementSource StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutApplePayContextTests.swift
  • Test Quality · No assertions: testURLParamsUsesConfirmationSourcePaymentUserAgent StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Link/LinkURLGeneratorTests.swift
  • Test Quality · No assertions: testURLParamsUsesConfirmationSourcePaymentUserAgent_expressCheckoutElement StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Link/LinkURLGeneratorTests.swift
  • Churn × Complexity Hotspots · Hotspot: StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift
  • Churn × Complexity Hotspots · Hotspot: StripeCore/StripeCore/Source/Helpers/STPError.swift StripeCore/StripeCore/Source/Helpers/STPError.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetLPMConfirmFlowTests.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetLPMConfirmFlowTests.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutConfirmationFunctionalTests.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentElementConfiguration.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingPromotionsHelper.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingPromotionsHelper.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingPromotionsHelper.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodType.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElement+Configuration.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse+Session.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift
  • Knowledge Freshness · Orphaned knowledge StripeIdentity/StripeIdentity/Source/Analytics/IdentityAnalyticsClient.swift
  • Knowledge Freshness · Orphaned knowledge StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionPickerViewController.swift
  • Change Coupling · Change coupling: StripeServiceError.swift ↔ STPError.swift StripeCore/StripeCore/Source/API Bindings/StripeServiceError.swift
  • Change Coupling · Change coupling: PayWithLinkController.swift ↔ PayWithNativeLinkController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift
  • Visual & motion safety · Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/style.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/style.css
  • Visual & motion safety · Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/scss/_object.scss
  • Visual & motion safety · Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/scss/_object.scss

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 52 findings

These 52 critical or serious findings were in the previous survey, on 15 October 2026, and are gone from this one.

  • Cyclomatic Complexity · EmbeddedPaymentElement.performUpdate (cyclomatic 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift
  • Cognitive Complexity · STPFakeAddPaymentPassViewController.next (cognitive 21) StripeIssuing/StripeIssuing/Source/STPFakeAddPaymentPassViewController.swift
  • Cognitive Complexity · EmbeddedPaymentElement.performUpdate (cognitive 18) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift
  • Cognitive Complexity · STPApplePayContext.makePaymentSummaryItems (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+CheckoutSession.swift
  • Cognitive Complexity · ExpressCheckoutElementUtilities.availablePaymentMethods (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElementUtilities.swift
  • God Classes · MethodTooLong: CheckoutController.confirmCheckoutSession StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift
  • Code Duplication · Duplicated block (34 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift
  • Code Duplication · Duplicated block (30 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift
  • Code Duplication · Duplicated block (24 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (24 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Code Duplication · Duplicated block (19 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/CountryNotListedViewController.swift
  • Code Duplication · Duplicated block (18 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Analytics/Experiments/LinkGlobalHoldback.swift
  • Code Duplication · Duplicated block (17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift
  • Code Duplication · Duplicated block (15–16 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift
  • Code Duplication · Duplicated block (14 lines × 2) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Radar.swift
  • Code Duplication · Duplicated block (11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (10–11 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Components/Toast/LinkToast.swift
  • Code Duplication · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift
  • Code Duplication · Duplicated block (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift
  • Code Duplication · Duplicated block (9 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift
  • Code Duplication · Duplicated block (34 lines × 2) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift
  • Code Duplication · Duplicated block (20 lines × 3) StripeCardScan/StripeCardScan/Source/CardVerify/Helpers/String+Localized.swift
  • Code Duplication · Duplicated block (11 lines × 2) StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentDataSource.swift
  • Code Duplication · Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift
  • Code Duplication · Duplicated block (23 lines × 2) ci_scripts/build_documentation.rb
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Example/FinancialConnections Example/FinancialConnections Example/CollectBankAccountTokenViewController.swift
  • Code Duplication · Duplicated block (19 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift
  • Code Duplication · Duplicated block (15 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift
  • Code Duplication · Duplicated block (9 lines × 2) StripePayments/StripePaymentsTestUtils/STPTestingAPIClient+Swift.swift
  • Cohesion (LCOM4) · Low cohesion: STPAPIClient (LCOM4 12) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift
  • Cohesion (LCOM4) · Low cohesion: PayWithLinkButton (LCOM4 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/PayWithLinkButton.swift
  • Churn × Complexity Hotspots · Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift
  • Churn × Complexity Hotspots · Hotspot: StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift StripeUICore/StripeUICore/Source/Elements/Factories/Address/AddressSectionElement.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutSessionBillingAddressUpdater.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse+Session.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/API Models/PaymentPagesAPIResponse+Session.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Payment Element/PaymentElement.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+SwiftUI.swift
  • Explicit Debt · TodoComment StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/STPAPIClient+CheckoutSessionTest.swift
  • Static Analysis (SAST) · Medium: watchdog-regex-match-index-beyond-capture-groups-js .jazzy/theme/assets/js/typeahead.jquery.js
  • Change Coupling · Change coupling: STPCardScanner.swift ↔ CardSectionWithScannerView.swift StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift
Rebuild cost: about €320,000 · Estimate
Cost to rebuild€110,000 to €540,000, for 1,796 to 5,697 hours of work, about 2.2 person-years for 1 to 5 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 43. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 243,483 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.
Raises the score by about 5 points · Low effort · REDACTED Scanning
2
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 7 points · Medium effort · Keyboard semantics
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.
Raises the score by about 7 points · Medium effort · Visual & motion safety

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €320,000 to build again, about 2.2 person-years of work. Its weakest lens is Accessibility, at 25 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 4 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.5 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 205,788 lines over the last 90 days, which is about 834,585 lines a year. At that pace, the extra work comes to an estimated 41.7 to 278.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch Common Common IntegrationTester IntegrationTester IntegrationTester->Common 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 Stripe3DS2DemoUI Stripe3DS2DemoUI Stripe3DS2DemoUI->Stripe3DS2 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 StripePaymentSheetTestHostApp StripePaymentSheetTestHostApp StripePayments->Stripe3DS2 StripePayments->StripeCore StripePaymentsUI->Stripe3DS2 StripePaymentsUI->StripeCore StripePaymentsUI->StripePayments StripePaymentsUI->StripeUICore StripeUICore->StripeCore __more__ +1 more projects

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

79 modules, with 608 dependencies between them. 2 loops run through 61 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 39 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 StripeIdentity~StripeIdentity~WebWrapper2 StripePayments~StripePayments~Captcha3 StripePayments~StripePayments~PaymentHandler4 StripePayments~StripePayments~Internal5 StripePayments~StripePayments~API Bindings6 StripePaymentSheet~StripePaymentSheet~Helpers7 StripePayments~StripePayments~Helpers8 StripeUICore~StripeUICore~Controls9 StripeIdentity~StripeIdentity~NativeComponents10 StripeIdentity~StripeIdentity~API Bindings11 StripeFinancialConnections~StripeFinancialConnections~Native12 StripePaymentSheet~StripePaymentSheet~PaymentSheet13 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~WebWrapper12211111
2 StripePayments~StripePayments~Captcha113111
3 StripePayments~StripePayments~PaymentHandler59322513142
4 StripePayments~StripePayments~Internal9101611169
5 StripePayments~StripePayments~API Bindings3151312134131342
6 StripePaymentSheet~StripePaymentSheet~Helpers19227221122222
7 StripePayments~StripePayments~Helpers1111014213141
8 StripeUICore~StripeUICore~Controls13131261211
9 StripeIdentity~StripeIdentity~NativeComponents1911914183317301523155281810212924101
10 StripeIdentity~StripeIdentity~API Bindings142141621
11 StripeFinancialConnections~StripeFinancialConnections~Native613112265432152118352129281122
12 StripePaymentSheet~StripePaymentSheet~PaymentSheet216512540335535182747889411121114715262272515135
13 repository312
14 StripeIdentity~StripeIdentity~Categories2111
15 StripeFinancialConnections~StripeFinancialConnections~Helpers2213212
16 StripeFinancialConnections~StripeFinancialConnections11314211422112
17 StripeFinancialConnections~StripeFinancialConnections~Common111281752312
18 StripeFinancialConnections~StripeFinancialConnections~API Bindings12121047552
19 StripePaymentSheet~StripePaymentSheet~Internal11222851721233547113721322361675
20 StripeCore~StripeCore~UI11111
21 StripeCryptoOnramp~StripeCryptoOnramp~Internal111342442191213212
22 StripeCryptoOnramp~StripeCryptoOnramp~Components221446110322
23 StripeCore~StripeCore~Connections Bindings11932
24 StripeConnect~StripeConnect~Internal1031231518166125111
25 StripeCore~StripeCore~Helpers1232311
26 StripeCore~StripeCore~Categories1111
27 StripeUICore~StripeUICore~Elements223436532216142424
28 StripeUICore~StripeUICore~Categories31
29 StripeConnect~StripeConnect~Helpers111
30 StripeCore~StripeCore~Coder111336
31 StripeCore~StripeCore~Analytics1314213
32 StripeCameraCore~StripeCameraCore~Coordinators513116
33 StripeCardScan~StripeCardScan~CardScan4221321561269
34 StripeCameraCore~StripeCameraCore~Categories113
35 StripeCardScan~StripeCardScan~CardVerify229512154344
36 StripeCore~StripeCore~API Bindings242811171371152414131
37 StripePaymentsUI~StripePaymentsUI~UI Components72145151212133326
38 StripeApplePay~StripeApplePay~Extensions1
39 StripePaymentsUI~StripePaymentsUI~Internal921210131412316
40 StripeApplePay~StripeApplePay~ApplePayContext431236
Uses a module listed above itPart of a loopThe module itself
1 StripeIdentity~StripeIdentity~WebWrapper2 StripePayments~StripePayments~Captcha3 StripePayments~StripePayments~PaymentHandler4 StripePayments~StripePayments~Internal5 StripePayments~StripePayments~API Bindings6 StripePaymentSheet~StripePaymentSheet~Helpers7 StripePayments~StripePayments~Helpers8 StripeUICore~StripeUICore~Controls9 StripeIdentity~StripeIdentity~NativeComponents10 StripeIdentity~StripeIdentity~API Bindings11 StripeFinancialConnections~StripeFinancialConnections~Native12 StripePaymentSheet~StripePaymentSheet~PaymentSheet13 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~ApplePayContextStripeIdentity~StripeIdentity~WebWrapper1StripePayments~StripePayments~Captcha2StripePayments~StripePayments~PaymentHandler3StripePayments~StripePayments~Internal4StripePayments~StripePayments~API Bindings5StripePaymentSheet~StripePaymentSheet~Helpers6StripePayments~StripePayments~Helpers7StripeUICore~StripeUICore~Controls8StripeIdentity~StripeIdentity~NativeComponents9StripeIdentity~StripeIdentity~API Bindings10StripeFinancialConnections~StripeFinancialConnections~Native11StripePaymentSheet~StripePaymentSheet~PaymentSheet12repository13StripeIdentity~StripeIdentity~Categories14StripeFinancialConnections~StripeFinancialConnections~Helpers15StripeFinancialConnections~StripeFinancialConnections16StripeFinancialConnections~StripeFinancialConnections~Common17StripeFinancialConnections~StripeFinancialConnections~API Bindings18StripePaymentSheet~StripePaymentSheet~Internal19StripeCore~StripeCore~UI20StripeCryptoOnramp~StripeCryptoOnramp~Internal21StripeCryptoOnramp~StripeCryptoOnramp~Components22StripeCore~StripeCore~Connections Bindings23StripeConnect~StripeConnect~Internal24StripeCore~StripeCore~Helpers25StripeCore~StripeCore~Categories26StripeUICore~StripeUICore~Elements27StripeUICore~StripeUICore~Categories28StripeConnect~StripeConnect~Helpers29StripeCore~StripeCore~Coder30StripeCore~StripeCore~Analytics31StripeCameraCore~StripeCameraCore~Coordinators32StripeCardScan~StripeCardScan~CardScan33StripeCameraCore~StripeCameraCore~Categories34StripeCardScan~StripeCardScan~CardVerify35StripeCore~StripeCore~API Bindings36StripePaymentsUI~StripePaymentsUI~UI Components37StripeApplePay~StripeApplePay~Extensions38StripePaymentsUI~StripePaymentsUI~Internal39StripeApplePay~StripeApplePay~ApplePayContext401221111111311159322513142910161116931513121341313421922722112222211110142131411313126121119119141833173015231552818102129241011421416216131122654321521183521292811222165125403355351827478894111211147152622725151353122111221321211314211422112111281752312121210475521122285172123354711372132236167511111111342442191213212221446110322119321031231518166125111123231111112234365322161424243111111133613142135131164221321561269113229512154344242811171371152414131721451512121333261921210131412316431236+39 more modules (most-connected shown)

At a glance — Code Health · 62% · Adequate · gated by X5 ·

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

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

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

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

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

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

At a glance — Performance · 85% · Strong ·

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
A07:2025 — Authentication Failures24High / Critical
A05:2025 — Injection18High / Critical
A03:2025 — Software Supply Chain Failures9High / Critical
A01:2025 — Broken Access Control1Medium

Roadmap

First, ensure all custom controls are fully keyboard-operable and anchors have valid hrefs to fix immediate interaction barriers. Next, address visual and motion safety by maintaining visible focus styles, respecting reduced-motion preferences, and correcting low-contrast colors. Simultaneously, resolve the identified leaked secrets in session files and integrate static analysis into the CI pipeline to prevent future security regressions. Finally, enforce accessibility standards by adding automated checks to your existing UI test suite and gating merges on their success.

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

Do thisHelpsEffortDimension
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED.+4.8 ptsLowREDACTED Scanning
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+6.5 ptsMediumKeyboard semantics
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.+6.5 ptsMediumVisual & motion safety
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with IntegrationTesterUITests.swift.+2.5 ptsLowTest Quality
Resolve the 2 Assertions commented out finding(s) in Test Quality — start with TestJSONEncoder.swift, SPMTestUITests.swift.+2.5 ptsLowTest Quality
Resolve the 1 Banned license finding(s) in License Compliance.+2.5 ptsLowLicense Compliance
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.+3.8 ptsMediumSecurity & performance tooling
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.+3.2 ptsMediumA11y enforcement

File quality

Per-file score 0–10 — a quality signature. Of 501 files carrying findings, judged against the Production bar: 0% slop · 53% mixed · 47% 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.1MixedSecrets (history): REDACTED: 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/SelfieCaptureViewController.swift5.6MixedCyclomatic Complexity: SelfieCaptureViewController.statusText (cyclomatic 23)
StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift5.6MixedGod Classes: FileTooLong: ViewControllers/DocumentCaptureViewController.swift
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.7MixedCyclomatic Complexity: STPFormTextField.autoFormattingBehavior (cyclomatic 17)
StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift5.7MixedGod Classes: TooManyMethods: STPPaymentMethodParams
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
REDACTED5.8MixedSecrets (history): REDACTED: REDACTED
StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+Card.swift5.9MixedCyclomatic Complexity: PaymentSheetFormFactory.makeCard (cyclomatic 24)
StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift5.9MixedCyclomatic Complexity: ErrorViewController.viewDidLoad (cyclomatic 18)

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 — 46

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 — 1274

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 — 272

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

Could not be resolved — 16

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. 67 of 67 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — 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 — 67 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D20D26D28D29D30D32D34D35D43D44AC2AC3AC4AC6AC7AX10AX3AX4AX8AX9ES1ES2M1M2M3M4P1P10P2P3P6PF3X1X12X13X14X15X16X17X18X19X21X22X23X24X25X26X27X28X29X3X30X5

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, 1567 of 1592 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 measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a18511-d0d5-76ef-a632-db9ac0dd8254.

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.

  • D8 Code Coverage — 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. 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. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
  • 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.
  • D19 Documentation Quality — 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 kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — 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. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D28 Secrets (history) — 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. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `REDACTED` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
  • 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`, … (+77 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.
  • 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: 10 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, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, 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.
  • 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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Swift, c, objectivec is most of its product and is not read yet, 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.
  • 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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Swift, c, objectivec is most of its product and is not read yet, 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.
  • M4 Documentation accuracy — 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. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, 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.

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.
  • 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.
  • 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.

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

68 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was STPPaymentMethodType.makeImage at 71. A further 17 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 69 — they are counted neither in the figure above nor in this dimension's score. 11 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/STPPaymentMethodEnums.swift (STPPaymentMethodType.displayName at 69), StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift (STPPaymentMethodParams.init at 59), StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift (PaymentSheetFormFactory.makePaymentMethodForm at 39), StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift (CryptoOnrampAnalyticsEvent.eventName at 34), StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetError.swift (PaymentSheetError.debugDescription at 33), and 6 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.

STPPaymentMethodType.makeImage (cyclomatic 71)StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift:219
STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1122
STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1595
NativeFlowController.swift.CreatePaneViewController (cyclomatic 42)StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1475
STPPaymentCardTextField.recalculateSubviewLayout (cyclomatic 39)StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:1320

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with STPPaymentMethodType.makeImage (cyclomatic 71), STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 6.4 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. 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

119 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:1122
STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive 107)StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1595
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

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

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cognitive Complexity — start with STPPaymentHandler._handleAuthenticationForCurrentAction (cognitive 139), STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cognitive 107), STPPaymentCardTextField.recalculateSubviewLayout (cognitive 86). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 5.7 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. 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

102 god class(es) detected.

FileTooLong: PaymentHandler/STPPaymentHandler.swift · ×33StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift
TooManyMethods: STPAPIClient · ×31StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13
MethodTooLong: PaymentSheet.confirmAfterHandlingLocalActions · ×23StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:248
ClassTooLong: STPPaymentHandler · ×14StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:100
FunctionTooLong: NativeFlowController.swift.CreatePaneViewControllerStripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1475

What to do

  1. Resolve the 33 FileTooLong finding(s) in God Classes — start with STPPaymentHandler.swift, STPPaymentCardTextField.swift, NativeFlowController.swift. — One of this dimension's main actionable groups (33 warning-level).
  2. Resolve the 31 TooManyMethods finding(s) in God Classes — start with STPAPIClient.swift, STPAnalyticsClient.swift, PaymentSheetFormFactory.swift. — One of this dimension's main actionable groups (31 warning-level).
  3. Resolve the 23 MethodTooLong finding(s) in God Classes — start with PaymentSheet+API.swift (2), STPPaymentHandler.swift (2), STPPaymentMethodEnums.swift (2). — One of this dimension's main actionable groups (23 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.2 / 10Stronggated by 432 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.2 / 10 · rule-coverage 100% · ceiling Verified

415 duplicated block group(s) detected. A further 17 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 138 of the 432 are in trees this repository does not ship — vendored, example/demo, project-template, 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) · ×29StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentFooterView.swift:73
Duplicated block (8 lines × 2) · ×27StripeApplePay/StripeApplePay/Source/PaymentsCore/API/PaymentIntent+API.swift:35
Duplicated block (7 lines × 2) · ×24StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:71
Duplicated block (6 lines × 2) · ×24StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift:45
Duplicated block (9 lines × 2) · ×23Example/AppClipExample/Shared/BackendModel.swift:43

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

What to do

  1. Resolve the 29 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with PaymentSheetTestPlaygroundSettings.swift (3), BottomSheetViewController.swift (2), STPPaymentHandler.swift (2). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 27 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 (27 warning-level).
  3. Resolve the 24 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with CardVerifyStateMachine.swift, HostedAuthUrlBuilder.swift, Address.swift. — One of this dimension's main actionable groups (24 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 · Coupling9.1 / 10Stronggated by 2 serious findings✓ 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 9.1 / 10 · rule-coverage 100% · ceiling Prevented

21 production modules (SwiftPM+Xcode), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 1 module(s) off the main sequence, with abstractness counted on 16 of the 21 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, 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.8 / 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.8 / 10 · rule-coverage 100% · ceiling Verified

66 of 645 classes have LCOM4 above 3.

Low cohesion: View (LCOM4 18) · ×66Example/CryptoOnramp Example/CryptoOnramp Example/View+WalletOwnershipVerification.swift:10

What to do

  1. Resolve the 66 Low cohesion finding(s) in Cohesion (LCOM4) — start with SceneDelegate.swift (4), MainViewController.swift (2), View+WalletOwnershipVerification.swift. — One of this dimension's main actionable groups (66 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.9 / 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.9 / 10 · rule-coverage 100% · ceiling Documented

3184 test methods: 3149 unit, 0 integration, 0 BDD, 35 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.2 / 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.2 / 10 · rule-coverage 100% · ceiling Prevented

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

Assertions commented out: test_codingOfDecimal · ×2StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:568
No assertions (empty test): testNullTesters/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUITests.swift:47
No assertions: testUpdateShouldCallTheCompletionBlock · ×140Stripe/StripeiOSTests/ConfirmButtonTests.swift:60
Skipped test: testHorizontalNativeSheetSelectionBadgeIsOpaque · ×14StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:128
Test project verifies nothing: Extensions · ×3StripeConnect/StripeConnectTests/Internal/Extensions/URL+ExtensionTests.swift:12

+ 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 140 No assertions finding(s) in Test Quality — start with ConnectComponentWebViewControllerTests.swift (13), AuthenticatedWebViewManagerTests.swift (7), ConnectOutboundSourceValidationTests.swift (7). — One of this dimension's main actionable groups (140 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 6.0 / 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 6.0 / 10 · rule-coverage 62% · ceiling Verified

2 outdated direct SwiftPM dependencies, 1 pinning defect(s). 5 of 8 direct dependencies had their releases listed (0 naming no readable repository, 3 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. 1 third-party CocoaPods resolved by a committed Podfile.lock were graded against the CocoaPods trunk (cdn.cocoapods.org): a pod is behind only when the trunk lists a newer release on the same major, which `pod update` reaches under a `~>` requirement. A pod sourced from a path, git URL or local podspec has no trunk release to compare and is not asked about. Carthage dependencies are not graded.

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 21 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/PaymentOption+Images.swift (23×71=1633); StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift (24×68=1632); StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift (23×69=1587)

Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift · ×21StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift:219

What to do

  1. Resolve the 21 Hotspot finding(s) in Churn × Complexity Hotspots — start with PaymentOption+Images.swift, STPPaymentHandler.swift, STPPaymentMethodEnums.swift. — One of this dimension's main actionable groups (21 warning-level).

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

D16 · Bus Factor9.1 / 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.1 / 10 · rule-coverage 100% · ceiling Documented

73 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 840 of the 1671 production source files in this repository: 830 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 · ×7
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 250 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

250 deducted task-comment markers across 243483 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 · ×211Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUIPMTests.swift:87
HackComment · ×37StripeUICore/StripeUICoreTests/Unit/Elements/AddressSectionElementTest.swift:106
FixmeComment · ×2StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:1093

What to do

  1. Resolve the 211 TodoComment finding(s) in Explicit Debt — start with Checkout+Confirm.swift (8), PaymentSheetLPMConfirmFlowTests.swift (6), LinkController.swift (6). — One of this dimension's main actionable groups (211 warning-level).
  2. Resolve the 37 HackComment finding(s) in Explicit Debt — start with PlaygroundController.swift (4), EmbeddedPaymentMethodsView.swift (3), SectionContainerView.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.

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.

D26 · Project Cohesion1.1 / 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 1.1 / 10 · rule-coverage 100% · ceiling Documented

9 of 18 build units (Bundler, Xcode) 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

19 finding(s): 0 critical, 19 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 19 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (19 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)1.9 / 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 1.9 / 10 · rule-coverage 100% · ceiling Documented

18 finding(s): 0 critical, 6 high, 12 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

What to do

  1. Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 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 82 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`, … (+77 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.6 / 10Adequategated by 6 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.6 / 10 · rule-coverage 100% · ceiling Documented

204 of 841 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 841 of the 1671 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×6StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:1
Orphaned file · ×198StripeUICore/StripeUICore/Source/Controls/Button.swift:1
Further orphaned files (smaller)

What to do

  1. Resolve the 198 Orphaned file finding(s) in Knowledge Freshness — start with ErrorViewController.swift (2), Button.swift, ConnectWebViewController.swift. — One of this dimension's main actionable groups (198 recommendation-level).
  2. Resolve the 6 Orphaned knowledge finding(s) in Knowledge Freshness — start with RoundedTextField.swift, IdentityAnalyticsClient.swift, SheetViewController.swift. — One of this dimension's main actionable groups (6 issue-level).
  3. 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:1
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 & labels5.1 / 10Adequate✓ 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.

  • 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. — REDACTED:7
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:139

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 safety1.0 / 10Critical✓ 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.

  • `.input-field` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — Stripe3DS2/Stripe3DS2DemoUI/Resources/acs_challenge.html:87
  • `.method-title` moves (`transition: margin-left .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — stripe3ds2-support/doc/html/css/style.css:1, stripe3ds2-support/doc/html/css/scss/_object.scss:14
  • `.method-info` moves (`transition: height .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. (×2) — stripe3ds2-support/doc/html/css/style.css:1, stripe3ds2-support/doc/html/css/scss/_object.scss:31

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 10 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.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. 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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
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 accuracy8.0 / 10Strong✓ Tool-verified

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.

  • stripe3ds2-support/Pods/iOSSnapshotTestCase/README.md links to `FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png`, but `stripe3ds2-support/Pods/iOSSnapshotTestCase/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — stripe3ds2-support/Pods/iOSSnapshotTestCase/README.md:57

What to do

  • Reconcile the README with reality: stripe3ds2-support/Pods/iOSSnapshotTestCase/README.md links to `FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png`, but `stripe3ds2-support/Pods/iOSSnapshotTestCase/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png` does not exist.
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 19278 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.

PF3 · Async & latency hygiene8.5 / 10Strong✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutSessionPoller.swift:24

What to do

  • Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

X18 · Disposal-pattern correctness3.5 / 10Weak✓ Tool-verified

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

  • `Tempfile.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `new_file`, and every later use of `new_file` in `copy_readme_and_fix_relative_links` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`Tempfile.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`). — ci_scripts/build_documentation.rb:130
  • `File.open` is called here without a block, so it hands back an open descriptor the caller must close — and its first and only use reads `.first` through it and drops it. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.open(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`). — ci_scripts/check_version.rb:8

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

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.

X3 · Exception handling7.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • `rescue => e` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — REDACTED:45
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:166, StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:269, StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:297
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/CustomPaymentMethod.swift:41, StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/ExternalPaymentMethod.swift:36, StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:229, …

What to do

  • Swallowed exception (caught, then discarded)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 47 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.

What to do

  • Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.

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 Health62%Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture90%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity62%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.
Security62%Adequate — gated by D28, D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Event Sourcing100%ExemplaryStrongest area.
Accessibility25%Weak — gated by AC4, AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance85%StrongSolid.
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 — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
  • 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 — 49 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 applicable: this repository's Ruby imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • 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 — no class or module declares an abstract method
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • 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.
  • D19 Documentation Quality — D19 withholds "Documentation: empty section": 1 candidate(s) were measured and not published.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Ruby, Swift, html not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
  • 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, nor 2+ projects each declaring an entity of their own. 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 — D24 reads C# and Visual Basic comments only — this repository's production source is .rb, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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 — Swift suite
  • 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. 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 code has 227,220 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.
  • 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.
  • 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 asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and 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 — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
  • 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 — 46 finding(s)
D28 · Secrets (history) · REDACTED · ×19
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×6
  • Orphaned knowledge StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/RoundedTextField.swift:1 — 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 StripeIdentity/StripeIdentity/Source/Analytics/IdentityAnalyticsClient.swift:1 — 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:1 — 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/InstitutionPicker/InstitutionPickerViewController.swift:1 — 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:1 — 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:1 — 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.
D29 · Static Analysis (SAST) · 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
D10 · Test Quality · Assertions commented out · ×2
  • Assertions commented out: test_codingOfDecimal StripeCore/StripeCoreTests/External/TestJSONEncoder.swift:568 — 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 · Link with no accessible name · ×1
  • 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 · ×1
  • <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.
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
Serious — 1274 finding(s)
D17 · Explicit Debt · TodoComment · ×211
  • TodoComment Testers/IntegrationTester/IntegrationTesterUITests/IntegrationTesterUIPMTests.swift:87 — // TODO: AU BECS Debit is broken in testmode. — 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/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/TextFieldFormatterTest.swift:13 — // TODO: Test that we don't get lagging characters (e.g. `###-##-` should always drop the last `-` when formatted — 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/StripeUICore/Source/Elements/Form/FormView.swift:30 — // TODO(iOS 26): Does this need to respect corner radius = nil? — 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/StripeUICore/Source/Elements/Factories/IDNumberTextFieldConfiguration.swift:14 — // TODO(mludowise|IDPROD-2596): Check if these are the formats needed to support IDV.
  • TodoComment StripeUICore/StripeUICore/Source/Controls/Button.swift:17 — // TODO(ramont): move to `Configuration` — 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/StripeUICore/Source/Controls/OneTimeCodeTextField.swift:384 — // TODO(ramont): Move this to DigitView — 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 StripePaymentsUI/StripePaymentsUI/Source/UI Components/STPPaymentCardTextField.swift:951 — // TODO: Figure out actual padding (not 14px) — 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 StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/CardBrandView.swift:19 — // TODO(ramont): unify icon sizes. — 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 StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/CardBrandView.swift:45 — /// TODO(ramont): remove baked-in padding and perform alignment in code. — 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 StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPPaymentCardTextFieldViewModel.swift:205 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldValidator.swift:73 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePayments/StripePayments/Source/Helpers/STPBINController.swift:271 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePayments/StripePayments/Source/Helpers/STPCardValidator.swift:451 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/TextField/TextFieldElement+Card.swift:191 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:256 — // TODO: BIN retrieval is broken if you don't use STPAPIClient.shared (https://jira.corp.stripe.com/browse/MOBILESDK-4322)
  • TodoComment StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldValidator.swift:63 — // TODO: We should be more specific here e.g. "Your card's expiration year is in the past." — 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 StripePaymentsUI/StripePaymentsUI/Source/Helpers/STPBSBNumberValidator.swift:103 — // TODO: This is broken for integrations that don't use STPAPIClient.shared — 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 StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1815 — // TODO: Make currentAction an enum, stop optionally casting it — 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 StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2229 — // TODO: Make currentAction an enum, stop optionally casting it — 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 StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2283 — // TODO: Make currentAction an enum, stop optionally casting it — 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 StripePayments/StripePayments/Source/Internal/API Bindings/STPFormEncoder.swift:70 — // TODO remove — 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 StripePayments/StripePayments/Source/Internal/API Bindings/STPFormEncoder.swift:78 — // TODO remove — 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 StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift:1534 — // TODO: Remove this logic when we stand up an endpoint to do this — 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.
  • + 186 more in this group — see findings.md.
D10 · Test Quality · No assertions · ×140
  • 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:137 — 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:144 — 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: testForeignChallengeDocumentCannotCompleteChallenge StripePayments/StripePaymentsTests/IntentConfirmationChallengeViewControllerTests.swift:186 — 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: testForeignChallengeDocumentCannotReportWebError StripePayments/StripePaymentsTests/IntentConfirmationChallengeViewControllerTests.swift:259 — 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.
  • + 115 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×66
  • Low cohesion: View (LCOM4 18) Example/CryptoOnramp Example/CryptoOnramp Example/View+WalletOwnershipVerification.swift:10 — View's methods fall into 18 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 18 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: 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: 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:72 — 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: BottomSheetViewController (LCOM4 13) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/BottomSheetViewController.swift:17 — BottomSheetViewController'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 11) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13 — STPAPIClient's methods fall into 11 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 11 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: PlaygroundController (LCOM4 10) Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:21 — PlaygroundController'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: NativeSheetContainerViewController (LCOM4 9) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:18 — NativeSheetContainerViewController'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: 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.
  • + 41 more in this group — see findings.md.
D17 · Explicit Debt · HackComment · ×37
  • HackComment StripeUICore/StripeUICoreTests/Unit/Elements/AddressSectionElementTest.swift:106 — // Hack to switch the country — 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 StripeUICore/StripeUICore/Source/Views/DoneButtonToolbar.swift:87 — // Hack: To tell if the touch is inside a button vs. the background, look at the touched view's width. The button is observed to be 38 points wide. — 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 StripeUICore/StripeUICore/Source/Elements/TextField/TextFieldView.swift:98 — // Hack, disable the ability for the picker to take focus while it's being added as a sub view — 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 StripeUICore/StripeUICore/Source/Elements/Section/SectionContainerView.swift:119 — // Hack: Give the new stack view a dummy view with the same height as the current stack view's first view — 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 StripeUICore/StripeUICore/Source/Elements/Section/SectionContainerView.swift:148 — // Hack: Swap the dummy first view and real first view — 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/StripePaymentSheetTests/PaymentSheet/PaymentSheet+APITest.swift:922 — // Hack: Use contains b/c the test backend prepends "Error creating PaymentIntent:" and appends "(request_id: ...)" to its returned error string — 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/StripePaymentSheetTests/PaymentSheet/PaymentSheetFormFactoryTest.swift:618 — // Hacky way to differentiate the save checkbox from other checkboxes — 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/StripePaymentSheetTests/PaymentSheet/PaymentSheetFormFactoryTest.swift:666 — // Hacky way to differentiate the save checkbox from other checkboxes — 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/StripePaymentSheetTests/PaymentSheet/PaymentSheetLPMConfirmFlowTests.swift:1421 — // Hack to PaymentSheet-specific local actions that happen before control is handed over to STPPaymentHandler. — 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/StripePaymentSheetTests/PaymentSheet/PaymentSheetLPMConfirmFlowTests.swift:2216 — // Hack to compare `paymentMethodParams` objects; consider them equal if their serialized versions are the same — 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/StripePaymentSheetTests/PaymentSheet/TextFieldElement+CardTest.swift:150 — // Hack to let STPBINRange finish network calls before running another 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 StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/TextFieldElement+CardTest.swift:211 — // Hack to let STPBINRange finish network calls before running another 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 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/ViewControllers/BottomSheetViewController.swift:410 — // 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.
  • HackComment StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:326 — // 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/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/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/Vertical Main Screen/PaymentSheetVerticalViewController.swift:730 — // 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/Embedded/EmbeddedFormViewController.swift:346 — // 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/Embedded/EmbeddedPaymentElement+SwiftUI.swift:130 — // 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/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/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.
  • + 12 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×33
  • FileTooLong: PaymentHandler/STPPaymentHandler.swift StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift — FileTooLong — 1808 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: STPPaymentHandler (100-2455). The bar is 500 significant lines; this is 1308 over it, 3.62× 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 — 1235 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 735 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: API Bindings/STPAPIClient+Payments.swift StripePayments/StripePayments/Source/API Bindings/STPAPIClient+Payments.swift — FileTooLong — 1091 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 591 over it, 2.18× 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 — 1042 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 542 over it, 2.08× 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 — 1001 significant lines (blank, comment-only and punctuation-only lines excluded), about 68% of them inside a single declaration: STPPaymentMethodParams (16-1223). The bar is 500 significant lines; this is 501 over it, 2.00× 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: Link/LinkController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift — FileTooLong — 985 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 485 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: ViewControllers/SelfieCaptureViewController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift — FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 392 over it, 1.78× 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: Vertical Main Screen/PaymentSheetVerticalViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift — FileTooLong — 814 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: PaymentSheetVerticalViewController (14-890). The bar is 500 significant lines; this is 314 over it, 1.63× 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 — 783 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 283 over it, 1.57× 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 — 752 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: CryptoOnrampCoordinator (255-924). The bar is 500 significant lines; this is 252 over it, 1.50× 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: Selfie/SelfieScanningView.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/SelfieScanningView.swift — FileTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: SelfieScanningView (16-820). The bar is 500 significant lines; this is 232 over it, 1.46× 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: CustomerSheet/CustomerSavedPaymentMethodsViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift — FileTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: CustomerSavedPaymentMethodsViewController (22-844). The bar is 500 significant lines; this is 205 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 — 704 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 204 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: Saved Payment Method Screen/SavedPaymentOptionsViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift — FileTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 171 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: Selfie/CaptureTickMarksView.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/CaptureTickMarksView.swift — FileTooLong — 659 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: CaptureTickMarksView (12-874). The bar is 500 significant lines; this is 159 over it, 1.32× 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: Link/STPAPIClient+Link.swift StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift — FileTooLong — 651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 151 over it, 1.30× 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 — 604 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 104 over it, 1.21× 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 — 592 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 92 over it, 1.18× 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: Coordinators/VerificationSheetFlowController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetFlowController.swift — FileTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 77 over it, 1.15× 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 — 564 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: PaymentSheetFlowControllerViewController (17-623). The bar is 500 significant lines; this is 64 over it, 1.13× 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.
  • + 8 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×31
  • TooManyMethods: STPAPIClient StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:13 — TooManyMethods — 200 methods, declared across 17 files: API Bindings/STPAPIClient+Payments.swift (75), Link/STPAPIClient+Link.swift (26), API Bindings/STPAPIClient+CryptoOnramp.swift (24), API Bindings/STPAPIClient.swift (22), +13 more file(s). The bar is 30 methods; this is 170 over it, 6.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 105 methods, declared across 10 files: Extensions/STPAnalyticsClient+Link.swift (28), Analytics/STPAnalyticsClient+Payments.swift (21), Analytics/STPAnalyticsClient.swift (12), Analytics/STPAnalyticsClient+CustomerSheet.swift (12), +6 more file(s). The bar is 30 methods; this is 75 over it, 3.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 86 methods, declared across 13 files: PaymentSheetFormFactory/PaymentSheetFormFactory.swift (48), PaymentSheetFormFactory/PaymentSheetFormFactory+Mandates.swift (17), PaymentSheetFormFactory/PaymentSheetFormFactory+BankDebits.swift (4), PaymentSheetFormFactory/PaymentSheetFormFactory+Card.swift (3), +9 more file(s). The bar is 30 methods; this is 56 over it, 2.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 83 methods, declared across 3 files: PaymentMethods/STPPaymentMethodParams.swift (78), StripePaymentsTestUtils/STPFixtures+Swift.swift (4), PaymentSheet/PaymentOption+Images.swift (1). The bar is 30 methods; this is 53 over it, 2.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: 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, declared across 2 files: PaymentHandler/STPPaymentHandler.swift (48), PaymentHandler/STPAnalyticsClient+STPPaymentHandler.swift (9). The bar is 30 methods; this is 27 over it, 1.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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, declared across 2 files: API Bindings/FinancialConnectionsAsyncAPIClient+Wrappers.swift (37), API Bindings/FinancialConnectionsAsyncAPIClient.swift (13). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 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, declared across 6 files: PaymentSheet/PaymentSheet.swift (17), PaymentSheet/PaymentSheet+API.swift (10), PaymentSheet/PaymentSheet+DeferredAPI.swift (7), PaymentSheet/PaymentSheet+PaymentMethodAvailability.swift (7), +2 more file(s). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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:254 — TooManyMethods — 47 methods, declared across 2 files: REDACTED (39), Errors/CryptoOnrampCoordinator+ErrorMapping.swift (8). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: SelfieCaptureViewController StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:15 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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 — 46 methods, declared across 8 files: Checkout/CheckoutController.swift (21), Checkout/Checkout+Internal.swift (11), Checkout/Checkout+Confirm.swift (8), Checkout/Checkout+Confirm+Link.swift (2), +4 more file(s). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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 — 45 methods. The bar is 30 methods; this is 15 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.
  • TooManyMethods: EmbeddedPaymentElement StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:15 — TooManyMethods — 43 methods, declared across 2 files: Embedded/EmbeddedPaymentElement+Internal.swift (32), Embedded/EmbeddedPaymentElement.swift (11). The bar is 30 methods; this is 13 over it, 1.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: 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, declared across 9 files: StripePaymentsTestUtils/STPFixtures+Swift.swift (9), Categories/STPPaymentMethod+PaymentSheet.swift (8), PaymentSheet/PaymentOption+Images.swift (8), PaymentMethods/STPPaymentMethod.swift (7), +5 more file(s). The bar is 30 methods; this is 7 over it, 1.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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, declared across 2 files: UI/SimpleScanViewController.swift (34), CardVerify/SimpleScanViewController+Verify.swift (1). The bar is 30 methods; this is 5 over it, 1.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: NativeSheetContainerViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:18 — 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:134 — 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:73 — 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×29
  • 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/Internal/API Bindings/Link/STPAPIClient+Link.swift:622 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:622-631 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:644-653 — 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:622` 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 (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:321-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. 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/Checkout/CheckoutControllerLoader.swift:197 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift:197-206 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutControllerLoader.swift:214-223 — 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/CheckoutControllerLoader.swift:197` 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 (10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:380 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:380-389 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:611-620 — 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:380` 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/PaymentSheet+API.swift:329 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:329-338 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:352-361 — 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:329` 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:428 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:428-437 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:441-450 — 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/ViewControllers/PaymentSheetFlowControllerViewController.swift:654 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:654-663 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:557-566 — 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) 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:398-407 — 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:667-676 — 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:590 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:590-599 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:720-729 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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/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/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/ExampleLinkControllerPreviewView.swift:180 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerPreviewView.swift:180-189 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:680-689 — 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:676` 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:708-717 — 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/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartContentView.swift:381 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartContentView.swift:381-390 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:550-559 — 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×27
  • 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:88 — StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:88-95 | StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:173-180 — 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: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:87` calls `escaping` and `StripeConnect/StripeConnect/Source/Internal/Webview/ConnectComponentWebViewController.swift:172` 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:348 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:348-355 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:392-399 — 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:348` 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/Internal/Link/Services/LinkAccountService.swift:147 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Services/LinkAccountService.swift:147-156 | StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Services/LinkAccountService.swift:225-232 — 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/Link/Services/LinkAccountService.swift:147` 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.
  • Duplicated block (8 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:580 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:580-587 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:150-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. Read the line range as the matched WINDOW rather than a finished unit: at `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:580` 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/Embedded/EmbeddedPaymentElement.swift:383 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement.swift:383-390 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:36-43 — 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: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. 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:183 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:183-190 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:197-204 — 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:183` 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) 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:1661 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1661-1670 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1758-1765 — 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:1661` 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) 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) 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:138 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:138-145 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:171-178 — 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:343 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:343-350 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:495-502 — 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:514 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:514-521 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:602-609 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:665 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:665-672 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:568-575 — 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) 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) 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/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:808-815 — 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.
  • + 2 more in this group — see findings.md.
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) 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/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/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:77-83 — 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/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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:816 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:816-822 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:659-665 — 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 after the matched lines, `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:668` calls `set` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:826` 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) 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) 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) 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) 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:55-61 — 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:2470-2476 — 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:518 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:518-524 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:536-542 — 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:297 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:297-303 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:552-558 — 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:297` 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:551` calls `constraint` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:296` 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/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/PlaygroundController.swift:894 — Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:894-900 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:1007-1013 — 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/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:181 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:181-187 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:357-363 — 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) · ×24
  • 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) 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/Internal/API Bindings/Link/STPAPIClient+Link.swift:671 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:671-676 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:696-701 — 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:671` 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 (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/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/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/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) 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) 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:91 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:91-96 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:90-95 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 (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/PaymentMethods/Types/STPPaymentMethodKrCard.swift:39 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodKrCard.swift:39-44 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgCard.swift:40-45 — 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/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/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/Checkout Playground/CheckoutCartViewController.swift:651 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:651-656 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:758-763 — 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:651` 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/Checkout Playground/CheckoutCartViewController.swift:645 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:645-651 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:689-694 — 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:645` 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/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/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.
D3 · God Classes · MethodTooLong · ×23
  • MethodTooLong: PaymentSheet.confirmAfterHandlingLocalActions StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:248 — MethodTooLong — confirmAfterHandlingLocalActions runs 307 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 207 over it, 3.07× 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:1122 — 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: 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: PaymentSheet.confirmLinkPaymentOption StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:651 — MethodTooLong — confirmLinkPaymentOption runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× 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: STPPaymentMethodType.makeImage StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift:219 — MethodTooLong — makeImage 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:1595 — 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.
  • MethodTooLong: STPPaymentMethodType.displayName StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:147 — MethodTooLong — displayName runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: STPDecodingContainerProtocol.castFromNSObject StripeCore/StripeCore/Source/Coder/StripeJSONDecoder.swift:570 — MethodTooLong — castFromNSObject runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× 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: STPPaymentMethod.decodedObject StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:295 — MethodTooLong — decodedObject runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× 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: ErrorViewController.viewDidLoad StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift:41 — MethodTooLong — viewDidLoad runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× 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: STPPaymentMethodType.identifier StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:290 — MethodTooLong — identifier runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× 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.confirmLink StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:24 — MethodTooLong — confirmLink runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× 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.init StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:1580 — MethodTooLong — init runs 121 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 21 over it, 1.21× 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: NativeFlowController.closeAuthFlow StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:358 — MethodTooLong — closeAuthFlow runs 120 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 20 over it, 1.20× 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: STPIntentAction.decodedObject StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:353 — MethodTooLong — decodedObject runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.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: PaymentSheet.handleDeferredIntentConfirmation StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63 — MethodTooLong — handleDeferredIntentConfirmation runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× 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: AccountPickerNoAccountEligibleErrorView.init StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerNoAccountEligibleErrorView.swift:16 — MethodTooLong — init runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× 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.makeCard StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+Card.swift:42 — MethodTooLong — makeCard runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× 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.update StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Views/ConfirmButton.swift:292 — MethodTooLong — update runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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.load StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:63 — MethodTooLong — load runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×23
  • 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/Analytics/STPAnalyticsClient+Address.swift:102 — StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:102-110 | StripePaymentSheet/StripePaymentSheet/Source/Analytics/STPAnalyticsClient+Address.swift:119-127 — 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:539 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:539-547 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:840-848 — 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:539` 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:548` calls `reloadData` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:849` 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:830 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:830-838 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:856-864 — 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:830` 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:224-232 — 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:1429 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1429-1437 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1440-1448 — 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:2646 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2646-2654 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2681-2689 — 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 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) 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:427 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:427-435 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:722-730 — 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) 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) 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) 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) 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) StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextField.swift:49 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardCVCInputTextField.swift:49-57 | 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) 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/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:725-733 — 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:948 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:948-956 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:948-956 — `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 250 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) 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/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.
D15 · Churn × Complexity Hotspots · Hotspot · ×21
  • Hotspot: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift:219 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.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:1122 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in STPPaymentHandler._handleAuthenticationForCurrentAction at line 1122. 1 of those changes was a fix/bug commit, and the other 23 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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:147 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in STPPaymentMethodType.displayName at line 147. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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:1580 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in STPPaymentMethodParams.init at line 1580. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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/PaymentSheetFormFactory/PaymentSheetFormFactory.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift:241 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory.swift changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in PaymentSheetFormFactory.makePaymentMethodForm at line 241. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:505 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in CheckoutController.confirmCheckoutSession at line 505. 1 of those changes was a fix/bug commit, and the other 26 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.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+API.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:248 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in PaymentSheet.confirmAfterHandlingLocalActions at line 248. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.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:183 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PaymentSheetFlowControllerViewController.init at line 183. 4 of those changes were fix/bug commits, and the other 13 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1475 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in NativeFlowController.swift.CreatePaneViewController at line 1475. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.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:654 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in PayWithLinkViewController.launchFinancialConnections at line 654. 1 of those changes was a fix/bug commit, and the other 10 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift:71 — StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in CryptoOnrampAnalyticsEvent.eventName at line 71. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift:12 — StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in HostedAuthUrlBuilder.build at line 12. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripeCore/StripeCore/Source/Connections Bindings/HostedAuthUrlBuilder.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/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:217 — Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PlaygroundViewController.requestVerificationSession at line 217. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.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:63 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PaymentSheetLoader.load at line 63. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:467 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in PaymentMethodFormViewController.handleCollectBankAccount at line 467. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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: StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift:153 — StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.swift changed 4 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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.
  • Hotspot: StripeCore/StripeCore/Source/Helpers/STPError.swift StripeCore/StripeCore/Source/Helpers/STPError.swift:164 — StripeCore/StripeCore/Source/Helpers/STPError.swift changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in NSError.stp_error at line 164. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07:00' --full-history --no-merges -- StripeCore/StripeCore/Source/Helpers/STPError.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 3 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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 3 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift:186 — Example/CryptoOnramp Example/CryptoOnramp Example/KYCInfoView.swift changed 3 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 15:50:59 -07:00' --until='2026-10-28 15:50:59 -07: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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×18
  • 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) 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:431 — StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:431-442 | StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetController.swift:605-616 — 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:431` 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:425 — StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:425-436 | StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:437-448 — 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) 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) 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/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/Checkout Playground/CheckoutCartView.swift:151 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:151-162 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:209-220 — 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:151` 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 (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:284 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:284-295 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:284-295 — `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 250 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:519 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:519-530 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:519-530 — `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 250 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/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/PaymentSheetTestPlaygroundSettings.swift:135 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:135-146 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:135-146 — `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 250 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:532 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:532-543 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:532-543 — `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 250 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 (14 lines × 2) · ×17
  • 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) 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) 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) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:835 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:835-848 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:858-871 — 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:835` 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/Checkout/Checkout+Confirm+Link.swift:81 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:81-94 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:109-122 — 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:123` calls `complete` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm+Link.swift:95` 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 × 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/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) 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/ViewControllers/BottomSheetViewController.swift:231 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:231-244 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:269-282 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 (14 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:556 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:556-569 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:679-692 — 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:556` 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) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:651 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift:651-664 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:733-746 — 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:748-761 — 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/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/ExampleLinkControllerView.swift:656 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:656-669 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:693-706 — 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:656` 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:653` calls `InfoRow` and `Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:691` 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/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:80 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:80-93 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:80-93 — `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 250 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) · ×16
  • Duplicated block (11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:101 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:101-111 | 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:101` 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) StripeCore/StripeCore/Source/Connections Bindings/BillingAddress.swift:24 — StripeCore/StripeCore/Source/Connections Bindings/BillingAddress.swift:24-34 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/KycInfo.swift:122-132 — 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: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) 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) 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:197 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:197-207 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:192-202 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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/BottomSheetViewController.swift:197` 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/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) 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:196 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:196-206 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:256-266 — 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:86-96 — 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/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.
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×16
  • 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:461 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:461-465 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:542-546 — 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:244 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:244-248 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:260-264 — 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:244` 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:296 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:296-300 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:317-321 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 (5 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:601 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:601-605 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:731-735 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 (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:665 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:665-669 | StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:172-176 — 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/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/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/CustomerSheetTestPlaygroundController.swift:422 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlaygroundController.swift:422-426 | Example/PaymentSheet Example/PaymentSheet Example/PlaygroundController.swift:1250-1254 — 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 (13 lines × 2) · ×15
  • 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) 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/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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:550 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:550-562 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:572-584 — 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:550` 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:284 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:284-296 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:538-550 — 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:551` 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 (13 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:512 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:512-524 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:530-542 — 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:512` 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/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) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1686 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1686-1698 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1772-1784 — 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:1686` 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:2657 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2657-2669 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2692-2705 — 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:2657` 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.
D10 · Test Quality · Skipped test · ×14
  • Skipped test: testHorizontalNativeSheetSelectionBadgeIsOpaque StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:128 — Skipped — throws XCTSkip
  • Skipped test: testShortVerticalFlowControllerUsesFinalHeightDuringPresentation StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:233 — Skipped — throws XCTSkip
  • Skipped test: testNativeSheetScrollsBehindTransparentKeyboardToolbar StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:290 — Skipped — throws XCTSkip
  • Skipped test: testNativeSheetResizesNestedContentAcrossMaximumHeight StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:467 — Skipped — throws XCTSkip
  • Skipped test: testNativeSheetResizesToScrollableContentAtRegularWidth StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:558 — Skipped — throws XCTSkip
  • Skipped test: testNativeGlassPresentationFadesBackground StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:621 — Skipped — throws XCTSkip
  • Skipped test: testContentDetentMeasuresSystemNavigationBar StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:851 — Skipped — throws XCTSkip
  • Skipped test: testNativeGlassContentScrollsBehindNavigationBarWithDefaultAppearance StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:877 — Skipped — throws XCTSkip
  • Skipped test: testNativeSolidNavigationBarShowsShadowOnlyAfterScrolling StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:918 — Skipped — throws XCTSkip
  • Skipped test: testNativeSheetDoesNotAddBottomSafeAreaPadding StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/PaymentSheetPresentationTests.swift:1260 — Skipped — throws XCTSkip
  • Skipped test: testApplyPromotionCodeSendsCodeAndCommitsReturnedSession StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutUnitTests.swift:294 — Skipped — throws XCTSkip
  • Skipped test: testRemovePromotionCodeSendsEmptyCodeAndCommitsReturnedSession StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CheckoutUnitTests.swift:316 — Skipped — throws XCTSkip
  • Skipped test: testUpdatesSwiftUILayoutWhenDetailsChangeHeight StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Checkout/CurrencySelectorElementViewTests.swift:33 — Skipped — throws XCTSkip
  • Skipped test: testWalletPushesConfigureLinkNavigationInBothContainers StripePaymentSheet/StripePaymentSheetTests/PaymentSheet/Link/PayWithLinkViewControllerTests.swift:137 — Skipped — throws XCTSkip
D3 · God Classes · ClassTooLong · ×14
  • ClassTooLong: STPPaymentHandler StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:100 — ClassTooLong — 1530 significant lines (blank, comment-only and punctuation-only lines excluded), 57 methods. The bar is 400 significant lines; this is 1130 over it, 3.83× 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: STPPaymentMethodParams StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodParams.swift:16 — ClassTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded), 83 methods. The bar is 400 significant lines; this is 282 over it, 1.71× 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: CaptureTickMarksView StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/CaptureTickMarksView.swift:12 — ClassTooLong — 639 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 239 over it, 1.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.
  • 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 — 598 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 198 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 — 586 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 186 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.
  • ClassTooLong: SelfieScanningView StripeIdentity/StripeIdentity/Source/NativeComponents/Views/Selfie/SelfieScanningView.swift:16 — ClassTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 184 over it, 1.46× 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), 21 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:254 — ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 64 over it, 1.16× 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.
  • ClassTooLong: PaymentSheetFlowControllerViewController StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:17 — ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 1 over it, 1.00× 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.
D35 · Change Coupling · Change coupling · ×14
  • Change coupling: DocumentScanner.swift ↔ DocumentCaptureViewController.swift StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/DocumentScanner/DocumentScanner.swift:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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: StripeServiceError.swift ↔ STPError.swift StripeCore/StripeCore/Source/API Bindings/StripeServiceError.swift:1 — `StripeCore/StripeCore/Source/API Bindings/StripeServiceError.swift` and `StripeCore/StripeCore/Source/Helpers/STPError.swift` change together 60% of the time (6 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 6 shared commits counted here, the most recent 3 are `554b579f` CS — implement private preview error handling (#7408); `56e65857` Include request IDs in live-mode API error descriptions (#7404); `71f657e9` [v25] Add request ID and http status code to API errors (#5391) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ STPAPIClient+CryptoOnramp.swift REDACTED:1 — `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: STPPaymentMethod.swift ↔ STPPaymentHandler.swift StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:1 — `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: FinancialConnectionsAsyncAPIClient.swift ↔ NativeFlowController.swift StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:1 — `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: LinkController.swift ↔ LinkFlowControllerHelpers.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:1 — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkFlowControllerHelpers.swift` change together 53% of the time (10 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 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: PayWithLinkController.swift ↔ PayWithNativeLinkController.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift:1 — `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithNativeLinkController.swift` change together 50% of the time (8 of the 16 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 8 shared commits counted here, the most recent 3 are `c5d12f59` Set Checkout's payment_user_agent with the confirming Checkout Elemen…; `3a5d9b8e` [Native sheets] Enable native sheets for FlowController and Embedded …; `f4d8cc5c` PS MainActor Isolate Link coordinators (#6950) — run `git show` on any of them.
  • Change coupling: CustomerSheet+API.swift ↔ PaymentSheet+API.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet+API.swift:1 — `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.
  • Change coupling: CustomerSheetDataSource.swift ↔ PaymentSheetLoader.swift StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheetDataSource.swift:1 — `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.
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) 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/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/Internal/Link/Elements/InlineSignup/LinkInlineSignupView.swift:348 — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Elements/InlineSignup/LinkInlineSignupView.swift:348-363 | 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:348` 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:240 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:240-255 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:358-373 — 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/LinkController.swift:855 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:855-871 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:1004-1019 — 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:855` 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 (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.
  • Duplicated block (16 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:92 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:92-107 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:416-431 — 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 33 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 (15 lines × 2) · ×10
  • 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/CustomerSheet/CustomerAddPaymentMethodViewController.swift:457 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerAddPaymentMethodViewController.swift:457-471 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:752-766 — 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/PaymentSheet/Embedded/EmbeddedFormViewController.swift:337 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:337-351 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:721-735 — 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:337` 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:404 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:404-418 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:830-844 — 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:404` 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:225 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:225-239 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:171-185 — 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/ViewControllers/PaymentSheetFlowControllerViewController.swift:225` 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) 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) 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) 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/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.
  • 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:1217-1231 — 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.
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/Link/PayWithLinkController.swift:92 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithLinkController.swift:92-108 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/PayWithNativeLinkController.swift:312-328 — 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:92` 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 (17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:539 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:539-555 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:661-677 — 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:539` 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) 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.
  • 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:536-552 — 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.
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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:154 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:154-175 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:195-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/PaymentSheet/PaymentSheet+DeferredAPI.swift:154` 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:765 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:765-786 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:590-611 — 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 (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) StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:83 — StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:83-104 | StripePayments/StripePayments/Source/Internal/STPPaymentHandlerActionParams.swift:178-199 — 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/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.
  • Duplicated block (22 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:486 — Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:486-507 | Example/PaymentSheet Example/PaymentSheet Example/ExampleLinkControllerView.swift:526-547 — 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×7
  • 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/Checkout Playground/CheckoutCartView.swift:172 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:172-189 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:227-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/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartView.swift:172` 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 (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.
  • Duplicated block (18 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:570 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:570-587 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:641-658 — 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:570` 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:569` calls `paymentSheet` and `Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:640` 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • 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:295-493 | 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/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:204 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:204-239 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationViewController.swift:84-118 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:300-346 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:222-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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:389 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:389-425 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:795-827 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1129-1162 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:497-529 — 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:418-431 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:418-431 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×6
  • Swallowed exception (caught, then discarded) REDACTED:45 — `rescue => e` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/CustomPaymentMethod.swift:41 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/ExternalPaymentMethod.swift:36 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:229 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Views/ProofOfAddressView.swift:187 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Views/SourceOfFundsView.swift:102 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
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/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/CustomerSheetTestPlayground.swift:30 — Example/PaymentSheet Example/PaymentSheet Example/CustomerSheetTestPlayground.swift:30-50 | Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlayground.swift:106-126 — 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/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 (20 lines × 2) · ×5
  • 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:853-872 — 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:177 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:177-196 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:172-191 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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/BottomSheetViewController.swift:177` 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:204 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:204-223 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:345-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. 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:224` calls `STPLocalizedString` and `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:365` 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 (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:287 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/InstantBankPaymentsController.swift:287-297 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:537-547 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:659-669 — 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:287` 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) StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift:135 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkLogin/LinkLoginDataSource.swift:135-145 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkLoginWarmup/NetworkingLinkLoginWarmupDataSource.swift:87-97 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupDataSource.swift:139-149 — 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 (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) · ×5
  • Duplicated block (9–10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/ConsumerSession.swift:202 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/ConsumerSession.swift:202-210 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/ConsumerSession.swift:224-233 — 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/ConsumerSession.swift:202` 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–10 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:430 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:430-438 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1165-1174 — 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:430` 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×5
  • Duplicated block (8 lines × 3) StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:323 — StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:323-332 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:369-376 | StripeCore/StripeCore/Source/API Bindings/STPAPIClient.swift:414-421 — 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:323` 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:434 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:434-441 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:846-853 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1170-1177 — 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:434` 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×4
  • Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/style.css:1 — `.method-title` moves (`transition: margin-left .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/style.css:1 — `.method-info` moves (`transition: height .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/scss/_object.scss:14 — `.method-title` moves (`transition: margin-left .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard stripe3ds2-support/doc/html/css/scss/_object.scss:31 — `.method-info` moves (`transition: height .3s ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • 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:759-772 — 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:483 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:483-497 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentMethodFormViewController.swift:590-603 — 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:483` 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) 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:87 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:87-100 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:107-121 — 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 6 separate duplicated blocks between them, totalling at least 113 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:87` 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 lines × 3) · ×4
  • 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:102 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:102-110 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:123-131 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:444-452 — 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 6 separate duplicated blocks between them, totalling at least 113 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.
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 (19 lines × 2) · ×3
  • 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:732-750 — 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:592 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:592-610 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:361-379 — 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:592` 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) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:153 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:153-171 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:176-194 — 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 6 separate duplicated blocks between them, totalling at least 113 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:173` calls `setNeedsStatusBarAppearanceUpdate` and `Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:150` 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 (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:1473 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1473-1485 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1502-1515 — 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:1473` 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 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:155-164 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:196-205 — 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:166` 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/Checkout Playground/CheckoutCartViewController.swift:646 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:646-651 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:690-694 | Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:754-758 — 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:646` 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/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/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.
X3 · Exception handling · Swallowed exception (empty catch) · ×3
  • Swallowed exception (empty catch) StripePayments/StripePayments/Source/Internal/API Bindings/APIRequest.swift:166 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:269 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:297 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
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:1093 — // 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:1213 — // 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 (26 lines × 2) · ×2
  • Duplicated block (26 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:64 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:64-89 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:92-117 — 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:64` 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 (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 (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:135 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:135-153 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:131-148 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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/BottomSheetViewController.swift:135` 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 (18–19 lines × 2) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:975 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:975-992 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1044-1062 — 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:975` 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 (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:168-181 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:209-222 — 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:166` 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:418-431 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:129-142 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:418-431 — `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 (13 lines × 4) · ×2
  • 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.
  • Duplicated block (13 lines × 4) StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:81 — StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.swift:81-93 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/LinkSettings.swift:75-87 | StripePayments/StripePayments/Source/API Bindings/Models/Shared/STPIntentAction.swift:328-340 | StripePayments/StripePayments/Source/Internal/API Bindings/STPIntentActionUseStripeSDK.swift:64-76 — 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 `StripePayments/StripePayments/Source/API Bindings/Models/SetupIntents/STPSetupIntent.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.
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:408 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsCollectionViewController.swift:408-418 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:642-654 — 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:408` 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 (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:1016 — StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:1016-1027 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:1098-1108 — 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/ViewControllers/SelfieCaptureViewController.swift:1016` 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–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 (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:847 — Example/PaymentSheet Example/PaymentSheet Example/Checkout Playground/CheckoutCartViewController.swift:847-857 | 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:847` 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) 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 (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:341 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedFormViewController.swift:341-350 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:725-734 | 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:341` 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:429-435 — 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 (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2601 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2601-2606 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2621-2626 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:2715-2720 — 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.
  • Duplicated block (6 lines × 3) 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 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgCard.swift:33-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 all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37 — StripeIssuing/StripeIssuing/Source/STPEphemeralKey.swift:37-45 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethod.swift:295-303 | 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.
  • 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:938-942 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/CustomerSheetTestPlaygroundSettings.swift:220-224 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:938-942 — `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.
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 (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 · 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:138-145 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:159-166 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:465-472 — 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:464` 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 · 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:136-145 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:157-166 | Example/IdentityVerification Example/IdentityVerification Example/PlaygroundViewController.swift:454-472 — 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.
X18 · Disposal-pattern correctness · Disposable created and abandoned in the function that made it · ×2
  • Disposable created and abandoned in the function that made it ci_scripts/build_documentation.rb:130 — `Tempfile.new` is called here without a block, so it hands back an open descriptor the caller must close — and it is held in `new_file`, and every later use of `new_file` in `copy_readme_and_fix_relative_links` reads a member through it — it is never closed, returned, passed, yielded or stored. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`Tempfile.new(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
  • Disposable created and abandoned in the function that made it ci_scripts/check_version.rb:8 — `File.open` is called here without a block, so it hands back an open descriptor the caller must close — and its first and only use reads `.first` through it and drops it. Nothing closes it: it stays open until the garbage collector happens to finalize it, which is one leaked descriptor per call (a child process too, for `IO.popen`), `Errno::EMFILE` under load, and for a written file data that is not flushed when the program next reads it. Use the block form, which closes on every path including a raise (`File.open(…) { |io| … }`), or the one-call reader/writer (`File.read`, `File.write`, `File.foreach`).
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:87 — `.input-field` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
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 10 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 · STPPaymentMethodType.makeImage (cyclomatic 71) · ×1
  • STPPaymentMethodType.makeImage (cyclomatic 71) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.swift:219 — STPPaymentMethodType.makeImage has cyclomatic complexity 71 (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._handleAuthenticationForCurrentAction (cyclomatic 68) · ×1
  • STPPaymentHandler._handleAuthenticationForCurrentAction (cyclomatic 68) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1122 — 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 · STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51) · ×1
  • STPPaymentHandler._retrieveAndCheckIntentForCurrentAction (cyclomatic 51) StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1595 — 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:1475 — 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:570 — 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+API.swift:248 — PaymentSheet.confirmAfterHandlingLocalActions has cyclomatic complexity 35 (threshold 15). Of this number, 21 points are the body's own statements and 14 belong to 2 function items inside it that branch. 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:376 — PaymentSheetVerticalViewController.calculateInitialSelection has cyclomatic complexity 35 (threshold 15). Of this number, 27 points are the body's own statements and 8 belong to one function item inside it that branches. 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). Of this number, 31 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.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:380 — 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 · CheckoutController.confirmCheckoutSession (cyclomatic 24) · ×1
  • CheckoutController.confirmCheckoutSession (cyclomatic 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:505 — CheckoutController.confirmCheckoutSession has cyclomatic complexity 24 (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 · PaymentSheetFormFactory.makeCard (cyclomatic 24) · ×1
  • PaymentSheetFormFactory.makeCard (cyclomatic 24) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetFormFactory/PaymentSheetFormFactory+Card.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.
D1 · Cyclomatic Complexity · SelfieCaptureViewController.statusText (cyclomatic 23) · ×1
  • SelfieCaptureViewController.statusText (cyclomatic 23) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:577 — SelfieCaptureViewController.statusText has cyclomatic complexity 23 (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 · 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) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.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 · NSError.stp_error (cyclomatic 21) · ×1
  • NSError.stp_error (cyclomatic 21) StripeCore/StripeCore/Source/Helpers/STPError.swift:164 — NSError.stp_error has cyclomatic complexity 21 (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 · 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:1847 — 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 · InterfaceCache.load! (cyclomatic 21) · ×1
  • InterfaceCache.load! (cyclomatic 21) ci_scripts/api_diff/interface_cache.rb:8 — InterfaceCache.load! has cyclomatic complexity 21 (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 · NativeFlowController.closeAuthFlow (cyclomatic 20) · ×1
  • NativeFlowController.closeAuthFlow (cyclomatic 20) StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:358 — 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 · PaymentSheet.confirmLinkPaymentOption (cyclomatic 20) · ×1
  • PaymentSheet.confirmLinkPaymentOption (cyclomatic 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:651 — PaymentSheet.confirmLinkPaymentOption 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 · VerificationSheetFlowController.nextViewController (cyclomatic 19) · ×1
  • VerificationSheetFlowController.nextViewController (cyclomatic 19) StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/VerificationSheetFlowController.swift:424 — 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+Strings.swift:18 — DocumentCaptureViewController.scanningTextWithNoInput has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. 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 · LinkAuthFlowViewController.render (cyclomatic 19) · ×1
  • LinkAuthFlowViewController.render (cyclomatic 19) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowViewController.swift:200 — LinkAuthFlowViewController.render 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 · CheckoutController.confirm (cyclomatic 19) · ×1
  • CheckoutController.confirm (cyclomatic 19) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:259 — CheckoutController.confirm 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). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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:654 — PayWithLinkViewController.launchFinancialConnections has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. 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/PaymentSheet+PaymentMethodAvailability.swift:217 — 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+ConfirmationTokens.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 · 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:301 — 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 · LinkAuthFlowCoordinator.sendCode (cyclomatic 16) · ×1
  • LinkAuthFlowCoordinator.sendCode (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowCoordinator.swift:323 — LinkAuthFlowCoordinator.sendCode 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+ConfirmationTokens.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 · PaymentSheet.handleDeferredIntentConfirmation (cyclomatic 16) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63 — PaymentSheet.handleDeferredIntentConfirmation 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 · PaymentSheetLoader.load (cyclomatic 16) · ×1
  • PaymentSheetLoader.load (cyclomatic 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:63 — PaymentSheetLoader.load 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:21 — 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:467 — 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:577 — 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:183 — 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.
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:1122 — 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:1595 — 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). Of this number, 48 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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+API.swift:248 — 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). Of this number, 23 points are the body's own statements and 22 belong to 2 function items inside it that branch. 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:1475 — 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:380 — 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 · PaymentSheetVerticalViewController.calculateInitialSelection (cognitive 42) · ×1
  • PaymentSheetVerticalViewController.calculateInitialSelection (cognitive 42) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:376 — 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). Of this number, 35 points are the body's own statements and 7 belong to one function item inside it that branches. 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:358 — 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 · PaymentSheet.handleDeferredIntentConfirmation (cognitive 38) · ×1
  • PaymentSheet.handleDeferredIntentConfirmation (cognitive 38) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63 — PaymentSheet.handleDeferredIntentConfirmation has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 2 (4 pts), error handling 1 (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 · STPDecodingContainerProtocol.castFromNSObject (cognitive 36) · ×1
  • STPDecodingContainerProtocol.castFromNSObject (cognitive 36) StripeCore/StripeCore/Source/Coder/StripeJSONDecoder.swift:570 — 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+ConfirmationTokens.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:1847 — 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) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+CheckoutSession.swift:287 — 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). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. 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 · 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+Strings.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). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.confirmLinkPaymentOption (cognitive 27) · ×1
  • PaymentSheet.confirmLinkPaymentOption (cognitive 27) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+API.swift:651 — PaymentSheet.confirmLinkPaymentOption has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 5 (10 pts), ternaries 1 (3 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 · CheckoutController.confirmCheckoutSession (cognitive 27) · ×1
  • CheckoutController.confirmCheckoutSession (cognitive 27) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:505 — CheckoutController.confirmCheckoutSession has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 5 (8 pts), boolean chains 2, error handling 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 · 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) StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/STPAPIClient+PaymentSheet.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 · NSError.stp_error (cognitive 25) · ×1
  • NSError.stp_error (cognitive 25) StripeCore/StripeCore/Source/Helpers/STPError.swift:164 — NSError.stp_error has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, match/switch 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 · PaymentSheetLoader.load (cognitive 25) · ×1
  • PaymentSheetLoader.load (cognitive 25) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:63 — PaymentSheetLoader.load has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 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 · CheckoutController.confirm (cognitive 25) · ×1
  • CheckoutController.confirm (cognitive 25) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Checkout+Confirm.swift:259 — CheckoutController.confirm has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (6 pts), ternaries 1 (3 pts), error handling 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 · 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:301 — 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:250 — 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) StripePayments/StripePayments/Source/API Bindings/STPAPIClient+ApplePay.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:711 — 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 · LinkAuthFlowViewController.render (cognitive 23) · ×1
  • LinkAuthFlowViewController.render (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowViewController.swift:200 — LinkAuthFlowViewController.render has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, ternaries 1 (2 pts), 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 · LinkController.authorize (cognitive 23) · ×1
  • LinkController.authorize (cognitive 23) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:715 — 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:460 — 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:844 — 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) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentMethodMessagingElement/PMMESinglePartnerView.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 · UpdatePaymentMethodViewController.update (cognitive 22) · ×1
  • UpdatePaymentMethodViewController.update (cognitive 22) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/UpdatePaymentMethodViewController.swift:232 — 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 · SelfieCaptureViewController.statusText (cognitive 21) · ×1
  • SelfieCaptureViewController.statusText (cognitive 21) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:577 — SelfieCaptureViewController.statusText has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (6 pts), match/switch 3 (5 pts), boolean chains 2 (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 · PayWithLinkViewController.launchFinancialConnections (cognitive 21) · ×1
  • PayWithLinkViewController.launchFinancialConnections (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/PayWithLinkViewController.swift:654 — 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). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 21) · ×1
  • PaymentSheetLoader.fetchElementsSessionAndIntent (cognitive 21) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheetLoader.swift:248 — PaymentSheetLoader.fetchElementsSessionAndIntent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 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 · 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:397 — 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/PMME+Initialization.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+Card.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/PaymentSheet+PaymentMethodAvailability.swift:217 — 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 · CheckoutController.applyDefaults (cognitive 20) · ×1
  • CheckoutController.applyDefaults (cognitive 20) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutController.swift:476 — CheckoutController.applyDefaults has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (4 pts), boolean chains 2 (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 · 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:2239 — STPPaymentHandler._markChallengeCompleted has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3 (nesting depth added 4). Of this number, 13 points are the body's own statements and 7 belong to one function item inside it that branches. 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 · InterfaceCache.load! (cognitive 20) · ×1
  • InterfaceCache.load! (cognitive 20) ci_scripts/api_diff/interface_cache.rb:8 — InterfaceCache.load! has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 9, error handling 1. 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 · 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 · LinkAuthFlowCoordinator.sendCode (cognitive 19) · ×1
  • LinkAuthFlowCoordinator.sendCode (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Verification/LinkAuthFlowCoordinator.swift:323 — LinkAuthFlowCoordinator.sendCode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, 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 · PaymentSheet.createConfirmationTokenParams (cognitive 19) · ×1
  • PaymentSheet.createConfirmationTokenParams (cognitive 19) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.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:183 — 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). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. 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:364 — 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 · 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 · CryptoOnrampCoordinator.createCryptoPaymentToken (cognitive 17) · ×1
  • CryptoOnrampCoordinator.createCryptoPaymentToken (cognitive 17) REDACTED:795 — CryptoOnrampCoordinator.createCryptoPaymentToken has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), error handling 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 · 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 · CheckoutApplePayContext.makeSummaryItems (cognitive 17) · ×1
  • CheckoutApplePayContext.makeSummaryItems (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutApplePayContext.swift:357 — CheckoutApplePayContext.makeSummaryItems 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 · CustomerSheet.retrievePaymentOptionSelection (cognitive 17) · ×1
  • CustomerSheet.retrievePaymentOptionSelection (cognitive 17) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet.swift:359 — 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:299 — 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:444 — 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 · SelfieCaptureViewController.imageScanningSessionDidScanImage (cognitive 16) · ×1
  • SelfieCaptureViewController.imageScanningSessionDidScanImage (cognitive 16) StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController.swift:845 — SelfieCaptureViewController.imageScanningSessionDidScanImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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 · STPCardScanner.setupCamera (cognitive 16) · ×1
  • STPCardScanner.setupCamera (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/Helpers/STPCardScanner.swift:203 — 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 · ApplePayContextClosureDelegate.applePayContext (cognitive 16) · ×1
  • ApplePayContextClosureDelegate.applePayContext (cognitive 16) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/STPApplePayContext+PaymentSheet.swift:50 — ApplePayContextClosureDelegate.applePayContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 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 · 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:2150 — 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.
D3 · God Classes · FunctionTooLong · ×1
  • FunctionTooLong: NativeFlowController.swift.CreatePaneViewController StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:1475 — 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+ConfirmationTokens.swift:12 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+ConfirmationTokens.swift:12-156 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:63-228 — 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/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:45 — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardNumberInputTextFieldFormatter.swift:45-81 | StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPFormTextField.swift:77-162 — 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 · 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 (52 lines × 2) · ×1
  • Duplicated block (52 lines × 2) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:229 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:229-280 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:370-421 — 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:229` 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:228` calls `STPLocalizedString` and `StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/STPPaymentMethodEnums.swift:369` 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 (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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:270 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:270-304 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Link/LinkController.swift:335-369 — 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:270` 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 (34 lines × 2) · ×1
  • 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.
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:999 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:999-1026 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1071-1098 — 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:999` 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:1632 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1632-1658 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1733-1755 — 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:1632` 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:489-512 — 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:302 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift:302-325 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift:323-346 — before extracting anything, compare `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.swift` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/NativeSheetContainerViewController.swift` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 122 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 (23 lines × 4) · ×1
  • Duplicated block (23 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:394 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:394-416 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Saved Payment Method Screen/SavedPaymentOptionsViewController.swift:800-822 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.swift:1134-1156 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:503-525 — 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:824` calls `updateUI` and `StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Saved Payment Method Screen/VerticalSavedPaymentMethodsViewController.swift:527` 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:221 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:221-239 | 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: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.
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 (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:394 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:394-406 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetViewController.swift:285-301 — 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 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 (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 (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:346 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:346-359 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:389-402 | 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:346` 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 (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:152-166 | 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:135 — StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:135-149 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Link/STPAPIClient+Link.swift:208-223 — 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:135` 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:409 — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:409-422 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:433-446 | StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:459-472 — 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 × 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 lines × 11) · ×1
  • Duplicated block (12 lines × 11) StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62 — StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/CreditCardOcrPrediction.swift:62-74 | StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/KycInfo.swift:125-136 | StripeIdentity/StripeIdentity/Source/Categories/NSAttributedString+HTML.swift:76-87 | StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/v1-elements-sessions/STPElementsSession.swift:96-107 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:171-182 | 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:76-87 | 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 (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 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 (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:230 — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSavedPaymentMethodsViewController.swift:230-236 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/CVCReconfirmationViewController.swift:109-115 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetFlowControllerViewController.swift:332-338 | 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:1429 — StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1429-1434 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1440-1445 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1476-1481 | StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1505-1510 — 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:1429` 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:1438` calls `presentPollingVCForAction` and `StripePayments/StripePayments/Source/PaymentHandler/STPPaymentHandler.swift:1475` 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 (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:156-160 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:173-177 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:197-201 | StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentSheet+DeferredAPI.swift:214-218 — 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 (34 lines × 3) · ×1
  • Duplicated block (34 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-614 | StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/SelfieCaptureViewController+Strings.swift:12-45 — 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 × 34) · ×1
  • Duplicated block (7 lines × 34) 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/STPPaymentMethodGCashParams.swift:16-22 | 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/STPPaymentMethodMomoParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMonduParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgBankTransferParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgCardParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgUSSDParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgWalletParams.swift:16-22 | 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/STPPaymentMethodQRISParams.swift:16-22 | 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/STPPaymentMethodShopeePayParams.swift:16-22 | 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/STPPaymentMethodTouchNGoParams.swift:16-22 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTrueMoneyParams.swift:16-22 | 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 34 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 6) · ×1
  • Duplicated block (5 lines × 6) StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/AccountSessionClaimedMessageHandler.swift:17 — StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/AccountSessionClaimedMessageHandler.swift:17-24 | StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/CallSupplementalFunctionMessageHandler.swift:24-28 | StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/NotificationBanner/OpenNotificationBannerTaskMessageHandler.swift:68-77 | StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/OpenAuthenticatedWebViewMessageHandler.swift:21-28 | StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/OpenFinancialConnectionsMessageHandler.swift:25-32 | StripeConnect/StripeConnect/Source/Internal/Webview/MessageHandlers/PageDidLoadMessageHandler.swift:17-24 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times.
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 × 15) · ×1
  • Duplicated block (6 lines × 15) StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGCash.swift:27 — StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodGCash.swift:27-32 | 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/STPPaymentMethodMomo.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMondu.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgBankTransfer.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgUSSD.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgWallet.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodPayco.swift:26-31 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodQRIS.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodScalapay.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodSequra.swift:26-31 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodShopeePay.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTouchNGo.swift:27-32 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTrueMoney.swift:27-32 — 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 15 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 45) · ×1
  • Duplicated block (6 lines × 45) 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/STPPaymentMethodGCash.swift:19-24 | 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/STPPaymentMethodMomo.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMondu.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodMultibanco.swift:18-25 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgBankTransfer.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgUSSD.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodNgWallet.swift:19-24 | 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/STPPaymentMethodQRIS.swift:19-24 | 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/STPPaymentMethodShopeePay.swift:19-24 | 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/STPPaymentMethodTouchNGo.swift:19-24 | StripePayments/StripePayments/Source/API Bindings/Models/PaymentMethods/Types/STPPaymentMethodTrueMoney.swift:19-24 | 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 45 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 · Duplicated block (22–25 lines × 2) · ×1
  • Duplicated block (22–25 lines × 2) ci_scripts/notify.rb:15 — ci_scripts/notify.rb:15-39 | ci_scripts/notify_ci.rb:10-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 `ci_scripts/notify.rb: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. 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 · 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:807-824 — 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 (72 lines × 2) · ×1
  • Duplicated block (72 lines × 2) Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:850 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:850-921 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:850-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 250 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:240 — Example/PaymentSheet Example/PaymentSheet Example/PaymentSheetTestPlaygroundSettings.swift:240-281 | Example/PaymentSheet Example/PaymentSheetLocalizationScreenshotGenerator/PaymentSheetTestPlaygroundSettings.swift:240-281 — `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 250 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 (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:41 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:41-79 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:51-89 — 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 6 separate duplicated blocks between them, totalling at least 113 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 (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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:112 — Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewController.swift:112-134 | Example/IdentityVerification Example/IdentityVerification Example/ExampleVerificationViewControllerNativeUI.swift:133-155 — 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 6 separate duplicated blocks between them, totalling at least 113 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 (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 × 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 (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 (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.
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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/CheckoutSessionPoller.swift:24 — `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Minor — 270 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×198
  • Orphaned file StripeUICore/StripeUICore/Source/Controls/Button.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeConnect/StripeConnect/Source/Internal/Webview/ConnectWebViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeConnect/StripeConnect/Source/EmbeddedComponentManager+Appearance.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeCardScan/StripeCardScan/Source/CardScan/CardUtils/CreditCardUtils.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerNoAccountEligibleErrorView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/OcrMainLoop.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeIdentity/StripeIdentity/Source/NativeComponents/Views/DebugView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/GenericInfoScreen/GenericInfoBodyView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/DataAccessNoticeViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeCardScan/StripeCardScan/Source/CardVerify/VerifyCardViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripePayments/StripePayments/Source/API Bindings/Models/STPAddress.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file fastlane/SnapshotHelper.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeConnect/StripeConnect/Source/Internal/Analytics/ComponentAnalyticsClient.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/AccountPickerRowView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionSearchBar.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeCardScan/StripeCardScan/Source/CardScan/Extensions/Image+utils.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/LinkAccountPicker/LinkAccountPickerBodyView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeIdentity/StripeIdentity/Source/NativeComponents/Detectors/IDDetector/IDDetectorOutput.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/PartnerAuth/PrepaneViews.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/ManualEntry/ManualEntryFormView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file StripeFinancialConnections/StripeFinancialConnections/Source/Native/Shared/AttributedTextView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 173 more in this group — see findings.md.
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:121 — 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:127 — 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:133 — 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:140 — 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:256 — 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:272 — 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:294 — 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:301 — 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:316 — 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:325 — 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:465 — 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:470 — 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:474 — 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:478 — 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:482 — 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:486 — 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:490 — 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:494 — 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.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate ci_scripts/notify.rb:22 — `!env_sdk_failure_notif_endpoint || !env_sdk_failure_notif_endpoint_hmac_key` appears character-identically in 2 files — ci_scripts/notify.rb, ci_scripts/notify_ci.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 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 ci_scripts/size_report_modules.rb:62 — `env['BITRISE_PULL_REQUEST'].to_s.empty? || env['BITRISE_GIT_BRANCH'].to_s.start_with?('releases/')` appears character-identically in 2 files — ci_scripts/size_report_modules.rb, ci_scripts/snapshot_test_selection.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 StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewModel.swift:109 — `!linkAccount.isRegistered && requiresNameCollection` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/SignUp/LinkSignUpViewModel.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ViewModels/LinkInlineSignupViewModel.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 StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift:425 — `!session.accounts.data.isEmpty || session.paymentAccount != nil || session.bankAccountToken != nil` appears character-identically in 2 files — StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Web/FinancialConnectionsWebFlowViewController.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 StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift:430 — `LiquidGlassDetector.isEnabledInMerchantApp && theme.cornerRadius == nil` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Elements/CardSection/CardSectionElement.swift, StripeUICore/StripeUICore/Source/Elements/SegmentedSelectorElement.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 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 StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/LinkSheetContainer.swift:39 — `SheetImplementationResolver.isRequiredForDevice || usesNativeSheet` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/Controllers/LinkSheetContainer.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/PaymentSheetContainer.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 StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/PaymentMethodTypeCollectionView.swift:188 — `UIDevice.current.userInterfaceIdiom == .pad || UIDevice.current.userInterfaceIdiom == .mac` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/New Payment Method Screen/PaymentMethodTypeCollectionView.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/ViewControllers/BottomSheetViewController.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/Extensions/BillingDetails+ApplePay.swift:94 — `billingDetails?.email == nil && shippingAddress?.email != nil` appears character-identically in 2 files — StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift, StripePayments/StripePayments/Source/API Bindings/STPAPIClient+ApplePay.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/Extensions/BillingDetails+ApplePay.swift:100 — `billingDetails?.phone == nil && shippingAddress?.phone != nil` appears character-identically in 2 files — StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift, StripePayments/StripePayments/Source/API Bindings/STPAPIClient+ApplePay.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 StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/LinkUI.swift:235 — `configuration.appearance.cornerRadius == nil && LiquidGlassDetector.isEnabledInMerchantApp` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/LinkUI.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/Link/ViewModels/LinkInlineSignupViewModel.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 StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:34 — `consumerPublishableKey == nil && oldValue != nil` appears character-identically in 2 files — StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowDataManager.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 StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift:41 — `consumerSession == nil && oldValue != nil` appears character-identically in 2 files — StripeFinancialConnections/StripeFinancialConnections/Source/API Bindings/FinancialConnectionsAsyncAPIClient.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/NativeFlowDataManager.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 StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift:70 — `dataSource.manifest.allowManualEntry && !dataSource.reduceManualEntryProminenceInErrors` appears character-identically in 3 files — StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerViewController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/AttachLinkedPaymentAccount/AttachLinkedPaymentAccountViewController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/Error/ErrorViewController.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 StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift:316 — `elementsSession.paymentMethodRemoveLast(configuration: configuration) && intent.allowsPaymentMethodRemoval(elementsSession: elementsSession)` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Embedded/EmbeddedPaymentElement+Internal.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Vertical Main Screen/PaymentSheetVerticalViewController.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 StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/MainLoopStateMachine.swift:103 — `hasExpiryPrediction || prediction.expiryForDisplay != nil` appears character-identically in 2 files — StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/MainLoopStateMachine.swift, StripeCardScan/StripeCardScan/Source/CardVerify/CardVerifyStateMachine.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 Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift:40 — `isConfirmingPayment || name.isEmpty || email.isEmpty` appears character-identically in 3 files — Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithContactInfoView.swift, Testers/IntegrationTester/IntegrationTester/Source/Views/PaymentMethodWithShippingInfoView.swift, Testers/IntegrationTester/IntegrationTester/Source/Views/SEPADebitView.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 Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift:27 — `isConfirmingPayment || paymentMethodParams == nil` appears character-identically in 2 files — Testers/IntegrationTester/IntegrationTester/Source/Views/AUBECSDebitView.swift, Testers/IntegrationTester/IntegrationTester/Source/Views/CardView.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 StripePaymentSheet/StripePaymentSheet/Source/Categories/STPPaymentMethod+PaymentSheet.swift:147 — `isLinkPaymentMethod || isLinkPassthroughMode` appears character-identically in 2 files — StripePaymentSheet/StripePaymentSheet/Source/Categories/STPPaymentMethod+PaymentSheet.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/PaymentOption+Images.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 StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift:39 — `localizedTypes.contains(String.Localized.driverLicense) && localizedTypes.contains(String.Localized.governmentIssuedId)` appears character-identically in 2 files — StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController+Strings.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 StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift:37 — `localizedTypes.contains(String.Localized.driverLicense) && localizedTypes.contains(String.Localized.passport)` appears character-identically in 2 files — StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController+Strings.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 StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift:41 — `localizedTypes.contains(String.Localized.passport) && localizedTypes.contains(String.Localized.governmentIssuedId)` appears character-identically in 2 files — StripeIdentity/StripeIdentity/Source/NativeComponents/DocumentSide.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController+Strings.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 StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldValidator.swift:60 — `monthState == .valid && yearState == .valid` appears character-identically in 2 files — StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPCardExpiryInputTextFieldValidator.swift, StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/STPPaymentCardTextFieldViewModel.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 · Off-boarding risk · ×7
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 16 significant file(s) lose their only recent owner: StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/CryptoOnrampAnalyticsEvent.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/DocumentCollectionConfiguration.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Components/DocumentFileRow.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Views/MessageView.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Components/SourceOfFundsDocumentsView.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Views/DocumentSubtypePickerView.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Internal/AdditionalKYC/UI/Components/QuestionnaireAnswerField.swift, StripeCryptoOnramp/StripeCryptoOnramp/Source/Components/Errors/Concrete Error Types/AppAttestationError.swift (+8 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 14 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/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, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Currency Selector Element/CurrencySelectorElement+Appearance.swift (+6 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 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 #4 — If anonymized user #4 becomes unavailable, 6 significant file(s) lose their only recent owner: StripeCore/StripeCore/Source/Coder/StripeJSONDecoder.swift, REDACTED, 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, 6 significant file(s) lose their only recent owner: ci_scripts/record_snapshots.rb, ci_scripts/build_documentation.rb, ci_scripts/test.rb, StripeApplePay/StripeApplePay/Source/Extensions/BillingDetails+ApplePay.swift, ci_scripts/check_paymentsheet_test_sharding.rb, StripePaymentsUI/StripePaymentsUI/Source/Internal/UI/Views/Inputs/Card/STPPostalCodeInputTextField.swift. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/DocumentCaptureViewController.swift, StripeCameraCore/StripeCameraCore/Source/Coordinators/CameraSession.swift, StripeIdentity/StripeIdentity/Source/API Bindings/SelfieUploader+API.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageUploaders/SelfieUploader.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Coordinators/ImageScanner/FaceScanner/FaceScanner.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: StripeUICore/StripeUICore/Source/Elements/SegmentedSelectorElement.swift, StripePaymentSheet/StripePaymentSheet/Source/Internal/API Bindings/Address/AddressAutocompleteModels.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElementUtilities.swift, StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/Checkout/Express Checkout Element/ExpressCheckoutElement+Configuration.swift. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 7 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 (73 single-owned of 840 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 840 of the 1671 production source files in this repository met that bar). They are anonymized user #8 (3 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (2 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: StripeFinancialConnections/StripeFinancialConnections/Source/Native/Consent/ConsentLogoView.swift, StripeFinancialConnectionsLite/StripeFinancialConnectionsLite/Source/Controllers/FCLiteAuthFlowViewController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Common/FlowRouter.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/Views/BottomSheetView.swift, StripeIdentity/StripeIdentity/Source/NativeComponents/ViewControllers/BottomSheetViewController.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Helpers/String+Localized.swift, StripeCore/StripeCore/Source/Connections Bindings/LinkBrand.swift, StripeCore/StripeCore/Source/Connections Bindings/FinancialConnectionsEvent.swift (+3 more).
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 — 9 of 18 project(s) overshoot their size bounds, lowering Project Cohesion to 1.1/10. The most over is `StripePaymentSheet` (71234 LoC, 557 module-visible types across 60 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) — 198 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, StripeConnect/StripeConnect/Source/Internal/Webview/ConnectWebViewController.swift, StripeConnect/StripeConnect/Source/EmbeddedComponentManager+Appearance.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/InstitutionPicker/InstitutionTableView.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/NetworkingLinkSignupPane/NetworkingLinkSignupViewController.swift, StripeCardScan/StripeCardScan/Source/CardScan/CardUtils/CreditCardUtils.swift, StripeFinancialConnections/StripeFinancialConnections/Source/Native/AccountPicker/AccountPickerNoAccountEligibleErrorView.swift, StripeCardScan/StripeCardScan/Source/CardScan/CreditCardOcr/OcrMainLoop.swift (and 190 more) (204 orphaned of 841 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 841 of the 1671 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 stripe3ds2-support/Pods/iOSSnapshotTestCase/README.md:57 — stripe3ds2-support/Pods/iOSSnapshotTestCase/README.md links to `FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png`, but `stripe3ds2-support/Pods/iOSSnapshotTestCase/FBSnapshotTestCaseDemo/Scheme_FB_REFERENCE_IMAGE_DIR.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then 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 19278 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.
X5 · Nullable reference types · Ruby's type checker does not check nil everywhere · ×1
  • Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 47 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
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-63850402c4244400837efc91638edef2/history.json --exit-code 0 --source .165artifacts/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-63850402c4244400837efc91638edef2/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 --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude BuildConfigurations --exclude Example/AppClipExample/BuildConfigurations --exclude "Example/CardImageVerification Example/BuildConfigurations" --exclude "Example/FinancialConnections Example/BuildConfigurations" --exclude Stripe3DS2/BuildConfigurations --exclude StripePayments/StripePayments/Source/Categories --exclude StripePayments/StripePaymentsTestUtils/Resources --exclude StripePaymentsUI/StripePaymentsUI/Source/Categories --exclude Testers/IntegrationTester/BuildConfigurations .18artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .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 --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude BuildConfigurations --exclude Example/AppClipExample/BuildConfigurations --exclude "Example/CardImageVerification Example/BuildConfigurations" --exclude "Example/FinancialConnections Example/BuildConfigurations" --exclude Stripe3DS2/BuildConfigurations --exclude StripePayments/StripePayments/Source/Categories --exclude StripePayments/StripePaymentsTestUtils/Resources --exclude StripePaymentsUI/StripePaymentsUI/Source/Categories --exclude Testers/IntegrationTester/BuildConfigurations .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 --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a18511-d0d5-76ef-a632-db9ac0dd8254 · 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