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

Wikimedia/wikipedia-Ios

Measured 30 September 2026, 21:50 UTC

40% Weak
CriticalWeakAdequateStrongExemplary

Large · 154,413 LoC · 5 projects · rebuild ~1.1 person-years · weakest lens: Accessibility (23%)

Findings by grade

67 critical 939 serious 74 minor 39 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
30 September 2026, 21:50 UTC

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

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

49/54dimensions tool-verifieddeterministic · confidence 1.0 · 5 LLM-assisted, advisory
1049findings with an exact file:lineof 1080 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
54/125dimensions across the health lenses154413 LoC · 5 projects — wide & deep
Chapters

Executive summary

This large, complex asset is currently a workable system carrying significant risk. With an overall health score of 40%, the codebase is functional but fragile, particularly regarding compliance and long-term maintainability. The system represents a substantial investment, requiring approximately 1.1 person-years to rebuild, which underscores the high cost of failure and the value at stake in preserving its integrity.

The most critical vulnerability lies in accessibility compliance, which scores a mere 23%. For a system of this scale, this gap exposes the business to legal liability and excludes a segment of users, creating a tangible operational risk. Remediation here is not just a technical fix but a strategic imperative to protect the brand and ensure inclusive access. The cost of inaction is substantial, with annual drag on development velocity estimated to far exceed the one-time effort required to resolve these issues.

A secondary concern is the velocity tax imposed by code complexity. While the core logic is sound, the average complexity score indicates that every change incurs a hidden cost, slowing delivery and increasing the likelihood of defects. This friction compounds over time, making future enhancements more expensive and risky. Although the architecture is robust, the lack of automated accessibility checks in the CI pipeline means these issues slip through, requiring manual intervention and further delaying releases.

Despite these risks, the system benefits from strong domain modeling and code health, with scores of 91% and 84% respectively. This indicates that the core business logic is well-understood and maintainable, providing a solid foundation for improvement. The high maturity score suggests that new team members can onboard effectively, reducing the risk associated with personnel changes.

The first action should be to enforce accessibility in the existing toolchain by adding automated checks to the CI pipeline. This low-effort, high-impact move will prevent future regressions and begin to pay for itself within months. By addressing accessibility first, the business mitigates its highest risk while leveraging the system’s inherent strengths to drive steady, sustainable improvement.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Accessibility 23% · 45% weightReadiness 46% · 25% weightSecurity 52% · 14% weightPerformance 60% · 8% weightMaturity 65% · 4% weightArchitecture 82% · 2% weightCode Health 84% · 1% weightDomain Modelling 91% · 1% weight

Raise Accessibility 23 → 70 (the Healthy floor) ⇒ headline 40 → ~53.

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

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

  • D1 · NotificationsCenterDetailViewModel.primaryAction (cyclomatic 30) Wikipedia/Code/NotificationsCenterDetailViewModel.swift
  • D1 · NotificationsCenterCommonViewModel.verboseTitle (cyclomatic 24) Wikipedia/Code/NotificationsCenterCommonViewModel.swift
  • D1 · String.pluralDictionary (cyclomatic 24) WMF Framework/HasText.swift
  • D1 · ArticlePeekPreviewViewController.contextMenuItems (cyclomatic 23) Wikipedia/Code/ArticlePeekPreviewViewController.swift
  • D1 · PageNamespace.isTalkBased (cyclomatic 20) WMF Framework/PageNamespace.swift
  • D1 · UIView.wmf_preferredFrame (cyclomatic 20) WMF Framework/UIStackView+SubviewVerification.swift
  • D1 · localization.swift.importLocalizationsFromTWN (cyclomatic 18) Command Line Tools/Update Localizations/localization.swift
  • D1 · WMFCommunityFeedView.feedList (cyclomatic 17) WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift
  • D1 · WidgetController.fetchTopReadContent (cyclomatic 16) WMF Framework/Widget/WidgetController.swift
  • D1 · WMFContentGroup.detailViewControllerWithDataStore (cyclomatic 16) WMF Framework/WMFContentGroup+Display.swift
  • D1 · GenerateTopicsStrings.swift.injectIntoStringsFile (cyclomatic 16) scripts/GenerateTopicsStrings.swift
  • D2 · String.pluralDictionary (cognitive 50) WMF Framework/HasText.swift
  • D2 · localization.swift.importLocalizationsFromTWN (cognitive 45) Command Line Tools/Update Localizations/localization.swift
  • D2 · ArticlePeekPreviewViewController.contextMenuItems (cognitive 36) Wikipedia/Code/ArticlePeekPreviewViewController.swift
  • D2 · NotificationsCenterDetailViewModel.primaryAction (cognitive 29) Wikipedia/Code/NotificationsCenterDetailViewModel.swift
  • D2 · WMFForYouArticleCardView.body (cognitive 25) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift
  • D2 · GenerateTopicsStrings.swift.injectIntoStringsFile (cognitive 24) scripts/GenerateTopicsStrings.swift
  • D2 · localization.swift.exportLocalizationsFromSourceCode (cognitive 24) Command Line Tools/Update Localizations/localization.swift
  • D2 · WMFContentGroup.imageURLsCompatibleWithTraitCollection (cognitive 23) WMF Framework/WMFContentGroup+Display.swift
  • D2 · MWKDataStore.migrateWikipediaEntities (cognitive 21) WMF Framework/MWKDataStore+LanguageVariantMigration.swift
  • D2 · WMFSurveyView.body (cognitive 20) WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.swift
  • D2 · PageNamespace.isTalkBased (cognitive 19) WMF Framework/PageNamespace.swift
  • D2 · MWKDataStore.migrateNewVariants (cognitive 19) WMF Framework/MWKDataStore+LanguageVariantMigration.swift
  • D2 · WMFContentGroup.detailViewControllerWithDataStore (cognitive 19) WMF Framework/WMFContentGroup+Display.swift
  • D2 · WMFCommunityFeedView.feedList (cognitive 17) WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift
  • D2 · UIView.wmf_preferredFrame (cognitive 17) WMF Framework/UIStackView+SubviewVerification.swift
  • D2 · localization.swift.writeStrings (cognitive 17) Command Line Tools/Update Localizations/localization.swift
  • D2 · TalkPageArchivesView.body (cognitive 16) Wikipedia/Code/TalkPageArchivesView.swift
  • D2 · UIViewController.push (cognitive 16) Wikipedia/Code/FundraisingAnnouncementPanel.swift
  • D2 · Locale.uniqueWikipediaLanguages (cognitive 16) Wikipedia/Code/NSLocale+WMFExtras.swift
  • D3 · MethodTooLong: ArticleViewController.eventLoggingLabel Wikipedia/Code/ArticleViewController.swift
  • D3 · MethodTooLong: ArticleViewController.navigationToolbar Wikipedia/Code/ArticleViewController.swift
  • D3 · MethodTooLong: WMFArticle.quadKey WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift
  • D3 · MethodTooLong: WMFArticle.hasChangedValuesForCurrentEventThatAffectSavedArticlesFetch WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift
  • D3 · MethodTooLong: Error.logDescription WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift
  • D3 · MethodTooLong: SearchResultsViewController.semanticSearchHiddenToastTitle Wikipedia/Code/SearchResultsViewController.swift
  • D3 · MethodTooLong: TokenType.wmfTokenType WMF Framework/Fetcher.swift
  • D3 · MethodTooLong: MWKDataStore.importViewedArticlesIntoWMFData WMF Framework/MWKDataStore+LanguageVariantMigration.swift
  • D3 · TooManyMethods: SearchResultsViewController Wikipedia/Code/SearchResultsViewController.swift
  • D3 · TooManyMethods: UIViewController Wikipedia/Code/FundraisingAnnouncementPanel.swift
  • D3 · TooManyMethods: UserDefaults Wikipedia/Code/NSUserDefaults+WMFApplicationDefaults.swift
  • D3 · MethodTooLong: WMFDeveloperSettingsView.body WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift
  • D3 · ClassTooLong: HtmlUtils WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift
  • D3 · TooManyMethods: HtmlUtils WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift
  • D3 · MethodTooLong: WMFContentGroup.detailViewControllerForPreviewItemAtIndex WMF Framework/WMFContentGroup+Display.swift
  • D3 · ClassTooLong: WMFActivityTabView WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift
  • D4 · Near-duplicate member family (4 members, 12 shared lines) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift
  • D4 · Members sharing a duplicated core (10 members, 50+ identical tokens) Wikipedia/Code/DiffContainerViewController.swift
  • D4 · Members sharing a duplicated core (9 members, 50+ identical tokens) WMF Framework/Remote Notifications/RemoteNotificationsController.swift
  • D4 · Members sharing a duplicated core (8 members, 50+ identical tokens) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift
  • D4 · Members sharing a duplicated core (4 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift
  • D4 · Members sharing a duplicated core (4 members, 50+ identical tokens) Wikipedia/Code/ArticleLocationCollectionViewController.swift
  • D4 · Duplicated block (42 lines × 2) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift
  • D4 · Duplicated block (29 lines × 2) WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift
  • D4 · Duplicated block (25 lines × 5) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift
  • D4 · Duplicated block (24 lines × 2) WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift
  • D4 · Duplicated block (21 lines × 2) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift
  • D4 · Duplicated block (20–21 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift
  • D4 · Duplicated block (19 lines × 3) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift
  • D4 · Duplicated block (19 lines × 2) WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift
  • D4 · Duplicated block (16–18 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift
  • D4 · Duplicated block (17 lines × 3) WMF Framework/Widget/WidgetController.swift
  • D4 · Duplicated block (17 lines × 2) WMF Framework/PermanentlyPersistableURLCache.swift
  • D4 · Duplicated block (15–16 lines × 3) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift
  • D4 · Duplicated block (14–16 lines × 3) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift
  • D4 · Duplicated block (15 lines × 2) WMF Framework/PageNamespace.swift
  • D4 · Duplicated block (15 lines × 2) WMF Framework/WMFBlocksKit.swift
  • D4 · Duplicated block (14 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift
  • D4 · Duplicated block (13–14 lines × 2) Wikipedia/Code/DiffController.swift
  • D4 · Duplicated block (14 lines × 2) WMF Framework/MWKDataStore+LegacyPageViews.swift
  • D4 · Duplicated block (14 lines × 2) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift
  • D4 · Duplicated block (13 lines × 6) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift
  • D4 · Duplicated block (12 lines × 8) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift
  • D4 · Duplicated block (12 lines × 7) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift
  • D4 · Duplicated block (12 lines × 2) WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRow.swift
  • D4 · Duplicated block (10–12 lines × 2) Wikipedia/Code/ViewControllerRouter.swift
  • D4 · Duplicated block (12 lines × 2) WMFData/Sources/WMFData/Extensions/URL+API.swift
  • D4 · Duplicated block (11 lines × 3) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift
  • D4 · Duplicated block (10–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabInfoCardView.swift
  • D4 · Duplicated block (10–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift
  • D4 · Duplicated block (11 lines × 2) Widgets/Widgets/FeaturedArticleWidget.swift
  • D4 · Duplicated block (7–10 lines × 3) Wikipedia/Code/ArticlePeekPreviewViewController.swift
  • D4 · Duplicated block (7–10 lines × 2) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouEndOfFeedCardView.swift
  • D4 · Duplicated block (10 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsView.swift
  • D4 · Duplicated block (10 lines × 2) Wikipedia/Code/UIViewController+Extensions.swift
  • D4 · Duplicated block (9 lines × 3) Wikipedia/Code/EditSaveViewController.swift
  • D4 · Duplicated block (9 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/WMFActivityTabCustomizeViewModel.swift
  • D4 · Duplicated block (9 lines × 2) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift
  • D4 · Duplicated block (9 lines × 3) WMF Framework/MWKDataStore+LanguageVariantMigration.swift
  • D4 · Duplicated block (8 lines × 2) WMFComponents/Sources/WMFComponents/Components/Shared/Buttons/CloseButtons.swift
  • D4 · Duplicated block (8 lines × 2) WMF Framework/PageNamespace.swift
  • D4 · Duplicated block (8 lines × 2) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift
  • D4 · Duplicated block (7 lines × 3) WMFComponents/Sources/WMFComponents/Components/Shared/Project Icons/WMFProjectIconView.swift
  • D4 · Duplicated block (6–7 lines × 2) WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift
  • D4 · Duplicated block (7 lines × 2) Wikipedia/Code/DiffContainerViewController.swift
  • D4 · Duplicated block (6 lines × 2) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift
  • D4 · Duplicated block (5–6 lines × 2) Wikipedia/Code/UIViewController+Extensions.swift
  • D4 · Duplicated block (2–5 lines × 4) WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift
  • D4 · Duplicated block (5 lines × 2) Widgets/Widgets/URL+WidgetSource.swift
  • D4 · Duplicated block (6 lines × 2) WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift

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

Rebuild cost & value ~ Modeled — €51,000–€260,000
Cost to rebuild€51,000–€260,000 (0.5–1.6 person-years (853–2,705 h), ~1–3 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.7× (at 40% quality) — the last 20% of quality is most of the work
Size & shapeLarge · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

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

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

Top priorities

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

1
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
+14.4 pts · Medium effort · Text alternatives
2
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
+14.4 pts · Medium effort · Page structure
3
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.
+14.2 pts · Medium effort · A11y enforcement

Diagnosis — what's actually going on

Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~1.1 person-years to rebuild), and its weakest lens is Accessibility at 23%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Large, ~1.1 person-years rebuild (154,413 LoC) · weakest lens: Accessibility 23%
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 32.1–213.7 engineer-days every year, paid as drag on the ~641,102 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–4 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 2–5% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 158,080 line(s) changed over a 90-day window ⇒ ~641,102/year · D1/D2/D4/D6 code quality: averaging 7.2/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 4 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 7.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency graph

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

arch WMFComponents WMFComponents WMFData WMFData WMFComponents->WMFData WMFNativeLocalizations WMFNativeLocalizations WMFComponents->WMFNativeLocalizations WMFTestKitchen WMFTestKitchen WMFData->WMFTestKitchen WMFTranslateWikiLocalizations WMFTranslateWikiLocalizations

Architecture — module dependency matrix

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

13 modules, 18 dependencies. 1 dependency cycle across 4 modules, marked above the diagonal.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 (global)2 WMFLocalizations~WMFTranslateWikiLocalizations3 Wikipedia4 Wikipedia.Code5 Wikipedia.assets6 scripts7 repository8 WMFTestKitchen~WMFTestKitchen9 WMFData~WMFData10 WMFComponents~WMFComponents11 WMFData~WMFDataTestSupport12 WMFLocalizations~WMFNativeLocalizations13 WMFData~WMFDataMocks
1 (global)
2 WMFLocalizations~WMFTranslateWikiLocalizations
3 Wikipedia
4 Wikipedia.Code
5 Wikipedia.assets
6 scripts
7 repository27419347
8 WMFTestKitchen~WMFTestKitchen225
9 WMFData~WMFData298310
10 WMFComponents~WMFComponents8241209
11 WMFData~WMFDataTestSupport11
12 WMFLocalizations~WMFNativeLocalizations41
13 WMFData~WMFDataMocks13301
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
(global)…lateWikiLocalizationsWikipediaWikipedia.CodeWikipedia.assetsscriptsrepository…itchen~WMFTestKitchenWMFData~WMFData…ponents~WMFComponents…ta~WMFDataTestSupport…MFNativeLocalizationsWMFData~WMFDataMocks(global)1…lateWikiLocalizations2Wikipedia3Wikipedia.Code4Wikipedia.assets5scripts6repository7…itchen~WMFTestKitchen8WMFData~WMFData9…ponents~WMFComponents10…ta~WMFDataTestSupport11…MFNativeLocalizations12WMFData~WMFDataMocks13274193472252983108241209114113301

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

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

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

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

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

At a glance — Domain Modelling · 91% · Exemplary ·

At a glance — Accessibility · 23% · Critical · gated by AC1, AC3 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2021 — Injection37High / Critical
A02:2021 — Cryptographic Failures15High / Critical
A06:2021 — Vulnerable & Outdated Components3High / Critical

Roadmap

First, ensure all media elements have appropriate text alternatives and that the page structure includes proper language declarations, titles, and landmarks. Next, enforce accessibility standards by integrating automated checks into your UI test suite and gating merges on CI. Finally, improve visual safety by maintaining visible focus styles and sufficient color contrast, while adding static security analysis to your CI pipeline to prevent regressions.

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

Do thisHelpsEffortDimension
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+14.4 ptsMediumText alternatives
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+14.4 ptsMediumPage structure
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.+14.2 ptsMediumA11y enforcement
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.+14.1 ptsMediumVisual & motion safety
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED.+3.8 ptsLowREDACTED Scanning
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.+3.9 ptsMediumSecurity & performance tooling
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+3.8 ptsMediumRelease Hygiene
Resolve the 14 Low coverage finding(s) in Code Coverage — start with SourceConfig.swift, AgentData.swift, ClientData.swift.+3.1 ptsMediumCode Coverage

File quality

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

FileScoreBandWorst signal
WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift3.1SlopChange Coupling: Boundary-crossing change coupling: TimelineViewModel.swift ↔ UserContributionsDataController.swift
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED4.4MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.5MixedSecrets (history): REDACTED: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift4.8MixedCyclomatic Complexity: WMFArticleTabsDataController.getAdjacentArticleInTab (cyclomatic 22)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
WMF Framework/HasText.swift5.5MixedCyclomatic Complexity: String.pluralDictionary (cyclomatic 24)
WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift5.5MixedChange Coupling: Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFDeveloperSettingsDataController.swift
Wikipedia/Code/TalkPageViewController.swift5.5MixedCyclomatic Complexity: TalkPageViewController.tappedPublish (cyclomatic 22)
Wikipedia/Code/PageHistoryViewController.swift5.5MixedCyclomatic Complexity: PageHistoryViewController.configure (cyclomatic 17)
Wikipedia/Code/NotificationsCenterViewController.swift5.5MixedCyclomatic Complexity: NotificationsCenterViewController.userDidPanCell (cyclomatic 22)
Wikipedia/Code/EditSaveViewController.swift5.5MixedCyclomatic Complexity: EditSaveViewController.handleEditFailure (cyclomatic 21)
WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift5.5MixedCyclomatic Complexity: WMFWatchlistDataController.apply (cyclomatic 20)

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

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

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

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

Could not be resolved — 39

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. 49 of 54 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 1.0 — 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 — 54 dimensions across the health lenses
D1D2D3D4D5D6D8D9D10D11D12D13D14D15D16D17D19D20D21D22D26D28D29D30D34D35D36D37D43D44AC1AC3AC6AC7AX10AX3AX4AX8AX9DM4DM5DM6M1M2M3M4P1P10P2P3P4P6PF2X29

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, 1049 of 1080 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a0f44c-9f4c-726a-904b-9aab24ab7422.

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.

  • D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D32 Data Compliance (PII/GDPR) — 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. `Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift`, `WMF Framework/CacheGroup+CoreDataProperties.swift`, `WMF Framework/CacheItem+CoreDataProperties.swift`, `WMF Framework/ReadingList+CoreDataProperties.swift`, `WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingFeedPreferenceViewModel.swift`, … (+42 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection singletons in C#, Spring/JSR-330/CDI singletons in Java and Kotlin, and module state in Python request handlers only, and this repository's product is written in Swift, which was left unread, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 2 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, or an npm dev script. None was found, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • PF3 Async & latency hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust and Go), and its PHP, Swift source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • 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.
  • D11 Test Reliability: Flakiness is inferred from history/markers — Watchdog runs the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • 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.
  • 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.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

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

Dimensions

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

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

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

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

105 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DonateCoordinator.presentActionSheet at 66. A further 21 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 WMFSFSymbolIcon.`for` at 137 — they are counted neither in the figure above nor in this dimension's score. 9 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: WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift (WMFSFSymbolIcon.`for` at 137), WMFData/Sources/WMFData/Models/Shared/WMFArticleTopic.swift (WMFArticleTopic.displayName at 40), WMF Framework/Remote Notifications/Model/RemoteNotification+CoreDataClass.swift (RemoteNotification.typeFrom at 26), WMFTestKitchen/Sources/WMFTestKitchen/ContextController.swift (ContextController.filterClientData at 25), Wikipedia/Code/SettingsCoordinator.swift (SettingsCoordinator.handleSettingsAction at 23), and 4 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.

DonateCoordinator.presentActionSheet (cyclomatic 66)Wikipedia/Code/DonateCoordinator.swift:226
WMFFont.`for` (cyclomatic 65)WMFComponents/Sources/WMFComponents/Style/WMFFont.swift:61
ReadingListsSyncOperation.processLocalUpdates (cyclomatic 55)WMF Framework/ReadingListsSyncOperation.swift:479
WMFAccountLoginLogoutFetcher.login (cyclomatic 54)Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89
PlacesViewController.regroupArticlesIfNecessary (cyclomatic 43)Wikipedia/Code/PlacesViewController.swift:1449

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

What to do

  1. Resolve the 1 DonateCoordinator.presentActionSheet (cyclomatic 66) finding(s) in Cyclomatic Complexity — start with DonateCoordinator.swift. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 WMFFont.`for` (cyclomatic 65) finding(s) in Cyclomatic Complexity — start with WMFFont.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 ReadingListsSyncOperation.processLocalUpdates (cyclomatic 55) finding(s) in Cyclomatic Complexity — start with ReadingListsSyncOperation.swift. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

173 method(s) exceeded the cognitive complexity threshold of 15; the worst was ReadingListsSyncOperation.processLocalUpdates at 133.

ReadingListsSyncOperation.processLocalUpdates (cognitive 133)WMF Framework/ReadingListsSyncOperation.swift:479
PlacesViewController.regroupArticlesIfNecessary (cognitive 88)Wikipedia/Code/PlacesViewController.swift:1449
WMFAccountLoginLogoutFetcher.login (cognitive 87)Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89
DiffTransformer.populateAdditionalSectionAndMoveInfo (cognitive 67)Wikipedia/Code/DiffTransformer.swift:99
HtmlUtils.addStyling (cognitive 64)WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:320

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

What to do

  1. Resolve the 1 ReadingListsSyncOperation.processLocalUpdates (cognitive 133) finding(s) in Cognitive Complexity — start with ReadingListsSyncOperation.swift. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PlacesViewController.regroupArticlesIfNecessary (cognitive 88) finding(s) in Cognitive Complexity — start with PlacesViewController.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 WMFAccountLoginLogoutFetcher.login (cognitive 87) finding(s) in Cognitive Complexity — start with WMFAccountLoginLogoutFetcher.swift. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes8.1 / 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.1 / 10 · rule-coverage 100% · ceiling Prevented

107 god class(es) detected.

TooManyMethods: ArticleViewController · ×37Wikipedia/Code/ArticleViewController.swift:10
MethodTooLong: WMFAppViewController.processLinkUserActivity · ×31Wikipedia/Code/WMFAppViewController.swift:42
FileTooLong: Code/PlacesViewController.swift · ×21Wikipedia/Code/PlacesViewController.swift
ClassTooLong: PlacesViewController · ×18Wikipedia/Code/PlacesViewController.swift:9

What to do

  1. Resolve the 37 TooManyMethods finding(s) in God Classes — start with ArticleViewController.swift, WMFAppViewController.swift, ExploreViewController.swift. — One of this dimension's main actionable groups (37 warning-level).
  2. Resolve the 31 MethodTooLong finding(s) in God Classes — start with ArticleViewController.swift (5), ReadingListsSyncOperation.swift (3), WMFAppViewController.swift (2). — One of this dimension's main actionable groups (31 warning-level).
  3. Resolve the 21 FileTooLong finding(s) in God Classes — start with PlacesViewController.swift, WMFAppViewController.swift, ExploreViewController.swift. — One of this dimension's main actionable groups (21 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.0 / 10Stronggated by 320 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.0 / 10 · rule-coverage 100% · ceiling Verified

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

Duplicated block (6 lines × 2) · ×29WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:38
Duplicated block (5 lines × 2) · ×29WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:44
Duplicated block (8 lines × 2) · ×20WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:47
Duplicated block (7 lines × 2) · ×20WMF Framework/Fetcher.swift:110
Duplicated block (11 lines × 2) · ×12WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64

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

What to do

  1. Resolve the 29 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), LockscreenSearchWidget.swift (2), DescriptionWelcomeContainerViewController.swift (2). — One of this dimension's main actionable groups (29 warning-level).
  2. Resolve the 29 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with DescriptionWelcomePageViewController.swift (3), AppOnboardingCoordinator.swift (2), InsertMediaImagePositionSettingsViewController.swift (2). — One of this dimension's main actionable groups (29 warning-level).
  3. Resolve the 20 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with ActivityTabViewController.swift (2), TimelineViewModel.swift, CloseButtons.swift. — One of this dimension's main actionable groups (20 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 · Coupling6.8 / 10Adequate✓ 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 6.8 / 10 · rule-coverage 100% · ceiling Prevented

5 production modules (SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 2 module(s) off the main sequence.

Off the main sequence: WMFNativeLocalizations · ×2

What to do

  1. Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 warning-level).
  2. 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)7.7 / 10Strong✓ Tool-verified

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

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

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

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

111 of 591 classes have LCOM4 above 3.

Low cohesion: ExploreViewController (LCOM4 58) · ×111Wikipedia/Code/ExploreViewController.swift:9

What to do

  1. Resolve the 111 Low cohesion finding(s) in Cohesion (LCOM4) — start with HasText.swift (2), ExploreViewController.swift, NSUserDefaults+WMFApplicationDefaults.swift. — One of this dimension's main actionable groups (111 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.

D8 · Code Coverage1.0 / 10Critical✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 1.6% — 14 file(s) below 50%. Measured from the Swift suite (WMFComponents: no coverage export; WMFData: no coverage export; WMFLocalizations: no coverage export; WMFTestKitchen: `swift test --enable-code-coverage` over 15 production file(s)).

Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift · ×14WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift

What to do

  1. Resolve the 14 Low coverage finding(s) in Code Coverage — start with SourceConfig.swift, AgentData.swift, ClientData.swift. — One of this dimension's main actionable groups (14 warning-level).
  2. Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution9.5 / 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.5 / 10 · rule-coverage 100% · ceiling Documented

1356 test methods: 1304 unit, 0 integration, 0 BDD, 52 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality9.8 / 10Stronggated by 17 serious 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.8 / 10 · rule-coverage 100% · ceiling Prevented

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

No assertions: successDoesNotCallHTTPErrorLogger · ×11WMFData/Tests/WMFDataTests/WMFBasicServiceHTTPErrorLoggerTests.swift:50
Skipped test: testArticleNonLeadImageCanBeTapped · ×6WikipediaUITests/ArticleControlsUITests.swift:108
No direct assertions: testFirstLaunchShowsOnboardingSmoke · ×47WikipediaUITests/AppOnboardingUITests.swift:6
Test project verifies nothing: WikipediaUITestsWikipediaUITests/AppOnboardingUITests.swift:6

What to do

  1. Resolve the 47 No direct assertions finding(s) in Test Quality — start with ArticleControlsUITests.swift (21), ExploreUITests.swift (9), NewAppOnboardingUITests.swift (9). — One of this dimension's main actionable groups (47 recommendation-level).
  2. Resolve the 11 No assertions finding(s) in Test Quality — start with WMFWatchlistDataControllerTests.swift (3), WMFImageDataControllerTests.swift (2), WMFUserImpactDataControllerTests.swift (2). — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 6 Skipped test finding(s) in Test Quality — start with ArticleControlsUITests.swift (4), ArticleImageGalleryUITests.swift, WMFBarButtonHostingViewTests.swift. — One of this dimension's main actionable groups (6 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.

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). Swift (4 packages): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.8 6.9 / 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.9 / 10 · rule-coverage 70% · ceiling Verified

4 outdated direct SwiftPM dependencies, 0 pinning defect(s). 7 of 10 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.

Outdated: cocoalumberjack · ×4

What to do

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

2 secret(s) detected.

REDACTED

What to do

  1. Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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 Compliance10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 98 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 98 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. 1 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.9 / 10Stronggated by 14 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.9 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: Wikipedia/Code/DonateCoordinator.swift (23×66=1518); WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift (10×137=1370); Wikipedia/Code/ArticleViewController.swift (27×19=513)

Hotspot: Wikipedia/Code/DonateCoordinator.swift · ×14Wikipedia/Code/DonateCoordinator.swift:226

What to do

  1. Resolve the 14 Hotspot finding(s) in Churn × Complexity Hotspots — start with DonateCoordinator.swift, WMFIcon.swift, ArticleViewController.swift. — One of this dimension's main actionable groups (14 warning-level).

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

D16 · Bus Factor8.3 / 10Strong✓ 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 8.3 / 10 · rule-coverage 100% · ceiling Documented

114 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Wikipedia/Code/WhichCameFirstCoordinator.swift. Counted over 687 of the 1236 production source files in this repository: 546 are under the ~2,400-byte size floor this dimension measures over, and the remaining 3 have no attributable history left to measure.

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

What to do

  1. Resolve the 4 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (4 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt9.9 / 10Stronggated by 52 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.9 / 10 · rule-coverage 100% · ceiling Prevented

52 deducted task-comment markers across 154413 LoC (0.0/KLoC) → score 9.9. 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 · ×50Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift:63
HackComment · ×2WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentNavigationController.swift:52

What to do

  1. Resolve the 50 TodoComment finding(s) in Explicit Debt — start with Fetcher.swift (4), WMFContentGroup+DetailViewControllers.swift (3), ExploreViewController.swift (3). — One of this dimension's main actionable groups (50 warning-level).
  2. Resolve the 2 HackComment finding(s) in Explicit Debt — start with WMFComponentNavigationController.swift, ArticleViewController.swift. — One of this dimension's main actionable groups (2 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

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

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

The repository's root README (Wikipedia iOS) is a clear overview of what the project does (the official Wikipedia iOS app), its license, source repo, bugs/feature planning link, and an excellent Building and Running section that explains Xcode version requirements, setup script behavior, and how to run the app on the simulator. The WMFComponents/READMEs are directory-only READMEs for their own packages; the main project's architecture docs (UI-Test Architecture, CI Lanes) and localization documents (Localization and Internationalization, Updating languages) are well written with detailed source-of-truth tables, layering rules, workflow steps, troubleshooting notes, and a full outline. The only unreviewed document is docs/process.md, which appears to be a process doc but the summary does not quote it as an overview or show any content; given its brevity it is borderline internal-focused rather than missing from the visible set.

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

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

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

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyStronggated by 1 serious finding◐ Sampled · advisory

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

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

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

1 API inconsistencies across a 400-member sample of 565 exposed types.

Redundant lifecycle method across component types. While these are distinct types, the method `appEnvironmentDidChange` appears on 5 different component-related types with identical signatures and likely identical implementation logic (reacting to theme/trait changes). This suggests a shared protocol or base class could unify this behavior, reducing boilerplate and ensuring consistent handling of environment changes across the component hierarchy.

What to do

  1. Resolve the 1 Redundant lifecycle method across component types. While these are… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

3 of 5 build units (Bundler, SwiftPM) flagged as possibly oversized/incoherent.

Split WMFComponents

What to do

  1. Resolve the 1 Split WMFComponents 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

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

38 finding(s): 0 critical, 29 high, 5 medium, 4 low. 19 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 9 file(s) — `WMF Framework/Third Party/EXTScope.h`, `WMF Framework/Third Party/Mantle/extobjc/include/MTLEXTRuntimeExtensions.h` (line 22, line 58, line 336), `WMF Framework/Third Party/Mantle/extobjc/include/MTLEXTScope.h`, `WMFData/Sources/WMFData/Data Controllers/Games/WMFGamesDataController.swift` (line 340, line 341, line 344, …), `Wikipedia/Code/ExploreViewController.swift` (line 255, line 741), … (+4 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. Separately, one or more rules could not re-parse an embedded snippet in 12 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  2. Resolve the 1 REDACTED finding(s) charged to Static Analysis (SAST) — the other 19 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (20 issue-level, 1 of them charged here).
  3. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).

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

D30 · Dependency Vulnerabilities9.1 / 10Adequategated by 1 critical finding✓ 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 9.1 / 10 · rule-coverage 100% · ceiling Documented

3 finding(s): 0 critical, 1 high, 1 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness9.2 / 10Adequategated by 1 critical finding✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Documented

54 of 690 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Wikipedia/Code/NotificationsCenterCell.swift. Counted over 690 of the 1236 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledgeWikipedia/Code/NotificationsCenterCell.swift
Further orphaned files (smaller)

What to do

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

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

D35 · Change Coupling9.6 / 10Adequategated by 11 critical 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.6 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: WMFDeveloperSettingsView.swift↔WMFDeveloperSettingsDataController.swift 78%; WMFCommunityFeedView.swift↔WMFHomeViewModel.swift 73%; ArticleViewController+ArticlePreviewing.swift↔ColumnarCollectionViewController.swift 69%

Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFDeveloperSettingsDataController.swift · ×11WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift
Change coupling: WMFCommunityFeedView.swift ↔ WMFHomeViewModel.swift · ×8WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift
Change-coupling hub: InsertLinkViewController.swift → ArticleViewController.swift, EditLinkViewController.swift, SearchViewController.swift · ×2Wikipedia/Code/InsertLinkViewController.swift

What to do

  1. Resolve the 11 Boundary-crossing change coupling finding(s) in Change Coupling — start with WMFDeveloperSettingsView.swift (2), WMFTempAccountsSheetView.swift, WMFDeveloperSettingsViewModel.swift. — One of this dimension's main actionable groups (11 issue-level).
  2. Resolve the 8 Change coupling finding(s) in Change Coupling — start with ArticleViewController+ArticlePreviewing.swift (2), WMFCommunityFeedView.swift, WMFUserDefaultsKey.swift. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with InsertLinkViewController.swift, ExploreViewController.swift. — One of this dimension's main actionable groups (2 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

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

0/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.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-Life6.0 / 10Adequate✓ 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 6.0 / 10 · rule-coverage 100% · ceiling Documented

1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 1 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.

End-of-life runtime: Ruby 3.0

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).

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

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — Wikipedia/assets/about.html:95, Wikipedia/assets/about.html:96

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC3 · Page structure1.6 / 10Critical✓ 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.

  • The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — Wikipedia/Code/WMFRandomDiceButton.html:6, Wikipedia/assets/about.html:2
  • A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×2) — Wikipedia/Code/WMFRandomDiceButton.html:6, Wikipedia/assets/about.html:2
  • user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. (×2) — Wikipedia/Code/WMFRandomDiceButton.html:8, Wikipedia/assets/about.html:6
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — Wikipedia/assets/about.html:2
  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — Wikipedia/assets/about.html:93

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.
AC6 · Visual & motion safety4.3 / 10Weak✓ Tool-verified

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

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

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

  • This stylesheet animates but never checks prefers-reduced-motion, so motion-sensitive users can't opt out. Wrap motion in @media (prefers-reduced-motion: no-preference). — Wikipedia/Code/WMFRandomDiceButton.html:9

What to do

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

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

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

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

  • No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 2 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 composition10.0 / 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 isolation7.5 / 10Strong✓ 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.

  • `WMFComponents` (production) references the test project `WMFDataMocks`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.

What to do

  • Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
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.

DM4 · Rich vs anemic domain model7.9 / 10Strong✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

  • `InsertMediaSearchResult` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — Wikipedia/Code/InsertMediaSearchResultsCollectionViewController.swift:55
  • `URLRequest` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside. — WMF Framework/PermanentlyPersistableURLCache.swift:704

What to do

  • Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM on its own declaration (active-record), or reaching a web-framework transport type in its own method, couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

M1 · Documentation (README)8.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.
  • Add a README to the 2 of 4 project(s) that lack one — worth up to 1 pts.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

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

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

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

What to do

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

  • Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

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

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

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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.

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 · Observability7.0 / 10Strong✓ 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.

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 90246 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.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ 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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
PF2 · Allocation hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.

Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.

What to do

  • Raise allocation-aware density on the hot paths — currently 13 use(s) across 183,664 production line(s) (~0.1/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
  • Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

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

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

WCAG coverage — what static analysis assessed

Statically assessed 11 of 55 WCAG 2.2 Level A/AA success criteria (20%; ≈22% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 44 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
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial 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 44 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.1, 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.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 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.2, 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 Health84%StrongSolid.
Architecture82%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness46%Weak — gated by D8, D13, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security52%Adequate — gated by D28, D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling91%ExemplaryStrongest area.
Accessibility23%Critical — gated by AC1, AC3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Not evidenced — 4 control(s) we could not find positive evidence for

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

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

  • AC2 Forms & labels — No form control/button found in the parsed markup — AC2 not applicable here.
  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 47 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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
  • DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
  • DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
  • DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
  • DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, PHP, 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 — coverage data present for 15 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • 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.
  • PF3 Async & latency hygiene — Sync-over-async was not assessed: this repository's async code is written in Swift, whose blocking calls this check does not model yet. That is a gap in the analyzer's language reach, not a finding about your code.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 67 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×11
  • Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFDeveloperSettingsDataController.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift — `WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift` (context WMFComponents) and `WMFData/Sources/WMFData/Data Controllers/Developer Settings/WMFDeveloperSettingsDataController.swift` (context WMFData) sit in DIFFERENT parts of the tree yet change together 78% of the time (29 of the 37 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 29 shared commits counted here, the most recent 3 are `c9ce202d` Remove games dev settings; `b37d1391` Create YiR dev settings section; `bab87769` Add the semantic search experiment and its developer settings — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFUserDefaultsKey.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift — `WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift` (context WMFComponents) and `WMFData/Sources/WMFData/Store/WMFUserDefaultsKey.swift` (context WMFData) sit in DIFFERENT parts of the tree yet change together 65% of the time (24 of the 37 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 24 shared commits counted here, the most recent 3 are `c9ce202d` Remove games dev settings; `bab87769` Add the semantic search experiment and its developer settings; `33fb335d` Add a fundraising date override to the developer settings — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFTempAccountsSheetView.swift ↔ EditorViewController.swift WMFComponents/Sources/WMFComponents/Components/Temp Accounts/WMFTempAccountsSheetView.swift — `WMFComponents/Sources/WMFComponents/Components/Temp Accounts/WMFTempAccountsSheetView.swift` (context WMFComponents) and `Wikipedia/Code/EditorViewController.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `549364a3` Sheet buttons, profile view model fix; `7a5ff8a7` Move editor presentation logic, remove unused variable; `42fd1af8` PR fixes — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFDeveloperSettingsViewModel.swift ↔ WMFMockDeveloperSettingsDataController.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewModel.swift — `WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewModel.swift` (context WMFComponents) and `WMFData/Sources/WMFDataMocks/WMFMockDeveloperSettingsDataController.swift` (context WMFData) sit in DIFFERENT parts of the tree yet change together 60% of the time (21 of the 35 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 21 shared commits counted here, the most recent 3 are `b37d1391` Create YiR dev settings section; `7e1cd722` Spacing; `ad82e504` Start dev settings — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFSavedAllArticlesView.swift ↔ SavedAllArticlesCoordinator.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift — `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift` (context WMFComponents) and `Wikipedia/Code/SavedAllArticlesCoordinator.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 60% of the time (9 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `9ca84168` Add missing Saved All Articles events; `873779e9` Add back in delete prompt (at that commit the files were still `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAllArticlesView.swift` and `Wikipedia/Code/AllArticlesCoordinator.swift`); `9d91d931` Add login to sync prompt (at that commit the files were still `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAllArticlesView.swift` and `Wikipedia/Code/AllArticlesCoordinator.swift`) — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFYearInReviewView.swift ↔ YearInReviewCoordinator.swift WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewView.swift — `WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewView.swift` (context WMFComponents) and `Wikipedia/Code/YearInReviewCoordinator.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 56% of the time (20 of the 36 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `2e92f1a6` Rework mock to location slide; `3b51ec32` Finish refactor for category slide; `3dc72266` Alt text + imagery touchups — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFDonateViewController.swift ↔ SinglePageWebViewController.swift WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewController.swift — `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewController.swift` (context WMFComponents) and `Wikipedia/Code/SinglePageWebViewController.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `0fe227e5` Fix iPad contributions bar configuration; `0562adf0` Progress with reworking cancel and done buttons; `ca67d258` Updates the cancel action to use cancel text, keep it on the leading … — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFYearInReviewSlide.swift ↔ YearInReviewCoordinator.swift WMFData/Sources/WMFData/Models/Year In Review/WMFYearInReviewSlide.swift — `WMFData/Sources/WMFData/Models/Year In Review/WMFYearInReviewSlide.swift` (context WMFData) and `Wikipedia/Code/YearInReviewCoordinator.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 53% of the time (9 of the 17 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `abd983af` Add time, month calculations and add standard slide; `8e1b9e6c` Top articles slide; `730ec126` Fix compile failures, delete unnecessary evaluated flag — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFFeatureAnnouncementView.swift ↔ ExploreViewController.swift WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift — `WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift` (context WMFComponents) and `Wikipedia/Code/ExploreViewController.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 50% of the time (11 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `75ef9f85` Dinamically calculate background image height; `72a539e2` Combine announcements into one coordinator; `d86c63ea` Update feature announcement components and ExploreViewController — run `git show` on any of them.
  • Boundary-crossing change coupling: SettingsCoordinatorDelegate.swift ↔ WMFAppViewController+Extensions.swift WMFComponents/Sources/WMFComponents/Coordinator/SettingsCoordinatorDelegate.swift — `WMFComponents/Sources/WMFComponents/Coordinator/SettingsCoordinatorDelegate.swift` (context WMFComponents) and `Wikipedia/Code/WMFAppViewController+Extensions.swift` (context Wikipedia) sit in DIFFERENT parts of the tree yet change together 50% of the time (9 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e065c0e8` Add the Donations section and reminder entry point to Settings; `af9946d6` Add the Donations section and reminder entry point to Settings; `78664021` Add home feed feature flag, home coordinator, empty feed view control… — run `git show` on any of them.
  • Boundary-crossing change coupling: TimelineViewModel.swift ↔ UserContributionsDataController.swift WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift — `WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift` (context WMFComponents) and `WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift` (context WMFData) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `b2e32bed` PR Clean ups; `1470f7ca` Clean up (at that commit the file was still `WMFData/Sources/WMFData/Data Controllers/Activity Tab/UserContributionsDataController.swift`); `03c78cd6` Deep link diff (at that commit the file was still `WMFData/Sources/WMFData/Data Controllers/Activity Tab/UserContributionsDataController.swift`) — run `git show` on any of them.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC1 · Text alternatives · <img> without a text alternative · ×2
  • <img> without a text alternative Wikipedia/assets/about.html:95 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
  • <img> without a text alternative Wikipedia/assets/about.html:96 — An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC3 · Page structure · <html> without a lang · ×2
  • <html> without a lang Wikipedia/Code/WMFRandomDiceButton.html:6 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
  • <html> without a lang Wikipedia/assets/about.html:2 — The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure · Document without a <title> · ×2
  • Document without a <title> Wikipedia/Code/WMFRandomDiceButton.html:6 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
  • Document without a <title> Wikipedia/assets/about.html:2 — A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
AC3 · Page structure · Viewport restricts zoom · ×2
  • Viewport restricts zoom Wikipedia/Code/WMFRandomDiceButton.html:8 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
  • Viewport restricts zoom Wikipedia/assets/about.html:6 — user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
D13 · REDACTED Scanning · Leaked secret · ×2
  • REDACTED
  • REDACTED
DM4 · Rich vs anemic domain model · Anemic domain model · ×2
  • Anemic domain model: InsertMediaSearchResult Wikipedia/Code/InsertMediaSearchResultsCollectionViewController.swift:55 — `InsertMediaSearchResult` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
  • Anemic domain model: URLRequest WMF Framework/PermanentlyPersistableURLCache.swift:704 — `URLRequest` is a data-only reference entity whose behaviour is DELEGATED to a foreign utility (static methods that take it as their first parameter and hold its logic) — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants rather than being driven from outside.
AX8 · Test isolation · Production project references a test project · ×1
  • Production project references a test project: WMFComponents → WMFDataMocks — `WMFComponents` (production) references the test project `WMFDataMocks`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge Wikipedia/Code/NotificationsCenterCell.swift — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Serious — 939 finding(s)
D6 · Cohesion (LCOM4) · Low cohesion · ×111
  • Low cohesion: ExploreViewController (LCOM4 58) Wikipedia/Code/ExploreViewController.swift:9 — ExploreViewController's methods fall into 58 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 58 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: UserDefaults (LCOM4 38) Wikipedia/Code/NSUserDefaults+WMFApplicationDefaults.swift:35 — UserDefaults's methods fall into 38 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 38 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: WMFAppViewController (LCOM4 26) Wikipedia/Code/WMFAppViewController.swift:43 — WMFAppViewController's methods fall into 26 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 26 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 25) Wikipedia/Code/FundraisingAnnouncementPanel.swift:97 — UIViewController's methods fall into 25 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 25 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: ArticleViewController (LCOM4 17) Wikipedia/Code/ArticleViewController.swift:10 — ArticleViewController's methods fall into 17 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 17 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 16) WMF Framework/UIStackView+SubviewVerification.swift:1 — UIView'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: Configuration (LCOM4 13) WMF Framework/Configuration.swift:7 — Configuration'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: EditorViewController (LCOM4 13) Wikipedia/Code/EditorViewController.swift:14 — EditorViewController'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: OnThisDayViewController (LCOM4 13) Wikipedia/Code/OnThisDayViewController.swift:5 — OnThisDayViewController'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: TalkPageViewController (LCOM4 13) Wikipedia/Code/TalkPageViewController.swift:12 — TalkPageViewController'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: WMFSettingsViewController (LCOM4 12) WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:5 — WMFSettingsViewController's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ColumnarCollectionViewController (LCOM4 12) Wikipedia/Code/ColumnarCollectionViewController.swift:4 — ColumnarCollectionViewController's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: InsertMediaViewController (LCOM4 12) Wikipedia/Code/InsertMediaViewController.swift:9 — InsertMediaViewController's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ReadingListsViewController (LCOM4 12) REDACTED:15 — ReadingListsViewController's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: WMFSearchResultsViewModel (LCOM4 11) WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:4 — WMFSearchResultsViewModel'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: WMFActivityTabDataController (LCOM4 11) WMFData/Sources/WMFData/Data Controllers/Activity Tab/WMFActivityTabDataController.swift:3 — WMFActivityTabDataController'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: NewsViewController (LCOM4 11) Wikipedia/Code/NewsViewController.swift:5 — NewsViewController'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: SavedViewController (LCOM4 11) Wikipedia/Code/SavedViewController.swift:21 — SavedViewController'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: WMFActivityTabViewController (LCOM4 10) Wikipedia/Code/ActivityTabViewController.swift:12 — WMFActivityTabViewController'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: ArticleFetchedResultsViewController (LCOM4 10) Wikipedia/Code/ArticleFetchedResultsViewController.swift:4 — ArticleFetchedResultsViewController'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: ExploreCardViewController (LCOM4 10) Wikipedia/Code/ExploreCardViewController.swift:24 — ExploreCardViewController'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: InsertMediaSettingsViewController (LCOM4 10) Wikipedia/Code/InsertMediaSettingsViewController.swift:21 — InsertMediaSettingsViewController'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: ArticleFetcher (LCOM4 9) Wikipedia/Code/ArticleFetcher.swift:24 — ArticleFetcher'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: ReadingListEntryCollectionViewController (LCOM4 9) REDACTED:14 — ReadingListEntryCollectionViewController'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: SearchViewController (LCOM4 9) Wikipedia/Code/SearchViewController.swift:11 — SearchViewController'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.
  • + 86 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×50
  • TodoComment Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift:63 — // TODO: This is a temporary workaround to remove duplicated languages, but eventually a proper data migration for the user might need to occur to switch from the old language code to the new. — 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 WMF Framework/Router.swift:75 — // TODO: Fix to work across languages, not just EN. Fetch special page aliases per site and add to a set of local json files. — 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 WMF Framework/Router.swift:214 — // TODO: push history 'slice' — 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 WMF Framework/ReadingListsAPIController.swift:317 — // TODO: Remove when error response returns ID — 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 WMF Framework/NavigationState.swift:85 — // TODO: Remove after moving to Swift 5.1 - — 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 WMF Framework/LocationManagerProtocol.swift:3 — // TODO: Remove these helpers after `WMFNearbyContentSource` is refactored to Swift and `LocationManager` — 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 WMF Framework/ImageCacheController.swift:13 — // todo: could use DRY gatekeeper logic with superclass. this will likely get refactored out so holding off. — 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 WMF Framework/Fetcher.swift:6 — // TODO: Standardize on returning CancellationKey or URLSessionTask — 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 WMF Framework/Fetcher.swift:7 — // TODO: Centralize cancellation and remove other cancellation implementations (ReadingListsAPI) — 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 WMF Framework/Fetcher.swift:8 — // TODO: Think about utilizing a request buildler instead of so many separate functions — 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 WMF Framework/Fetcher.swift:9 — // TODO: Utilize Result type where possible (Swift only) — 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 WMF Framework/CacheTaskTracking.swift:8 — // TODO: less of a sledgehammer here — 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 WMF Framework/CacheController.swift:37 — // todo: Settings hook, logout don't sync hook, etc. — 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 WMF Framework/Remote Notifications/Model/WikimediaProject+RemoteNotifications.swift:89 — // TODO: This would be better as a generated mapping file from translatewiki's project translations (for example: https://translatewiki.net/wiki/Special:ExportTranslations?group=ext-wikimediaprojectnames&language=he&format=export-to-file)
  • TodoComment WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:339 — // TODO: Error state — 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 WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:355 — // TODO: Error state — 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 WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:177 — // TODO: Consider smarter prefix amounts, depending on screen size. — 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 WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController.swift:20 — // TODO: Remove when the `iosv1.semanticSearchLanguages` in the remote feature config is available. — 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 WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewLocalConfig.swift:8 — // TODO: Remove this file when the 2026 entry is published on wikifeeds. — 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 WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:767 — // TODO: 2026 — if there is a 2026 app icon, this needs its own key alongside — 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 WMFData/Sources/WMFData/Environment/WMFDataEnvironment.swift:45 — // TODO: Once the Wikipedia app target has been migrated to Swift 6 and its launch-time — 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 WMFData/Sources/WMFDataMocks/WMFMockArticleTabsDataController.swift:23 — // todo — 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 Wikipedia/Code/WMFContentGroup+DetailViewControllers.swift:45 — // todo — 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 Wikipedia/Code/WMFContentGroup+DetailViewControllers.swift:49 — // todo — 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 WMFData/Sources/WMFDataMocks/WMFMockArticleTabsDataController.swift:190 — // todo: — 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.
  • + 25 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×37
  • TooManyMethods: ArticleViewController Wikipedia/Code/ArticleViewController.swift:10 — TooManyMethods — 250 methods. The bar is 30 methods; this is 220 over it, 8.33× 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: WMFAppViewController Wikipedia/Code/WMFAppViewController.swift:43 — TooManyMethods — 188 methods. The bar is 30 methods; this is 158 over it, 6.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: ExploreViewController Wikipedia/Code/ExploreViewController.swift:9 — TooManyMethods — 147 methods. The bar is 30 methods; this is 117 over it, 4.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DonateFunnel Wikipedia/Code/DonateFunnel.swift:5 — TooManyMethods — 120 methods. The bar is 30 methods; this is 90 over it, 4.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.
  • TooManyMethods: PlacesViewController Wikipedia/Code/PlacesViewController.swift:9 — TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TalkPageViewController Wikipedia/Code/TalkPageViewController.swift:12 — TooManyMethods — 98 methods. The bar is 30 methods; this is 68 over it, 3.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: WMFHomeDataController WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:4 — TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.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: WMFSourceEditorViewController WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorViewController.swift:24 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: EditorViewController Wikipedia/Code/EditorViewController.swift:14 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.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: WatchlistFunnel Wikipedia/Code/WatchlistFunnel.swift:4 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.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: DiffContainerViewController Wikipedia/Code/DiffContainerViewController.swift:21 — TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: NotificationsCenterViewController Wikipedia/Code/NotificationsCenterViewController.swift:8 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.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.
  • TooManyMethods: ExploreCardViewController Wikipedia/Code/ExploreCardViewController.swift:24 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: SearchResultsViewController Wikipedia/Code/SearchResultsViewController.swift:16 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReadingListsViewController REDACTED:15 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× 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: Session Wikipedia/Code/Session.swift:26 — 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: SettingsCoordinator Wikipedia/Code/SettingsCoordinator.swift:12 — 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: ColumnarCollectionViewController Wikipedia/Code/ColumnarCollectionViewController.swift:4 — 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: PageHistoryViewController Wikipedia/Code/PageHistoryViewController.swift:20 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WMFActivityTabViewController Wikipedia/Code/ActivityTabViewController.swift:12 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReadingListEntryCollectionViewController REDACTED:14 — TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UIViewController Wikipedia/Code/FundraisingAnnouncementPanel.swift:97 — 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: ImageRecommendationsFunnel Wikipedia/Code/ImageRecommendationsFunnel.swift:3 — 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: EditInteractionFunnel Wikipedia/Code/EditInteractionFunnel.swift:4 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× 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: UserDefaults Wikipedia/Code/NSUserDefaults+WMFApplicationDefaults.swift:35 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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.
  • + 12 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×31
  • MethodTooLong: WMFAppViewController.processLinkUserActivity Wikipedia/Code/WMFAppViewController.swift:42 — MethodTooLong — processLinkUserActivity runs 1152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1052 over it, 11.52× 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: ArticleViewController.eventLoggingLabel Wikipedia/Code/ArticleViewController.swift:2 — MethodTooLong — eventLoggingLabel runs 832 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 732 over it, 8.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: ArticleViewController.shareMenuItemTapped Wikipedia/Code/ArticleViewController.swift:3 — MethodTooLong — shareMenuItemTapped runs 831 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 731 over it, 8.31× 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: ArticleViewController.navigationToolbar Wikipedia/Code/ArticleViewController.swift:5 — MethodTooLong — navigationToolbar runs 829 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 729 over it, 8.29× 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: ArticleViewController.didReceive Wikipedia/Code/ArticleViewController.swift:8 — MethodTooLong — didReceive runs 826 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 726 over it, 8.26× 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: ArticleViewController.referenceViewControllerUserDidTapClose Wikipedia/Code/ArticleViewController.swift:11 — MethodTooLong — referenceViewControllerUserDidTapClose runs 824 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 724 over it, 8.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.
  • MethodTooLong: WMFArticle.quadKey WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:15 — MethodTooLong — quadKey runs 495 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 395 over it, 4.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WMFArticle.hasChangedValuesForCurrentEventThatAffectSavedArticlesFetch WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:16 — MethodTooLong — hasChangedValuesForCurrentEventThatAffectSavedArticlesFetch runs 495 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 395 over it, 4.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Error.logDescription WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:4 — MethodTooLong — logDescription runs 349 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 249 over it, 3.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: SearchResultsViewController.semanticSearchHiddenToastTitle Wikipedia/Code/SearchResultsViewController.swift:14 — MethodTooLong — semanticSearchHiddenToastTitle 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: WMFSFSymbolIcon.`for` WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:203 — MethodTooLong — `for` runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× 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: TokenType.wmfTokenType WMF Framework/Fetcher.swift:6 — MethodTooLong — wmfTokenType runs 270 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 170 over it, 2.70× 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: ProfileState.sections WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:91 — MethodTooLong — sections runs 268 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 168 over it, 2.68× 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: ArticleCollectionViewCell.apply Wikipedia/Code/ArticleCollectionViewCell.swift:2 — MethodTooLong — apply runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× 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: WMFFont.`for` WMFComponents/Sources/WMFComponents/Style/WMFFont.swift:35 — MethodTooLong — `for` runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WMFFont.`for` WMFComponents/Sources/WMFComponents/Style/WMFFont.swift:61 — MethodTooLong — `for` runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: ReadingListsSyncOperation.processLocalUpdates WMF Framework/ReadingListsSyncOperation.swift:479 — MethodTooLong — processLocalUpdates runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: DonateCoordinator.presentActionSheet Wikipedia/Code/DonateCoordinator.swift:226 — MethodTooLong — presentActionSheet runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: MWKDataStore.importViewedArticlesIntoWMFData WMF Framework/MWKDataStore+LanguageVariantMigration.swift:6 — MethodTooLong — importViewedArticlesIntoWMFData runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: PlacesViewController.regroupArticlesIfNecessary Wikipedia/Code/PlacesViewController.swift:1449 — MethodTooLong — regroupArticlesIfNecessary runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: WMFDeveloperSettingsView.body WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:13 — MethodTooLong — body runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× 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: ReadingListsSyncOperation.executeSync WMF Framework/ReadingListsSyncOperation.swift:60 — MethodTooLong — executeSync runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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: WMFAccountLoginLogoutFetcher.login Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89 — MethodTooLong — login runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× 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: WMFAppViewController.viewDidLoad Wikipedia/Code/WMFAppViewController.swift:143 — MethodTooLong — viewDidLoad runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WMFNavigationBarConfiguring.configureNavigationBar WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:119 — MethodTooLong — configureNavigationBar 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.
  • + 6 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×29
  • Duplicated block (6 lines × 2) WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:38 — WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:38-43 | WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:51-56 — 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 `WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:38` 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) WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:56 — WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:56-61 | WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:89-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. 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, `WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:64` calls `logWatchlistUserDidTapUserButton` and `WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:96` 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 (6 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:92 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:92-97 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsViewModel.swift:69-74 — 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.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. 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) WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:94 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:94-99 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:128-133 — 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 `WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:94` 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 (6 lines × 2) Wikipedia/Code/DonateFunnel.swift:511 — Wikipedia/Code/DonateFunnel.swift:511-516 | Wikipedia/Code/DonateFunnel.swift:552-557 — 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) Wikipedia/Code/ArticlePlaceView.swift:254 — Wikipedia/Code/ArticlePlaceView.swift:254-259 | Wikipedia/Code/ArticlePlaceView.swift:481-486 — 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 `Wikipedia/Code/ArticlePlaceView.swift:254` 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) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:54 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:54-59 | Wikipedia/Code/FeedCardSettingsViewController.swift:26-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:54` 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) Wikipedia/Code/DiffListChangeViewModel.swift:71 — Wikipedia/Code/DiffListChangeViewModel.swift:71-76 | Wikipedia/Code/DiffListChangeViewModel.swift:109-114 — 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 (6 lines × 2) Wikipedia/Code/ExploreViewController.swift:1040 — Wikipedia/Code/ExploreViewController.swift:1040-1045 | Wikipedia/Code/ExploreViewController.swift:1057-1063 — 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 `Wikipedia/Code/ExploreViewController.swift:1040` 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 (6 lines × 2) Wikipedia/Code/PlaceSearch.swift:126 — Wikipedia/Code/PlaceSearch.swift:126-131 | Wikipedia/Code/PlaceSearch.swift:163-168 — 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 `Wikipedia/Code/PlaceSearch.swift:126` 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) Wikipedia/Code/PlacesViewController.swift:1316 — Wikipedia/Code/PlacesViewController.swift:1316-1321 | Wikipedia/Code/PlacesViewController.swift:1999-2004 — 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 `Wikipedia/Code/PlacesViewController.swift:1316` 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) Wikipedia/Code/ReadingListsCollectionViewCell.swift:210 — Wikipedia/Code/ReadingListsCollectionViewCell.swift:210-215 | Wikipedia/Code/SavedArticlesCollectionViewCell.swift:212-217 — 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 `Wikipedia/Code/ReadingListsCollectionViewCell.swift:210` 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) REDACTED:172 — REDACTED:172-177 | REDACTED:460-465 — 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 `REDACTED:172` 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) REDACTED:212 — REDACTED:212-217 | REDACTED:471-476 — 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 `REDACTED:212` 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 (6 lines × 2) REDACTED:640 — REDACTED:640-645 | REDACTED:590-595 — 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 `REDACTED:640` 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) WMF Framework/Collection+AsyncMap.swift:30 — WMF Framework/Collection+AsyncMap.swift:30-35 | WMF Framework/Collection+AsyncMap.swift:48-53 — 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 `WMF Framework/Collection+AsyncMap.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.
  • Duplicated block (6 lines × 2) WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift:54 — WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift:54-59 | WMFComponents/Sources/WMFComponents/Components/Temp Accounts/WMFTempAccountsSheetView.swift:21-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. 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) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewDonateCountSlideDataController.swift:24 — WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewDonateCountSlideDataController.swift:24-29 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewEditCountSlideDataController.swift:23-28 — 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) ContinueReadingWidget/WMFTodayContinueReadingWidgetViewController.swift:87 — ContinueReadingWidget/WMFTodayContinueReadingWidgetViewController.swift:87-92 | Wikipedia/Code/WMFArticlePreviewViewController.swift:64-69 — 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) Widgets/Widgets/LockscreenSearchWidget.swift:43 — Widgets/Widgets/LockscreenSearchWidget.swift:43-48 | Widgets/Widgets/SearchWidget.swift:45-50 — 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) Wikipedia/Code/DescriptionWelcomeContainerViewController.swift:21 — Wikipedia/Code/DescriptionWelcomeContainerViewController.swift:21-26 | Wikipedia/Code/WMFWelcomeContainerViewController.swift:28-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.
  • Duplicated block (6 lines × 2) Wikipedia/Code/DescriptionWelcomeContainerViewController.swift:53 — Wikipedia/Code/DescriptionWelcomeContainerViewController.swift:53-58 | Wikipedia/Code/WMFWelcomeContainerViewController.swift:79-84 — 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) Wikipedia/Code/DescriptionWelcomePageViewController.swift:166 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:166-171 | Wikipedia/Code/WMFWelcomePageViewController.swift:243-248 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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) Wikipedia/Code/DescriptionWelcomePanelViewController.swift:78 — Wikipedia/Code/DescriptionWelcomePanelViewController.swift:78-83 | Wikipedia/Code/WMFWelcomePanelViewController.swift:111-116 — 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, `Wikipedia/Code/DescriptionWelcomePanelViewController.swift:85` calls `performNextButtonAction` and `Wikipedia/Code/WMFWelcomePanelViewController.swift:117` 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 (6 lines × 2) REDACTED:29 — REDACTED:29-34 | REDACTED:37-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. 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.
  • + 4 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×29
  • Duplicated block (5 lines × 2) WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:44 — WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:44-48 | WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:57-61 — 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 `WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:44` 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 (5 lines × 2) Wikipedia/Code/ActivityTabViewController.swift:582 — Wikipedia/Code/ActivityTabViewController.swift:582-586 | Wikipedia/Code/SavedViewController.swift:325-329 — 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) Wikipedia/Code/AppOnboardingCoordinator.swift:119 — Wikipedia/Code/AppOnboardingCoordinator.swift:119-123 | Wikipedia/Code/AppOnboardingCoordinator.swift:142-146 — 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 `Wikipedia/Code/AppOnboardingCoordinator.swift:119` 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 (5 lines × 2) Wikipedia/Code/AppOnboardingCoordinator.swift:329 — Wikipedia/Code/AppOnboardingCoordinator.swift:329-333 | Wikipedia/Code/WhichCameFirstCoordinator.swift:417-421 — 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 `Wikipedia/Code/AppOnboardingCoordinator.swift:329` 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 (5 lines × 2) Wikipedia/Code/DescriptionWelcomePageViewController.swift:114 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:114-118 | Wikipedia/Code/WMFWelcomePageViewController.swift:140-144 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 `Wikipedia/Code/DescriptionWelcomePageViewController.swift:114` 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 (5 lines × 2) Wikipedia/Code/DescriptionWelcomePageViewController.swift:132 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:132-136 | Wikipedia/Code/WMFWelcomePageViewController.swift:174-178 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 `Wikipedia/Code/DescriptionWelcomePageViewController.swift:132` 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 (5 lines × 2) Wikipedia/Code/EditorViewController.swift:850 — Wikipedia/Code/EditorViewController.swift:850-854 | Wikipedia/Code/EditorViewController.swift:861-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/EditorViewController.swift:850` 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 (5 lines × 2) Wikipedia/Code/Session.swift:527 — Wikipedia/Code/Session.swift:527-531 | Wikipedia/Code/Session.swift:535-539 — 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 `Wikipedia/Code/Session.swift:527` 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 (5 lines × 2) Wikipedia/Code/TalkPageFindInPageSearchController.swift:48 — Wikipedia/Code/TalkPageFindInPageSearchController.swift:48-52 | Wikipedia/Code/TalkPageFindInPageSearchController.swift:89-93 — 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 `Wikipedia/Code/TalkPageFindInPageSearchController.swift:48` 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) REDACTED:635 — REDACTED:635-639 | REDACTED:585-589 — 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) Widgets/Widgets/URL+WidgetSource.swift:8 — Widgets/Widgets/URL+WidgetSource.swift:8-13 | Widgets/Widgets/URL+WidgetSource.swift:21-25 — 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) WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift:51 — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift:51-55 | WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/WMFEditorToolbarNavigatorButton.swift:47-51 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift` and `WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/WMFEditorToolbarNavigatorButton.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 2 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. 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) Wikipedia/Code/DescriptionWelcomePageViewController.swift:187 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:187-191 | Wikipedia/Code/WMFWelcomePageViewController.swift:264-268 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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) REDACTED:227 — REDACTED:227-231 | REDACTED:364-368 — 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) Wikipedia/Code/TalkPageTopicReplyOnboardingHostingController.swift:46 — Wikipedia/Code/TalkPageTopicReplyOnboardingHostingController.swift:46-50 | Wikipedia/Code/VanishAccountWarningViewHostingViewController.swift:58-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) Wikipedia/Code/ArticleViewController+Editing.swift:359 — Wikipedia/Code/ArticleViewController+Editing.swift:359-363 | Wikipedia/Code/TalkPageViewController.swift:1442-1446 — 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) Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:121 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:121-125 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:140-144 — 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) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/Cards/WMFWhichCameFirstCardViewModel.swift:82 — WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/Cards/WMFWhichCameFirstCardViewModel.swift:82-86 | WMFData/Sources/WMFData/Models/Shared/WMFPageInterest.swift:13-17 — 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) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsViewController.swift:8 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsViewController.swift:8-12 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewController.swift:11-15 — 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 `viewModel` to `WMFHomeFeedWhatsDrivingSettingsViewModel` in one and `WMFHomeFeedInterestsSettingsViewModel` 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 (5 lines × 2) WMFData/Sources/WMFData/Data Controllers/Shared/WMFOnThisDayDataController.swift:183 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFOnThisDayDataController.swift:183-187 | WMFData/Sources/WMFData/Models/Shared/WMFPageTopic.swift:26-30 — 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) Widgets/Widgets/LockscreenSearchWidget.swift:65 — Widgets/Widgets/LockscreenSearchWidget.swift:65-69 | Widgets/Widgets/SearchWidget.swift:67-71 — 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 (Timeline<LockscreenSearchEntry>) -> Void` in one and `@escaping (Timeline<SearchEntry>) -> Void` 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 (5 lines × 2) Widgets/Widgets/OnThisDayWidget.swift:58 — Widgets/Widgets/OnThisDayWidget.swift:58-62 | Widgets/Widgets/TopReadWidget.swift:156-160 — 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 (OnThisDayEntry) -> Void` in one and `@escaping (TopReadEntry) -> Void` 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 (5 lines × 2) Wikipedia/Code/EditNoticesViewController.swift:21 — Wikipedia/Code/EditNoticesViewController.swift:21-25 | Wikipedia/Code/TalkPageCoffeeRollViewController.swift:24-28 — 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 `viewModel` to `EditNoticesViewModel` in one and `TalkPageCoffeeRollViewModel` 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 (5 lines × 2) Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:24 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:24-28 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:23-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 (5 lines × 2) WMF Framework/TimelineView.swift:274 — WMF Framework/TimelineView.swift:274-278 | WMF Framework/TimelineView.swift:280-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.
  • + 4 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×21
  • FileTooLong: Code/PlacesViewController.swift Wikipedia/Code/PlacesViewController.swift — FileTooLong — 1725 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: PlacesViewController (10-2404). The bar is 500 significant lines; this is 1225 over it, 3.45× 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: Code/WMFAppViewController.swift Wikipedia/Code/WMFAppViewController.swift — FileTooLong — 1532 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: WMFAppViewController (43-1824). The bar is 500 significant lines; this is 1032 over it, 3.06× 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: Code/ExploreViewController.swift Wikipedia/Code/ExploreViewController.swift — FileTooLong — 1196 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 696 over it, 2.39× 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: Code/ArticleViewController.swift Wikipedia/Code/ArticleViewController.swift — FileTooLong — 1025 significant lines (blank, comment-only and punctuation-only lines excluded), about 80% of them inside a single declaration: ArticleViewController (11-1444). The bar is 500 significant lines; this is 525 over it, 2.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Code/WMFAppViewController+Extensions.swift Wikipedia/Code/WMFAppViewController+Extensions.swift — FileTooLong — 912 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 412 over it, 1.82× 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: Code/DiffContainerViewController.swift Wikipedia/Code/DiffContainerViewController.swift — FileTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 362 over it, 1.72× 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: Code/TalkPageViewController.swift Wikipedia/Code/TalkPageViewController.swift — FileTooLong — 843 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: TalkPageViewController (12-971). The bar is 500 significant lines; this is 343 over it, 1.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: WMF Framework/ReadingListsSyncOperation.swift WMF Framework/ReadingListsSyncOperation.swift — FileTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ReadingListsSyncOperation (7-1096). The bar is 500 significant lines; this is 223 over it, 1.45× 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: Code/EditorViewController.swift Wikipedia/Code/EditorViewController.swift — FileTooLong — 715 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: EditorViewController (14-726). The bar is 500 significant lines; this is 215 over it, 1.43× 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: WMF Framework/Theme.swift WMF Framework/Theme.swift — FileTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: Colors (95-841). The bar is 500 significant lines; this is 208 over it, 1.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Code/DonateCoordinator.swift Wikipedia/Code/DonateCoordinator.swift — FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: DonateCoordinator (15-631). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Code/NotificationsCenterViewController.swift Wikipedia/Code/NotificationsCenterViewController.swift — FileTooLong — 640 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 140 over it, 1.28× 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: Code/PageHistoryViewController.swift Wikipedia/Code/PageHistoryViewController.swift — FileTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: PageHistoryViewController (21-826). The bar is 500 significant lines; this is 107 over it, 1.21× 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: Home/WMFForYouView.swift WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift — FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 93 over it, 1.19× 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: WMFNativeLocalizations/CommonStrings.swift WMFLocalizations/Sources/WMFNativeLocalizations/CommonStrings.swift — FileTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: CommonStrings (8-860). The bar is 500 significant lines; this is 88 over it, 1.18× 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: Code/ActivityTabViewController.swift Wikipedia/Code/ActivityTabViewController.swift — FileTooLong — 585 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: WMFActivityTabHostingController (10-800). The bar is 500 significant lines; this is 85 over it, 1.17× 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: Code/ReadingListsController.swift Wikipedia/Code/ReadingListsController.swift — FileTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 66 over it, 1.13× 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: Code/SettingsCoordinator.swift Wikipedia/Code/SettingsCoordinator.swift — FileTooLong — 553 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: SettingsCoordinator (13-863). The bar is 500 significant lines; this is 53 over it, 1.11× 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: Code/ExploreCardViewController.swift Wikipedia/Code/ExploreCardViewController.swift — FileTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: ExploreCardViewController (24-594). The bar is 500 significant lines; this is 46 over it, 1.09× 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: Article Tabs/WMFArticleTabsDataController.swift WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift — FileTooLong — 531 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 31 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Home/WMFHomeDataController.swift WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift — FileTooLong — 528 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 28 over it, 1.06× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×20
  • Duplicated block (8 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:47 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:47-54 | WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:92-99 — 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 `WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:47` 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) WMFComponents/Sources/WMFComponents/Components/Shared/Buttons/CloseButtons.swift:155 — WMFComponents/Sources/WMFComponents/Components/Shared/Buttons/CloseButtons.swift:155-162 | WMFComponents/Sources/WMFComponents/Components/Shared/Buttons/CloseButtons.swift:169-176 — 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 `WMFComponents/Sources/WMFComponents/Components/Shared/Buttons/CloseButtons.swift:155` 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) WMF Framework/ArticleCacheResourceDBWriting.swift:37 — WMF Framework/ArticleCacheResourceDBWriting.swift:37-44 | WMF Framework/ArticleCacheResourceDBWriting.swift:64-71 — 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 `WMF Framework/ArticleCacheResourceDBWriting.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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<[ArticleFetcher.MediaListItem], ArticleCacheDBWriterError>) -> Void` in one and `@escaping (Result<[URL], ArticleCacheDBWriterError>) -> Void` 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) WMF Framework/CacheDBWriterHelper.swift:81 — WMF Framework/CacheDBWriterHelper.swift:81-88 | WMF Framework/CacheDBWriterHelper.swift:92-99 — 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 (8 lines × 2) WMF Framework/PageNamespace.swift:78 — WMF Framework/PageNamespace.swift:78-85 | Wikipedia/Code/NotificationsCenterAction.swift:103-110 — 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 `WMF Framework/PageNamespace.swift:78` 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 (8 lines × 2) WMF Framework/Widget/WidgetController.swift:37 — WMF Framework/Widget/WidgetController.swift:37-44 | WMF Framework/Widget/WidgetController.swift:53-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 `WMF Framework/Widget/WidgetController.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.
  • Duplicated block (8 lines × 2) Wikipedia/Code/ActivityTabViewController.swift:869 — Wikipedia/Code/ActivityTabViewController.swift:869-876 | Wikipedia/Code/TabsOverviewCoordinator.swift:44-51 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ActivityTabViewController.swift:869` 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) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:65 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:65-72 | Wikipedia/Code/FeedCardSettingsViewController.swift:31-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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:65` 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) Wikipedia/Code/DiffContainerViewController.swift:1031 — Wikipedia/Code/DiffContainerViewController.swift:1031-1040 | Wikipedia/Code/PageHistoryViewController.swift:817-824 — 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 `Wikipedia/Code/DiffContainerViewController.swift:1031` 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) Wikipedia/Code/PageHistoryCountsView.swift:29 — Wikipedia/Code/PageHistoryCountsView.swift:29-36 | Wikipedia/Code/PageHistoryCountsViewController.swift:26-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.
  • Duplicated block (8 lines × 2) Wikipedia/Code/TalkPageFetcher.swift:190 — Wikipedia/Code/TalkPageFetcher.swift:190-197 | Wikipedia/Code/TalkPageFetcher.swift:213-220 — 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 `Wikipedia/Code/TalkPageFetcher.swift:190` 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) Wikipedia/Code/TalkPageFindInPageSearchController.swift:59 — Wikipedia/Code/TalkPageFindInPageSearchController.swift:59-66 | Wikipedia/Code/TalkPageFindInPageSearchController.swift:73-80 — 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 `Wikipedia/Code/TalkPageFindInPageSearchController.swift:59` 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) Wikipedia/Code/TalkPageViewController.swift:1205 — Wikipedia/Code/TalkPageViewController.swift:1205-1212 | Wikipedia/Code/TalkPageViewController.swift:1292-1299 — 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 `Wikipedia/Code/TalkPageViewController.swift:1205` 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) Wikipedia/Code/ActivityTabViewController.swift:717 — Wikipedia/Code/ActivityTabViewController.swift:717-724 | Wikipedia/Code/InsertMediaSettingsViewController.swift:372-379 — 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) Wikipedia/Code/Advanced Settings/InsertMediaCustomImageSizeSettingTableViewCell.swift:10 — Wikipedia/Code/Advanced Settings/InsertMediaCustomImageSizeSettingTableViewCell.swift:10-17 | Wikipedia/Code/InsertMediaSettingsTextTableViewCell.swift:25-32 — 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) Wikipedia/Code/TalkPageTopicReplyOnboardingView.swift:41 — Wikipedia/Code/TalkPageTopicReplyOnboardingView.swift:41-48 | Wikipedia/Code/VanishAccountWarningView.swift:41-48 — 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, `Wikipedia/Code/VanishAccountWarningView.swift:52` calls `replacingOccurrences` and `Wikipedia/Code/TalkPageTopicReplyOnboardingView.swift:50` 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 (8 lines × 2) Wikipedia/Code/WMFAccountCreator.swift:10 — Wikipedia/Code/WMFAccountCreator.swift:10-17 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:10-17 — 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) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift:54 — WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift:54-61 | WMFComponents/Sources/WMFComponents/Components/Home/WMFHomeView.swift:24-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 (8 lines × 2) Wikipedia/Code/DescriptionWelcomeInitialViewController.swift:16 — Wikipedia/Code/DescriptionWelcomeInitialViewController.swift:16-23 | Wikipedia/Code/WMFWelcomeInitialViewController.swift:10-17 — 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) Wikipedia/Code/WMFChangePasswordViewController.swift:59 — Wikipedia/Code/WMFChangePasswordViewController.swift:59-66 | Wikipedia/Code/WMFForgotPasswordViewController.swift:62-69 — 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 (7 lines × 2) · ×20
  • Duplicated block (7 lines × 2) WMF Framework/Fetcher.swift:110 — WMF Framework/Fetcher.swift:110-116 | WMF Framework/Fetcher.swift:123-129 — 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 `WMF Framework/Fetcher.swift:110` 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 × 2) WMF Framework/ReadingListsSyncOperation.swift:556 — WMF Framework/ReadingListsSyncOperation.swift:556-562 | WMF Framework/ReadingListsSyncOperation.swift:690-696 — 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 `WMF Framework/ReadingListsSyncOperation.swift:556` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (7 lines × 2) Widgets/Widgets/FeaturedArticleWidget.swift:82 — Widgets/Widgets/FeaturedArticleWidget.swift:82-88 | Widgets/Widgets/FeaturedArticleWidget.swift:98-104 — 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 `Widgets/Widgets/FeaturedArticleWidget.swift:82` 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) Wikipedia/Code/AppOnboardingCoordinator.swift:244 — Wikipedia/Code/AppOnboardingCoordinator.swift:244-250 | Wikipedia/Code/AppOnboardingCoordinator.swift:260-266 — 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 `Wikipedia/Code/AppOnboardingCoordinator.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 (7 lines × 2) Wikipedia/Code/ArticleFetcher.swift:182 — Wikipedia/Code/ArticleFetcher.swift:182-188 | Wikipedia/Code/ArticleFetcher.swift:251-257 — 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) Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:56 — Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:56-62 | Wikipedia/Code/SavedArticlesCollectionViewCell.swift:158-164 — 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 `Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:56` 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) Wikipedia/Code/DiffContainerViewController.swift:1001 — Wikipedia/Code/DiffContainerViewController.swift:1001-1007 | Wikipedia/Code/UIViewController+Extensions.swift:98-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 `Wikipedia/Code/DiffContainerViewController.swift:1001` 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) Wikipedia/Code/EditNoticesFetcher.swift:31 — Wikipedia/Code/EditNoticesFetcher.swift:31-37 | Wikipedia/Code/WMFAccountCreator.swift:140-150 — 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 `Wikipedia/Code/EditNoticesFetcher.swift:31` 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 (7 lines × 2) Wikipedia/Code/AppViewControllerTipWrapper.swift:20 — Wikipedia/Code/AppViewControllerTipWrapper.swift:20-26 | Wikipedia/Code/WMFAppViewControllerTipWrapper.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. 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) Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift:19 — Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift:19-25 | Wikipedia/Code/ColumnarCollectionViewController.swift:546-552 — 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) Wikipedia/Code/DescriptionWelcomeInitialViewController.swift:7 — Wikipedia/Code/DescriptionWelcomeInitialViewController.swift:7-13 | Wikipedia/Code/EmptyViewController.swift:30-39 — 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) Wikipedia/Code/NotificationsCenterViewController.swift:982 — Wikipedia/Code/NotificationsCenterViewController.swift:982-988 | Wikipedia/Code/TalkPageViewController.swift:535-541 — 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 `Wikipedia/Code/TalkPageViewController.swift:535` 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 × 2) Wikipedia/Code/PageHistoryCountsView.swift:39 — Wikipedia/Code/PageHistoryCountsView.swift:39-45 | Wikipedia/Code/PageHistoryCountsViewController.swift:36-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 (7 lines × 2) REDACTED:546 — REDACTED:546-552 | REDACTED:551-557 — 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) Wikipedia/Code/TalkPageCellCommentView.swift:176 — Wikipedia/Code/TalkPageCellCommentView.swift:176-182 | Wikipedia/Code/TalkPageCellTopicView.swift:440-446 — 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) REDACTED:280 — REDACTED:280-287 | REDACTED:197-203 — 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) REDACTED:328 — REDACTED:328-334 | REDACTED:161-167 — 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) Wikipedia/Code/ArticleViewController.swift:960 — Wikipedia/Code/ArticleViewController.swift:960-966 | Wikipedia/Code/SinglePageWebViewController.swift:289-295 — 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) Wikipedia/Code/InsertMediaSettingsImageView.swift:47 — Wikipedia/Code/InsertMediaSettingsImageView.swift:47-53 | Wikipedia/Code/InsertMediaSettingsTextTableViewCell.swift:64-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.
  • Duplicated block (7 lines × 2) Widgets/Widgets/RandomWidget.swift:16 — Widgets/Widgets/RandomWidget.swift:16-22 | Widgets/Widgets/RandomWidget.swift:24-30 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · ClassTooLong · ×18
  • ClassTooLong: PlacesViewController Wikipedia/Code/PlacesViewController.swift:9 — ClassTooLong — 1575 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 1175 over it, 3.94× 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: WMFAppViewController Wikipedia/Code/WMFAppViewController.swift:43 — ClassTooLong — 1152 significant lines (blank, comment-only and punctuation-only lines excluded), 188 methods. The bar is 400 significant lines; this is 752 over it, 2.88× 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: ArticleViewController Wikipedia/Code/ArticleViewController.swift:10 — ClassTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded), 250 methods. The bar is 400 significant lines; this is 424 over it, 2.06× 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: ReadingListsSyncOperation WMF Framework/ReadingListsSyncOperation.swift:7 — ClassTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded), 13 methods. The bar is 400 significant lines; this is 320 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ExploreViewController Wikipedia/Code/ExploreViewController.swift:9 — ClassTooLong — 646 significant lines (blank, comment-only and punctuation-only lines excluded), 147 methods. The bar is 400 significant lines; this is 246 over it, 1.62× 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: PageHistoryViewController Wikipedia/Code/PageHistoryViewController.swift:20 — ClassTooLong — 542 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 142 over it, 1.36× 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: TalkPageViewController Wikipedia/Code/TalkPageViewController.swift:12 — ClassTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 98 methods. The bar is 400 significant lines; this is 140 over it, 1.35× 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: CommonStrings WMFLocalizations/Sources/WMFNativeLocalizations/CommonStrings.swift:7 — ClassTooLong — 525 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 125 over it, 1.31× 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: Colors WMF Framework/Theme.swift:94 — ClassTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 124 over it, 1.31× 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: SettingsCoordinator Wikipedia/Code/SettingsCoordinator.swift:12 — ClassTooLong — 522 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 122 over it, 1.31× 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: WMFActivityTabHostingController Wikipedia/Code/ActivityTabViewController.swift:10 — ClassTooLong — 491 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 91 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.
  • ClassTooLong: EditorViewController Wikipedia/Code/EditorViewController.swift:14 — ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 400 significant lines; this is 74 over it, 1.19× 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: EditSaveViewController Wikipedia/Code/EditSaveViewController.swift:50 — ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 63 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: HtmlUtils WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:5 — ClassTooLong — 431 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 31 over it, 1.08× 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: WMFSFSymbolIcon WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:55 — ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 29 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DonateCoordinator Wikipedia/Code/DonateCoordinator.swift:15 — ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 15 over it, 1.04× 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: WMFAccountCreationViewController REDACTED:9 — ClassTooLong — 408 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 8 over it, 1.02× 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: WMFActivityTabView WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:6 — ClassTooLong — 402 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 2 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×14
  • Hotspot: Wikipedia/Code/DonateCoordinator.swift Wikipedia/Code/DonateCoordinator.swift:226 — Wikipedia/Code/DonateCoordinator.swift changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in DonateCoordinator.presentActionSheet at line 226. 1 of those changes was a fix/bug commit, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/DonateCoordinator.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: WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:203 — WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 137 in WMFSFSymbolIcon.`for` at line 203. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFComponents/Sources/WMFComponents/Style/WMFIcon.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: Wikipedia/Code/ArticleViewController.swift Wikipedia/Code/ArticleViewController.swift:14 — Wikipedia/Code/ArticleViewController.swift changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded at line 14. 3 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/ArticleViewController.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: Wikipedia/Code/HomeCoordinator.swift Wikipedia/Code/HomeCoordinator.swift:53 — Wikipedia/Code/HomeCoordinator.swift changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in HomeCoordinator.makeHomeViewController at line 53. 3 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/HomeCoordinator.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: Wikipedia/Code/AppOnboardingCoordinator.swift Wikipedia/Code/AppOnboardingCoordinator.swift:33 — Wikipedia/Code/AppOnboardingCoordinator.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in AppOnboardingCoordinator.start at line 33. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/AppOnboardingCoordinator.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: Wikipedia/Code/SettingsCoordinator.swift Wikipedia/Code/SettingsCoordinator.swift:139 — Wikipedia/Code/SettingsCoordinator.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SettingsCoordinator.handleSettingsAction at line 139. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/SettingsCoordinator.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: WMF Framework/Widget/WidgetController.swift WMF Framework/Widget/WidgetController.swift:370 — WMF Framework/Widget/WidgetController.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in WidgetController.fetchTopReadContent at line 370. 2 of those changes were fix/bug commits, 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-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMF Framework/Widget/WidgetController.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: WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:80 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WMFActivityTabView.loggedInList at line 80. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.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: WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift:117 — WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in WMFExperimentsDataController.determineBucketForExperiment at line 117. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.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: WMFData/Sources/WMFData/Service/WMFBasicService.swift WMFData/Sources/WMFData/Service/WMFBasicService.swift:59 — WMFData/Sources/WMFData/Service/WMFBasicService.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in WMFBasicService.performPOST at line 59. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFData/Sources/WMFData/Service/WMFBasicService.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: WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift:39 — WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in WMFCommunityFeedView.feedList at line 39. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.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: Wikipedia/Code/ArticlePeekPreviewViewController.swift Wikipedia/Code/ArticlePeekPreviewViewController.swift:115 — Wikipedia/Code/ArticlePeekPreviewViewController.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in ArticlePeekPreviewViewController.contextMenuItems at line 115. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- Wikipedia/Code/ArticlePeekPreviewViewController.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: WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.swift WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.swift:102 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in WMFArticleDataController.fetchArticleInfo at line 102. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.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: WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.swift WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.swift:49 — WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.swift changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in WMFSurveyView.body at line 49. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 17:30:08 -03:00' --until='2026-09-30 17:30:08 -03:00' --full-history --no-merges -- WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.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.
D8 · Code Coverage · Low coverage · ×14
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift — 0.0% line coverage (0/6).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/AgentData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/AgentData.swift — 0.0% line coverage (0/12).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/ClientData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/ClientData.swift — 0.0% line coverage (0/5).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/ExperimentData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/ExperimentData.swift — 0.0% line coverage (0/5).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/InteractionData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/InteractionData.swift — 0.0% line coverage (0/11).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/MediawikiData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/MediawikiData.swift — 0.0% line coverage (0/3).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/PageData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/PageData.swift — 0.0% line coverage (0/9).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/PerformerData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/PerformerData.swift — 0.0% line coverage (0/28).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/ContextController.swift WMFTestKitchen/Sources/WMFTestKitchen/ContextController.swift — 0.0% line coverage (0/51).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Error+Extension.swift WMFTestKitchen/Sources/WMFTestKitchen/Error+Extension.swift — 0.0% line coverage (0/14).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Event/Event.swift WMFTestKitchen/Sources/WMFTestKitchen/Event/Event.swift — 0.0% line coverage (0/37).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Instrument/Funnel.swift WMFTestKitchen/Sources/WMFTestKitchen/Instrument/Funnel.swift — 0.0% line coverage (0/34).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Instrument/InstrumentImpl.swift WMFTestKitchen/Sources/WMFTestKitchen/Instrument/InstrumentImpl.swift — 0.0% line coverage (0/54).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/TestKitchenClient.swift WMFTestKitchen/Sources/WMFTestKitchen/TestKitchenClient.swift — 0.0% line coverage (0/42).
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×12
  • Duplicated block (11 lines × 2) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64 — WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64-74 | WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:97-107 — 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64` 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 (11 lines × 2) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:437 — WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:437-447 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:489-499 — 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 `WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:437` 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) Widgets/Widgets/FeaturedArticleWidget.swift:298 — Widgets/Widgets/FeaturedArticleWidget.swift:298-308 | Widgets/Widgets/PictureOfTheDayWidget.swift:263-273 — 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) Wikipedia/Code/DonateCoordinator.swift:894 — Wikipedia/Code/DonateCoordinator.swift:894-904 | Wikipedia/Code/DonateCoordinator.swift:1019-1029 — 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 `Wikipedia/Code/DonateCoordinator.swift:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) Wikipedia/Code/SavedArticlesFetcher.swift:182 — Wikipedia/Code/SavedArticlesFetcher.swift:182-192 | Wikipedia/Code/SavedArticlesFetcher.swift:230-240 — 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 `Wikipedia/Code/SavedArticlesFetcher.swift:182` 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) Wikipedia/Code/ShareActivityController.swift:178 — Wikipedia/Code/ShareActivityController.swift:178-188 | Wikipedia/Code/ShareActivityController.swift:196-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232-242 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:259-269 — 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 `Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232` 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) WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:109 — WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:109-119 | WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:149-159 — 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 `WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.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. 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) Wikipedia/Code/ArticleViewController+ArticleToolbarHandling.swift:16 — Wikipedia/Code/ArticleViewController+ArticleToolbarHandling.swift:16-26 | Wikipedia/Code/ArticleViewController+ArticleToolbarHandling.swift:30-40 — 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) Wikipedia/Code/TalkPageViewController+FindInPage.swift:79 — Wikipedia/Code/TalkPageViewController+FindInPage.swift:79-89 | Wikipedia/Code/TalkPageViewController+FindInPage.swift:92-102 — 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) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewSaveCountSlideDataController.swift:38 — WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewSaveCountSlideDataController.swift:38-48 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewEditCountSlideDataController.swift:43-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 both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) Wikipedia/Code/TalkPageReplyComposeContentView.swift:349 — Wikipedia/Code/TalkPageReplyComposeContentView.swift:349-359 | Wikipedia/Code/TalkPageTopicComposeViewController.swift:250-260 — 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 (9 lines × 2) · ×12
  • Duplicated block (9 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/WMFActivityTabCustomizeViewModel.swift:103 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/WMFActivityTabCustomizeViewModel.swift:103-111 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsViewModel.swift:16-24 — 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) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:432 — WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:432-440 | WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:497-505 — 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) Wikipedia/Code/APIURLComponentsBuilder.swift:79 — Wikipedia/Code/APIURLComponentsBuilder.swift:79-87 | Wikipedia/Code/APIURLComponentsBuilder.swift:91-99 — 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 (9 lines × 2) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:42 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:42-50 | Wikipedia/Code/FeedCardSettingsViewController.swift:6-14 — 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 `Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:42` 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 (9 lines × 2) Wikipedia/Code/DiffFetcher.swift:50 — Wikipedia/Code/DiffFetcher.swift:50-58 | Wikipedia/Code/GlobalUserInfoFetcher.swift:16-27 — before extracting anything, compare `Wikipedia/Code/DiffFetcher.swift` and `Wikipedia/Code/GlobalUserInfoFetcher.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `Wikipedia/Code/DiffFetcher.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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<String, Error>) -> Void` in one and `@escaping ((Result<Int, Error>) -> Void)` 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) Wikipedia/Code/DiffHeaderExtendedView.swift:34 — Wikipedia/Code/DiffHeaderExtendedView.swift:34-42 | Wikipedia/Code/DiffHeaderView.swift:20-28 — 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) Wikipedia/Code/PageHistoryViewController.swift:191 — Wikipedia/Code/PageHistoryViewController.swift:191-199 | Wikipedia/Code/PageHistoryViewController.swift:229-237 — 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 `Wikipedia/Code/PageHistoryViewController.swift:191` 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) Wikipedia/Code/SavedAllArticlesCoordinator.swift:198 — Wikipedia/Code/SavedAllArticlesCoordinator.swift:198-208 | Wikipedia/Code/WhichCameFirstCoordinator.swift:375-383 — 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 `Wikipedia/Code/SavedAllArticlesCoordinator.swift:198` 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) Wikipedia/Code/SavedArticlesFetcher.swift:205 — Wikipedia/Code/SavedArticlesFetcher.swift:205-213 | Wikipedia/Code/SavedArticlesFetcher.swift:257-265 — 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 `Wikipedia/Code/SavedArticlesFetcher.swift:205` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 2) Wikipedia/Code/AppearanceSettingsViewController.swift:374 — Wikipedia/Code/AppearanceSettingsViewController.swift:374-382 | Wikipedia/Code/Temp Accounts/TempAccountsSettingsViewController.swift:90-98 — 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) Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:313 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:313-321 | Wikipedia/Code/Temp Accounts/TempAccountsSettingsViewController.swift:144-152 — 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) Wikipedia/Code/ColumnarCollectionViewController.swift:229 — Wikipedia/Code/ColumnarCollectionViewController.swift:229-237 | Wikipedia/Code/InsertMediaSearchResultsCollectionViewController.swift:184-192 — 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.
D10 · Test Quality · No assertions · ×11
  • No assertions: successDoesNotCallHTTPErrorLogger WMFData/Tests/WMFDataTests/WMFBasicServiceHTTPErrorLoggerTests.swift:50 — 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: donateSubmitPayment WMFData/Tests/WMFDataTests/WMFDonateDataControllerTests.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: testFetchFeedSucceeds WMFData/Tests/WMFDataTests/WMFFeedDataControllerTests.swift:25 — 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: testFetchCommunitySucceeds WMFData/Tests/WMFDataTests/WMFHomeDataControllerTests.swift:348 — 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: fetchImageInfoReturnsUnexpectedResponseWhenNoPages WMFData/Tests/WMFDataTests/WMFImageDataControllerTests.swift:161 — 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: fetchImageInfoFailsWhenMediaWikiServiceUnavailable WMFData/Tests/WMFDataTests/WMFImageDataControllerTests.swift:177 — 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: fetchThrowsUnexpectedResponseWhenDataIsNil WMFData/Tests/WMFDataTests/WMFUserImpactDataControllerTests.swift:20 — 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: fetchWrapsServiceFailureAsServiceError WMFData/Tests/WMFDataTests/WMFUserImpactDataControllerTests.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: postWatchArticleExpiryNever WMFData/Tests/WMFDataTests/WMFWatchlistDataControllerTests.swift:212 — 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: postWatchArticleExpiryDate WMFData/Tests/WMFDataTests/WMFWatchlistDataControllerTests.swift:221 — 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: postUnwatchArticle WMFData/Tests/WMFDataTests/WMFWatchlistDataControllerTests.swift:230 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×11
  • Duplicated block (10 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsView.swift:318 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsView.swift:318-327 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsView.swift:343-352 — 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsView.swift:318` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) WMF Framework/ArticleCacheDBWriter+SyncResources.swift:215 — WMF Framework/ArticleCacheDBWriter+SyncResources.swift:215-224 | WMF Framework/ArticleCacheResourceDBWriting.swift:82-91 — 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 `WMF Framework/ArticleCacheDBWriter+SyncResources.swift:215` 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) WMF Framework/ImageCacheDBWriter.swift:44 — WMF Framework/ImageCacheDBWriter.swift:44-53 | Wikipedia/Code/ArticleCacheDBWriter.swift:119-128 — 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 `WMF Framework/ImageCacheDBWriter.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.
  • Duplicated block (10 lines × 2) Widgets/Widgets/OnThisDayWidget.swift:47 — Widgets/Widgets/OnThisDayWidget.swift:47-56 | Widgets/Widgets/PictureOfTheDayWidget.swift:155-164 — 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 `Widgets/Widgets/OnThisDayWidget.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Timeline<OnThisDayEntry>) -> Void` in one and `@escaping (Timeline<PictureOfTheDayEntry>) -> Void` 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) Wikipedia/Code/ArticleCollectionViewController.swift:138 — Wikipedia/Code/ArticleCollectionViewController.swift:138-147 | REDACTED:459-468 — 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) Wikipedia/Code/HomeFeedSettingsCoordinator.swift:90 — Wikipedia/Code/HomeFeedSettingsCoordinator.swift:90-99 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:175-184 — 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 `Wikipedia/Code/HomeFeedSettingsCoordinator.swift:90` 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) Wikipedia/Code/ScrollableEducationPanelViewController.swift:339 — Wikipedia/Code/ScrollableEducationPanelViewController.swift:339-348 | Wikipedia/Code/ScrollableEducationPanelViewController.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.
  • Duplicated block (10 lines × 2) Wikipedia/Code/UIViewController+Extensions.swift:193 — Wikipedia/Code/UIViewController+Extensions.swift:193-202 | Wikipedia/Code/UIViewController+Extensions.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 `Wikipedia/Code/UIViewController+Extensions.swift:193` 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) Wikipedia/Code/ViewControllerRouter.swift:130 — Wikipedia/Code/ViewControllerRouter.swift:130-139 | Wikipedia/Code/ViewControllerRouter.swift:143-152 — 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 `Wikipedia/Code/ViewControllerRouter.swift:130` 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 (10 lines × 2) Wikipedia/Code/WMFAuthenticationManager.swift:293 — Wikipedia/Code/WMFAuthenticationManager.swift:293-302 | Wikipedia/Code/WMFAuthenticationManager.swift:364-373 — 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 `Wikipedia/Code/WMFAuthenticationManager.swift:293` 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, `Wikipedia/Code/WMFAuthenticationManager.swift:375` calls `submitInteraction` and `Wikipedia/Code/WMFAuthenticationManager.swift:303` 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 × 2) Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:110 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:110-119 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:129-138 — 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 (14 lines × 2) · ×9
  • Duplicated block (14 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift:79 — WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift:79-92 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:29-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) WMF Framework/WMFArticle+Migration.swift:21 — WMF Framework/WMFArticle+Migration.swift:21-34 | WMF Framework/WMFArticle+Migration.swift:37-50 — 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) Wikipedia/Code/ArticlePlaceView.swift:261 — Wikipedia/Code/ArticlePlaceView.swift:261-274 | Wikipedia/Code/ArticlePlaceView.swift:488-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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ArticlePlaceView.swift:261` 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) Wikipedia/Code/DescriptionWelcomePageViewController.swift:34 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:34-47 | Wikipedia/Code/WMFWelcomePageViewController.swift:32-45 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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) Wikipedia/Code/ScrollViewGradientView.swift:39 — Wikipedia/Code/ScrollViewGradientView.swift:39-52 | Wikipedia/Code/WMFImageGalleryGradientViews.swift:35-48 — 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) REDACTED:157 — REDACTED:157-170 | REDACTED:445-458 — 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 `REDACTED:157` 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) WMF Framework/MWKDataStore+LegacyPageViews.swift:26 — WMF Framework/MWKDataStore+LegacyPageViews.swift:26-39 | WMF Framework/MWKDataStore+LegacyPageViews.swift:72-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 `WMF Framework/MWKDataStore+LegacyPageViews.swift:26` 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) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:90 — Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:90-103 | Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:216-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:90` 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, `Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:105` calls `titleAction` and `Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:231` 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) WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:242 — WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:242-255 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:259-272 — 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 (12 lines × 2) · ×9
  • Duplicated block (12 lines × 2) WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift:36 — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift:36-47 | WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/WMFEditorToolbarNavigatorButton.swift:32-43 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.swift` and `WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/WMFEditorToolbarNavigatorButton.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 2 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 `WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Base/WMFEditorToolbarButton.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 (12 lines × 2) WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRow.swift:66 — WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRow.swift:66-77 | WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRow.swift:136-147 — 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) Wikipedia/Code/DescriptionWelcomePageViewController.swift:193 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:193-204 | Wikipedia/Code/WMFWelcomePageViewController.swift:270-281 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 (12 lines × 2) Wikipedia/Code/DiffFetcher.swift:198 — Wikipedia/Code/DiffFetcher.swift:198-209 | Wikipedia/Code/DiffFetcher.swift:242-253 — 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 `Wikipedia/Code/DiffFetcher.swift:198` 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 `@escaping (Result<WMFPageHistoryRevision, Error>) -> Void` in one and `@escaping (Result<String, Error>) -> Void` 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 (12 lines × 2) Wikipedia/Code/ExploreViewController.swift:138 — Wikipedia/Code/ExploreViewController.swift:138-149 | Wikipedia/Code/SavedViewController.swift:266-277 — 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 `Wikipedia/Code/ExploreViewController.swift:138` 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 (12 lines × 2) Wikipedia/Code/SizeThatFitsReusableView.swift:67 — Wikipedia/Code/SizeThatFitsReusableView.swift:67-78 | Wikipedia/Code/SizeThatFitsView.swift:35-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 (12 lines × 2) REDACTED:134 — REDACTED:134-145 | REDACTED:114-125 — 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 `REDACTED:134` 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) Wikipedia/Code/WatchlistController.swift:49 — Wikipedia/Code/WatchlistController.swift:49-60 | Wikipedia/Code/WatchlistController.swift:229-240 — 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 `Wikipedia/Code/WatchlistController.swift:49` 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) WMFData/Sources/WMFData/Extensions/URL+API.swift:81 — WMFData/Sources/WMFData/Extensions/URL+API.swift:81-92 | WMFData/Sources/WMFData/Extensions/URL+API.swift:96-107 — 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.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: WMFCommunityFeedView.swift ↔ WMFHomeViewModel.swift WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift — `WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift` and `WMFComponents/Sources/WMFComponents/Components/Home/WMFHomeViewModel.swift` change together 73% of the time (8 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 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 `5321204f` Allow scrolling to top when tapping the tab button or W button, add a…; `708aac2d` Hide community card implementation; `35333002` Hide community module implementation — run `git show` on any of them.
  • Change coupling: ArticleViewController+ArticlePreviewing.swift ↔ ColumnarCollectionViewController.swift Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift — `Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift` and `Wikipedia/Code/ColumnarCollectionViewController.swift` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in 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 9 shared commits counted here, the most recent 3 are `b842cfd1` Move text view delegate to tabs coordinator; `aee58be7` Add link delegate to tabsOverviewCoordinator dor did you know; `5ffeb101` Add sourceRect and sourceView to shareActivityController popover when… — run `git show` on any of them.
  • Change coupling: ArticleViewController+ArticlePreviewing.swift ↔ ExploreCardViewController.swift Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift — `Wikipedia/Code/ArticleViewController+ArticlePreviewing.swift` and `Wikipedia/Code/ExploreCardViewController.swift` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in 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 `b842cfd1` Move text view delegate to tabs coordinator; `aee58be7` Add link delegate to tabsOverviewCoordinator dor did you know; `5ffeb101` Add sourceRect and sourceView to shareActivityController popover when… — run `git show` on any of them.
  • Change coupling: WMFUserDefaultsKey.swift ↔ WMFMockDeveloperSettingsDataController.swift WMFData/Sources/WMFData/Store/WMFUserDefaultsKey.swift — `WMFData/Sources/WMFData/Store/WMFUserDefaultsKey.swift` and `WMFData/Sources/WMFDataMocks/WMFMockDeveloperSettingsDataController.swift` change together 60% of the time (21 of the 35 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 21 shared commits counted here, the most recent 3 are `ad82e504` Start dev settings; `10687bcc` Combine dev settings; `e9512d60` Developer settings (to be merged with others), show old yir — run `git show` on any of them.
  • Change coupling: WMFSavedAllArticlesViewModel.swift ↔ WMFAsyncPageRowSaved.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift — `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift` and `WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFAsyncPageRowSaved.swift` change together 57% of the time (12 of the 21 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 `9ca84168` Add missing Saved All Articles events; `46eccea2` Add reading list tag tap, remove Saved tag display (at that commit the files were still `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAllArticlesViewModel.swift` and `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAsyncPageRowSaved.swift`); `f64e574d` Add retry logic for API error (at that commit the files were still `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAllArticlesViewModel.swift` and `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFAsyncPageRowSaved.swift`) — run `git show` on any of them.
  • Change coupling: TimelineViewModel.swift ↔ WMFActivityTabView.swift WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift — `WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift` and `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift` change together 55% of the time (11 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 11 shared commits counted here, the most recent 3 are `1470f7ca` Clean up; `03c78cd6` Deep link diff; `3ce2fc5e` UserContributions fetch edits — run `git show` on any of them.
  • Change coupling: WMFArticleTabsDataController.swift ↔ WMFCategoriesDataController.swift WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift — `WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFCategoriesDataController.swift` change together 55% of the time (6 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 6 shared commits counted here, the most recent 3 are `85b3ba4a` Swift 6 (WMFData): replace legacy NSMergePolicy global vars; `9a38212a` Fix iOS 17+ deprecations and Sendable warnings; `eda77d8a` Cleanup WMFProject identifiers — run `git show` on any of them.
  • Change coupling: RandomArticleCoordinator.swift ↔ TabsOverviewCoordinator.swift Wikipedia/Code/RandomArticleCoordinator.swift — `Wikipedia/Code/RandomArticleCoordinator.swift` and `Wikipedia/Code/TabsOverviewCoordinator.swift` change together 50% of the time (6 of the 12 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 6 shared commits counted here, the most recent 3 are `152a810e` Move did you know provider to coordinator; `b842cfd1` Move text view delegate to tabs coordinator; `f640b632` Add did you know provider closure call to expore feed, history, artic… — run `git show` on any of them.
D10 · Test Quality · Skipped test · ×6
  • Skipped test: testArticleNonLeadImageCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:108 — Skipped — throws XCTSkip
  • Skipped test: testArticleLinkLongPressShowsPreviewAndMenuItems WikipediaUITests/ArticleControlsUITests.swift:120 — Skipped — throws XCTSkip
  • Skipped test: testQuickFactsArticleLinkLongPressShowsPreviewAndMenuItems WikipediaUITests/ArticleControlsUITests.swift:131 — Skipped — throws XCTSkip
  • Skipped test: testArticleTableItemsCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:154 — Skipped — throws XCTSkip
  • Skipped test: testBohemiaLeadImageOpensImageGalleryAndCanShare WikipediaUITests/ArticleImageGalleryUITests.swift:4 — Skipped — throws XCTSkip
  • Skipped test: testHostingItemPrefersTheVerticalBarOnIPhoneDuo WMFComponents/Tests/WMFComponentsTests/WMFBarButtonHostingViewTests.swift:64 — Skipped — throws XCTSkip
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:130 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:130-144 | WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:185-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 `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:130` 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, `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:128` calls `padding` and `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:183` 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 (15 lines × 2) WMF Framework/PageNamespace.swift:59 — WMF Framework/PageNamespace.swift:59-73 | Wikipedia/Code/NotificationsCenterAction.swift:72-86 — 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 `WMF Framework/PageNamespace.swift:59` 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 (15 lines × 2) Wikipedia/Code/NewsViewController.swift:257 — Wikipedia/Code/NewsViewController.swift:257-271 | Wikipedia/Code/OnThisDayViewController.swift:262-276 — 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 (15 lines × 2) WMF Framework/WMFBlocksKit.swift:33 — WMF Framework/WMFBlocksKit.swift:33-47 | WMF Framework/WMFBlocksKit.swift:85-99 — 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 `WMF Framework/WMFBlocksKit.swift:33` 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) WMF Framework/SetupButton.swift:6 — WMF Framework/SetupButton.swift:6-20 | WMF Framework/SetupView.swift:6-20 — before extracting anything, compare `WMF Framework/SetupButton.swift` and `WMF Framework/SetupView.swift` as WHOLE FILES: 83% 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) Wikipedia/Code/ArticleViewController.swift:114 — Wikipedia/Code/ArticleViewController.swift:114-128 | Wikipedia/Code/PlacesViewController.swift:419-433 — 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 (8 lines × 3) · ×6
  • Duplicated block (8 lines × 3) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64 — WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64-72 | WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:97-105 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFCategoriesDataController.swift:24-31 — 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64` 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 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 × 3) WMF Framework/SharedContainerCacheStore.swift:15 — WMF Framework/SharedContainerCacheStore.swift:15-22 | WMF Framework/SharedContainerCacheStore.swift:29-36 | WMF Framework/SharedContainerCacheStore.swift:41-48 — 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 (8 lines × 3) Wikipedia/Code/DiffListChangeViewModel.swift:240 — Wikipedia/Code/DiffListChangeViewModel.swift:240-247 | Wikipedia/Code/DiffListContextViewModel.swift:167-174 | Wikipedia/Code/DiffListUneditedViewModel.swift:45-52 — 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 (8 lines × 3) Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:61 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:61-68 | Wikipedia/Code/Advanced Settings/InsertMediaImageSizeSettingsViewController.swift:101-108 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:76-83 — 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 (8 lines × 3) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsViewModel.swift:15 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsViewModel.swift:15-22 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsViewModel.swift:16-23 | WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewModel.swift:52-59 — 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) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:147 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:147-154 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:83-90 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:129-136 — before extracting anything, compare `WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift` and `WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
  • Members sharing a duplicated core (4 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:327 — WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:327-364 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:368-405 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:409-448 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:452-505 — 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) Wikipedia/Code/ArticleLocationCollectionViewController.swift:217 — Wikipedia/Code/ArticleLocationCollectionViewController.swift:217-231 | Wikipedia/Code/ColumnarCollectionViewController.swift:506-520 | Wikipedia/Code/NewsViewController.swift:257-271 | Wikipedia/Code/OnThisDayViewController.swift:262-276 — 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) Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:22 — Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:22-49 | Wikipedia/Code/WMFAuthLoginInfoFetcher.swift:22-50 | Wikipedia/Code/WMFCaptchaResetter.swift:21-44 | Wikipedia/Code/WMFCurrentUserFetcher.swift:58-100 — 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) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:171 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:171-186 | WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:188-203 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:108-123 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:153-168 — 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) WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:7 — WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:7-16 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:18-27 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:59-71 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:97-106 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×5
  • Duplicated block (10 lines × 3) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:128 — WMF Framework/Remote Notifications/RemoteNotificationsController.swift:128-137 | WMF Framework/Remote Notifications/RemoteNotificationsController.swift:178-187 | WMF Framework/Remote Notifications/RemoteNotificationsController.swift:196-205 — 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 (10 lines × 3) Wikipedia/Code/ActivityTabViewController.swift:112 — Wikipedia/Code/ActivityTabViewController.swift:112-121 | Wikipedia/Code/PlacesViewController.swift:201-211 | Wikipedia/Code/SearchViewController.swift:368-377 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ActivityTabViewController.swift:112` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 3) Wikipedia/Code/DiffFetcher.swift:201 — Wikipedia/Code/DiffFetcher.swift:201-210 | Wikipedia/Code/DiffFetcher.swift:245-254 | Wikipedia/Code/GlobalUserInfoFetcher.swift:18-28 — before extracting anything, compare `Wikipedia/Code/DiffFetcher.swift` and `Wikipedia/Code/GlobalUserInfoFetcher.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `Wikipedia/Code/DiffFetcher.swift:201` 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 `@escaping (Result<WMFPageHistoryRevision, Error>) -> Void` in one and `@escaping (Result<String, Error>) -> Void` 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 × 3) Wikipedia/Code/TalkPageFetcher.swift:128 — Wikipedia/Code/TalkPageFetcher.swift:128-137 | Wikipedia/Code/TalkPageFetcher.swift:164-173 | Wikipedia/Code/TalkPageFetcher.swift:233-242 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<Bool, Error>) -> Void` in one and `@escaping (Result<[String], Error>) -> Void` 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 × 3) Wikipedia/Code/Advanced Settings/InsertMediaAdvancedSettingsViewController.swift:114 — Wikipedia/Code/Advanced Settings/InsertMediaAdvancedSettingsViewController.swift:114-123 | Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:72-81 | Wikipedia/Code/Advanced Settings/InsertMediaImageSizeSettingsViewController.swift:112-121 — 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 (9 lines × 3) · ×5
  • Duplicated block (9 lines × 3) WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:50 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:50-58 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:69-77 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRelatedPagesDataController.swift:74-82 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:49` calls `String` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:68` 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 (9 lines × 3) Wikipedia/Code/ColumnarCollectionViewController.swift:510 — Wikipedia/Code/ColumnarCollectionViewController.swift:510-518 | Wikipedia/Code/NewsViewController.swift:260-268 | Wikipedia/Code/OnThisDayViewController.swift:265-273 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ColumnarCollectionViewController.swift:510` 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 (9 lines × 3) Wikipedia/Code/EditSaveViewController.swift:125 — Wikipedia/Code/EditSaveViewController.swift:125-133 | Wikipedia/Code/TalkPageReplyComposeContentView.swift:375-383 | Wikipedia/Code/TalkPageTopicComposeViewController.swift:476-484 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Wikipedia/Code/TalkPageTopicComposeViewController.swift:486` calls `Styles` and `Wikipedia/Code/TalkPageReplyComposeContentView.swift:385` 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 (9 lines × 3) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232-240 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:244-252 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:259-267 — 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 `Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:232` 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 (9 lines × 3) WMF Framework/MWKDataStore+LanguageVariantMigration.swift:115 — WMF Framework/MWKDataStore+LanguageVariantMigration.swift:115-123 | WMF Framework/MWKDataStore+LanguageVariantMigration.swift:127-135 | WMF Framework/MWKDataStore+LanguageVariantMigration.swift:138-147 — 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 before the matched lines, `WMF Framework/MWKDataStore+LanguageVariantMigration.swift:127` calls `NSPredicate` and `WMF Framework/MWKDataStore+LanguageVariantMigration.swift:138` does not — after which the two agree again for 5 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 (20–21 lines × 2) · ×4
  • Duplicated block (20–21 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:163 — WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:163-182 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:197-217 — 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 `WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.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 (20–21 lines × 2) WMF Framework/ArticleCacheController.swift:53 — WMF Framework/ArticleCacheController.swift:53-73 | WMF Framework/ArticleCacheController.swift:91-110 — 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 `WMF Framework/ArticleCacheController.swift:53` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (20–21 lines × 2) Wikipedia/Code/ArticleViewController+Editing.swift:162 — Wikipedia/Code/ArticleViewController+Editing.swift:162-182 | Wikipedia/Code/ArticleViewController+Editing.swift:216-235 — 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 `Wikipedia/Code/ArticleViewController+Editing.swift:162` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20–21 lines × 2) Wikipedia/Code/TalkPageTopicComposeViewController+TalkPageFormattingToolbar.swift:22 — Wikipedia/Code/TalkPageTopicComposeViewController+TalkPageFormattingToolbar.swift:22-41 | Wikipedia/Code/TalkPageViewController+TalkPageFormattingToolbar.swift:25-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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/TalkPageTopicComposeViewController+TalkPageFormattingToolbar.swift:22` 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 lines × 2) · ×4
  • Duplicated block (19 lines × 2) WMFData/Sources/WMFData/Service/WMFBasicService.swift:226 — WMFData/Sources/WMFData/Service/WMFBasicService.swift:226-244 | WMFData/Sources/WMFData/Service/WMFBasicService.swift:250-268 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `WMFData/Sources/WMFData/Service/WMFBasicService.swift:226` 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 (19 lines × 2) WMF Framework/MediaWikiFetcher.swift:134 — WMF Framework/MediaWikiFetcher.swift:134-152 | WMF Framework/MediaWikiFetcher.swift:156-174 — 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 `WMF Framework/MediaWikiFetcher.swift:134` 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 (19 lines × 2) Wikipedia/Code/ColumnarCollectionViewController.swift:193 — Wikipedia/Code/ColumnarCollectionViewController.swift:193-211 | Wikipedia/Code/InsertMediaSearchResultsCollectionViewController.swift:158-176 — 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 (19 lines × 2) WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:193 — WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:193-211 | WMF Framework/Remote Notifications/Model/RemoteNotificationType.swift:39-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 `WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:193` 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:93 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:93-107 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:235-248 — 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 `WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.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.
  • Duplicated block (14–15 lines × 2) WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFFundraisingCampaignDataController.swift:185 — WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFFundraisingCampaignDataController.swift:185-199 | WMFData/Sources/WMFData/Data Controllers/Temp Accounts/WMFTempAccountDataController.swift:79-92 — 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 `WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFFundraisingCampaignDataController.swift:185` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `(@Sendable (Result<Void, Error>) -> Void)? = nil` in one and `(@Sendable (Result<Bool, Error>) -> Void)? = 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.
  • Duplicated block (14–15 lines × 2) WMF Framework/ThemeableTextField.swift:75 — WMF Framework/ThemeableTextField.swift:75-89 | Wikipedia/Code/ThemeableTextView.swift:203-216 — 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 `WMF Framework/ThemeableTextField.swift:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 2) Wikipedia/Code/ArticleViewController+Editing.swift:409 — Wikipedia/Code/ArticleViewController+Editing.swift:409-423 | Wikipedia/Code/TalkPageViewController.swift:766-779 — 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 `Wikipedia/Code/ArticleViewController+Editing.swift:409` 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 (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:51 — WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:51-63 | WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift:51-63 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift` and `WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 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) REDACTED:169 — REDACTED:169-181 | Wikipedia/Code/SavedAllArticlesCoordinator.swift:272-284 — 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 `REDACTED:169` 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) Wikipedia/Code/TalkPageCellCommentView.swift:130 — Wikipedia/Code/TalkPageCellCommentView.swift:130-142 | Wikipedia/Code/TalkPageCellTopicView.swift:380-392 — 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 `Wikipedia/Code/TalkPageCellCommentView.swift:130` 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) WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:73 — WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:73-85 | WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:102-114 — 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 `WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:73` 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, `WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:100` calls `watchlistUserDidTapDiff` and `WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewController.swift:72` 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 (7 lines × 3) · ×4
  • Duplicated block (7 lines × 3) WMFComponents/Sources/WMFComponents/Components/Shared/Project Icons/WMFProjectIconView.swift:31 — WMFComponents/Sources/WMFComponents/Components/Shared/Project Icons/WMFProjectIconView.swift:31-37 | WMFComponents/Sources/WMFComponents/Components/Shared/Project Icons/WMFProjectIconView.swift:40-46 | WMFComponents/Sources/WMFComponents/Components/Shared/Project Icons/WMFProjectIconView.swift:48-54 — 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 (7 lines × 3) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:222 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:222-228 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:235-241 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:262-268 — 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 (7 lines × 3) WMF Framework/ActionButton.swift:24 — WMF Framework/ActionButton.swift:24-30 | Wikipedia/Code/CollectionViewCell.swift:197-203 | Wikipedia/Code/SizeThatFitsReusableView.swift:113-119 — 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 (7 lines × 3) Wikipedia/Code/EraseSavedArticlesView.swift:12 — Wikipedia/Code/EraseSavedArticlesView.swift:12-18 | Wikipedia/Code/InsertMediaImageInfoView.swift:19-25 | Wikipedia/Code/InsertMediaSettingsButtonView.swift:16-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 all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×4
  • Duplicated block (6 lines × 3) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:9 — WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:9-14 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFCategoriesDataController.swift:13-20 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:13-18 — 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 (6 lines × 3) Wikipedia/Code/ActivityTabViewController.swift:811 — Wikipedia/Code/ActivityTabViewController.swift:811-820 | Wikipedia/Code/SavedViewController.swift:705-714 | Wikipedia/Code/SearchViewController.swift:661-666 — 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 (6 lines × 3) Wikipedia/Code/DescriptionWelcomePageViewController.swift:173 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:173-178 | Wikipedia/Code/WMFReferencePageViewController.swift:162-167 | Wikipedia/Code/WMFWelcomePageViewController.swift:250-255 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 × 3) Wikipedia/Code/DescriptionWelcomePageViewController.swift:180 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:180-185 | Wikipedia/Code/WMFReferencePageViewController.swift:169-174 | Wikipedia/Code/WMFWelcomePageViewController.swift:257-262 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×3
  • Duplicated block (24 lines × 2) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:341 — WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:341-364 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:382-405 — 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 `WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:341` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (24 lines × 2) Wikipedia/Code/CollectionViewCell.swift:163 — Wikipedia/Code/CollectionViewCell.swift:163-186 | Wikipedia/Code/SizeThatFitsReusableView.swift:84-107 — 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 (24 lines × 2) WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:257 — WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:257-280 | WMF Framework/Remote Notifications/Model/RemoteNotificationType.swift:85-108 — 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 `WMF Framework/Remote Notifications/Model/RemoteNotificationFilterType.swift:257` 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:54 — WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:54-74 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:106-126 — 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 `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:54` 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) Wikipedia/Code/DiffFetcher.swift:146 — Wikipedia/Code/DiffFetcher.swift:146-166 | Wikipedia/Code/DiffFetcher.swift:205-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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/DiffFetcher.swift:146` 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 `@escaping ((Result<WMFPageHistoryRevision, Error>) -> Void)` in one and `@escaping (Result<WMFPageHistoryRevision, Error>) -> Void` 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 (21 lines × 2) WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:176 — WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:176-196 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:198-218 — 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 (19 lines × 3) · ×3
  • Duplicated block (19 lines × 3) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:56 — WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:56-74 | WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:19-37 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:108-126 — 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 `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 3) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:51 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:51-69 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:56-74 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:51-69 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift` and `WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:51` 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 (19 lines × 3) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:683 — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:683-701 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:29-47 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:45-63 — 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:683` 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, `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:49` calls `String` and `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:702` 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 (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) WMF Framework/CacheDBWriting.swift:80 — WMF Framework/CacheDBWriting.swift:80-95 | WMF Framework/CacheDBWriting.swift:100-115 — 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 `WMF Framework/CacheDBWriting.swift:80` 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) Wikipedia/Code/DiffContainerViewController.swift:762 — Wikipedia/Code/DiffContainerViewController.swift:762-777 | Wikipedia/Code/DiffContainerViewController.swift:806-821 — 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 `Wikipedia/Code/DiffContainerViewController.swift:762` 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) Wikipedia/Code/ActivityTabViewController.swift:301 — Wikipedia/Code/ActivityTabViewController.swift:301-316 | Wikipedia/Code/SavedViewController.swift:67-82 — 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 (11 lines × 3) · ×3
  • Duplicated block (11 lines × 3) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:243 — WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:243-254 | WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetViewModel.swift:54-65 | WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:141-151 — 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 `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:243` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 3) WMF Framework/CacheFileWriterHelper.swift:16 — WMF Framework/CacheFileWriterHelper.swift:16-26 | WMF Framework/CacheFileWriterHelper.swift:32-42 | WMF Framework/CacheFileWriterHelper.swift:59-69 — 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 `WMF Framework/CacheFileWriterHelper.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (FileSaveResult) -> Void` in one and `(FileSaveResult) -> Void` 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 (11 lines × 3) Wikipedia/Code/DonateCoordinator.swift:658 — Wikipedia/Code/DonateCoordinator.swift:658-668 | Wikipedia/Code/DonateCoordinator.swift:672-682 | Wikipedia/Code/DonateCoordinator.swift:685-695 — 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. 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.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×3
  • Duplicated block (10–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabInfoCardView.swift:56 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabInfoCardView.swift:56-65 | WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabInfoCardView.swift:67-77 — 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 `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabInfoCardView.swift:56` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift:147 — WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift:147-156 | WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift:171-181 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift:184` calls `HStack` and `WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFImpactViews.swift:157` 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–11 lines × 2) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:429 — WMF Framework/Remote Notifications/RemoteNotificationsController.swift:429-438 | WMF Framework/Remote Notifications/RemoteNotificationsController.swift:440-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. Read the line range as the matched WINDOW rather than a finished unit: at `WMF Framework/Remote Notifications/RemoteNotificationsController.swift:440` 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 (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) Wikipedia/Code/ArticleLocationCollectionViewController.swift:219 — Wikipedia/Code/ArticleLocationCollectionViewController.swift:219-226 | Wikipedia/Code/ColumnarCollectionViewController.swift:508-515 | Wikipedia/Code/NewsViewController.swift:258-265 | Wikipedia/Code/OnThisDayViewController.swift:263-270 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ArticleLocationCollectionViewController.swift:219` 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 × 4) Wikipedia/Code/DiffFetcher.swift:51 — Wikipedia/Code/DiffFetcher.swift:51-58 | Wikipedia/Code/DiffFetcher.swift:200-209 | Wikipedia/Code/DiffFetcher.swift:244-253 | Wikipedia/Code/GlobalUserInfoFetcher.swift:17-27 — before extracting anything, compare `Wikipedia/Code/DiffFetcher.swift` and `Wikipedia/Code/GlobalUserInfoFetcher.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `Wikipedia/Code/DiffFetcher.swift:51` 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping (Result<String, Error>) -> Void` in one and `@escaping (Result<WMFPageHistoryRevision, Error>) -> Void` 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 × 4) Wikipedia/Code/DiffFetcher.swift:143 — Wikipedia/Code/DiffFetcher.swift:143-151 | Wikipedia/Code/DiffFetcher.swift:203-210 | Wikipedia/Code/DiffFetcher.swift:247-254 | Wikipedia/Code/GlobalUserInfoFetcher.swift:20-28 — before extracting anything, compare `Wikipedia/Code/DiffFetcher.swift` and `Wikipedia/Code/GlobalUserInfoFetcher.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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 `Wikipedia/Code/DiffFetcher.swift:143` 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 `completion` to `@escaping ((Result<WMFPageHistoryRevision, Error>) -> Void)` in one and `@escaping (Result<WMFPageHistoryRevision, Error>) -> Void` 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 (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) Wikipedia/Code/ColumnarCollectionViewController.swift:135 — Wikipedia/Code/ColumnarCollectionViewController.swift:135-139 | Wikipedia/Code/TalkPageTopicComposeViewController.swift:428-432 | Wikipedia/Code/TalkPageViewController.swift:309-313 — 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. 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 × 3) WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsViewModel.swift:12 — WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsViewModel.swift:12-16 | WMFComponents/Sources/WMFComponents/Components/Shared/Error View/WMFErrorViewModel.swift:11-15 | WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:12-16 — 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 (5 lines × 3) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewMostReadDateSlideDataController.swift:18 — WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewMostReadDateSlideDataController.swift:18-22 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewReadCountSlideDataController.swift:19-23 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopArticlesSlideDataController.swift:19-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 3 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopArticlesSlideDataController.swift:26` calls `WMFPageViewsDataController` and `WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewMostReadDateSlideDataController.swift:26` 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.
D17 · Explicit Debt · HackComment · ×2
  • HackComment WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentNavigationController.swift:52 — // HACK: Forces liquid glass bar button items to re-render with correct appearance. — 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 Wikipedia/Code/ArticleViewController.swift:1050 — // HACK: Sometimes the `scroll_to_anchor` message is not triggered from the web view over the JS bridge, even after prepareForScrollToAnchor successfully goes through. This means the completion block above is queued to scrollToAnchorCompletions but never run. We are trying to scroll again here once more after a slight delay in hopes of triggering `scroll_to_anchor` again. — 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.
D35 · Change Coupling · Change-coupling hub · ×2
  • Change-coupling hub: InsertLinkViewController.swift → ArticleViewController.swift, EditLinkViewController.swift, SearchViewController.swift Wikipedia/Code/InsertLinkViewController.swift — `Wikipedia/Code/InsertLinkViewController.swift` changes together with 3 other files — `Wikipedia/Code/ArticleViewController.swift`, `Wikipedia/Code/EditLinkViewController.swift`, `Wikipedia/Code/SearchViewController.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.
  • Change-coupling hub: ExploreViewController.swift → InsertLinkViewController.swift, UIViewController+FeatureComponentFactory.swift, WMFDailyGameContentSource.swift, WMFSettingsViewController+Extensions.swift Wikipedia/Code/ExploreViewController.swift — `Wikipedia/Code/ExploreViewController.swift` changes together with 4 other files — `Wikipedia/Code/InsertLinkViewController.swift`, `Wikipedia/Code/UIViewController+FeatureComponentFactory.swift`, `Wikipedia/Code/WMFDailyGameContentSource.swift`, `Wikipedia/Code/WMFSettingsViewController+Extensions.swift` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 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 4.
D4 · Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (6 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:63 — WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:63-94 | WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:96-120 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFCategoriesDataController.swift:22-60 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:26-71 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:246-268 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:246-267 — 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.
  • Members sharing a duplicated core (6 members, 50+ identical tokens) Wikipedia/Code/ActivityTabFunnel.swift:62 — Wikipedia/Code/ActivityTabFunnel.swift:62-78 | Wikipedia/Code/ArticleTabsFunnel.swift:65-81 | Wikipedia/Code/DonateFunnel.swift:115-133 | Wikipedia/Code/EditInteractionFunnel.swift:78-96 | Wikipedia/Code/ImageRecommendationsFunnel.swift:83-101 | Wikipedia/Code/SearchFunnel.swift:44-63 — 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 (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) Wikipedia/Code/TalkPageCoffeeRollViewController.swift:64 — Wikipedia/Code/TalkPageCoffeeRollViewController.swift:64-85 | Wikipedia/Code/TalkPageViewController.swift:1370-1392 — 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 `Wikipedia/Code/TalkPageCoffeeRollViewController.swift:64` 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–23 lines × 2) Wikipedia/Code/Controllers/ShortDescriptionController.swift:166 — Wikipedia/Code/Controllers/ShortDescriptionController.swift:166-188 | Wikipedia/Code/Controllers/ShortDescriptionController.swift:208-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/Controllers/ShortDescriptionController.swift:166` 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 (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) Wikipedia/Code/EditSaveViewController.swift:263 — Wikipedia/Code/EditSaveViewController.swift:263-284 | Wikipedia/Code/EditSaveViewController.swift:297-318 — 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 `Wikipedia/Code/EditSaveViewController.swift:263` 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 (22 lines × 2) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:44 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:44-65 | WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:87-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) WMF Framework/CacheController.swift:151 — WMF Framework/CacheController.swift:151-170 | WMF Framework/ImageCacheController.swift:14-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. 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 (20 lines × 2) Wikipedia/Code/DiffContainerViewController.swift:1346 — Wikipedia/Code/DiffContainerViewController.swift:1346-1365 | Wikipedia/Code/WatchlistController.swift:288-307 — 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 `Wikipedia/Code/DiffContainerViewController.swift:1346` 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 (19–20 lines × 2) · ×2
  • Duplicated block (19–20 lines × 2) WMF Framework/Remote Notifications/RemoteNotificationsAPIController.swift:297 — WMF Framework/Remote Notifications/RemoteNotificationsAPIController.swift:297-316 | WMF Framework/Remote Notifications/RemoteNotificationsAPIController.swift:325-343 — 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 `WMF Framework/Remote Notifications/RemoteNotificationsAPIController.swift:297` 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 (19–20 lines × 2) Wikipedia/Code/NewsViewController.swift:237 — Wikipedia/Code/NewsViewController.swift:237-255 | Wikipedia/Code/OnThisDayViewController.swift:241-260 — 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.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×2
  • Duplicated block (18–19 lines × 2) WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift:305 — WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift:305-323 | WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift:337-354 — 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 `WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift:305` 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 (18–19 lines × 2) WMF Framework/Fetcher.swift:298 — WMF Framework/Fetcher.swift:298-316 | WMF Framework/Fetcher.swift:340-357 — 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 `WMF Framework/Fetcher.swift:298` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) WMF Framework/PermanentlyPersistableURLCache.swift:742 — WMF Framework/PermanentlyPersistableURLCache.swift:742-758 | WMF Framework/PermanentlyPersistableURLCache.swift:763-779 — 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 (17 lines × 2) Wikipedia/Code/DiffTransformer.swift:209 — Wikipedia/Code/DiffTransformer.swift:209-225 | Wikipedia/Code/DiffTransformer.swift:232-248 — 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 `Wikipedia/Code/DiffTransformer.swift:209` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:149 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:149-161 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:280-292 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:369-381 — 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 `WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:149` 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 × 3) Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:23 — Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:23-35 | Wikipedia/Code/WMFAuthLoginInfoFetcher.swift:23-35 | Wikipedia/Code/WMFCurrentUserFetcher.swift:59-71 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) WMF Framework/CacheController.swift:242 — WMF Framework/CacheController.swift:242-253 | WMF Framework/CacheController.swift:358-368 — 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 `WMF Framework/CacheController.swift:242` 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) Wikipedia/Code/AppOnboardingCoordinator.swift:35 — Wikipedia/Code/AppOnboardingCoordinator.swift:35-46 | Wikipedia/Code/AppOnboardingCoordinator.swift:174-184 — 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 `Wikipedia/Code/AppOnboardingCoordinator.swift:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) Wikipedia/Code/ArticleViewController+DonationReminder.swift:253 — Wikipedia/Code/ArticleViewController+DonationReminder.swift:253-260 | Wikipedia/Code/DonationReminderSetupCoordinator.swift:138-144 — 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–8 lines × 2) Wikipedia/Code/DiffFetcher.swift:193 — Wikipedia/Code/DiffFetcher.swift:193-200 | Wikipedia/Code/WikidataFetcher.swift:41-47 — 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 `Wikipedia/Code/DiffFetcher.swift:193` 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 (6–7 lines × 2) · ×2
  • Duplicated block (6–7 lines × 2) WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:39 — WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:39-44 | WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:28-34 — 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 `WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.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. 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 (6–7 lines × 2) Wikipedia/Code/AppOnboardingCoordinator.swift:251 — Wikipedia/Code/AppOnboardingCoordinator.swift:251-256 | Wikipedia/Code/AppOnboardingCoordinator.swift:267-273 — 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 `Wikipedia/Code/AppOnboardingCoordinator.swift:251` 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–6 lines × 2) · ×2
  • Duplicated block (5–6 lines × 2) Wikipedia/Code/AppViewControllerTipWrapper.swift:52 — Wikipedia/Code/AppViewControllerTipWrapper.swift:52-56 | Wikipedia/Code/WMFAppViewControllerTipWrapper.swift:41-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 `Wikipedia/Code/AppViewControllerTipWrapper.swift:52` 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 (5–6 lines × 2) Wikipedia/Code/UIViewController+Extensions.swift:53 — Wikipedia/Code/UIViewController+Extensions.swift:53-58 | Wikipedia/Code/UIViewController+Extensions.swift:69-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 `Wikipedia/Code/UIViewController+Extensions.swift:53` 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • Duplicated block (5 lines × 4) WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentHostingController.swift:49 — WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentHostingController.swift:49-53 | WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentNavigationController.swift:97-101 | WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentView.swift:37-41 | WMFComponents/Sources/WMFComponents/Base/Component Base Classes/WMFComponentViewController.swift:43-47 — 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 (5 lines × 4) Wikipedia/Code/ArticleViewController.swift:1781 — Wikipedia/Code/ArticleViewController.swift:1781-1785 | Wikipedia/Code/ExploreViewController.swift:1988-1992 | Wikipedia/Code/HomeViewController.swift:457-461 | Wikipedia/Code/PlacesViewController.swift:2625-2629 — 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.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: WMFNativeLocalizations — WMFNativeLocalizations: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: WMFTestKitchen — WMFTestKitchen: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark Wikipedia/assets/about.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Data table has no header cells · ×1
  • Data table has no header cells Wikipedia/assets/about.html:93 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×1
  • Animation without a prefers-reduced-motion guard Wikipedia/Code/WMFRandomDiceButton.html:9 — This stylesheet animates but never checks prefers-reduced-motion, so motion-sensitive users can't opt out. Wrap motion in @media (prefers-reduced-motion: no-preference).
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 2 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 · DonateCoordinator.presentActionSheet (cyclomatic 66) · ×1
  • DonateCoordinator.presentActionSheet (cyclomatic 66) Wikipedia/Code/DonateCoordinator.swift:226 — DonateCoordinator.presentActionSheet has cyclomatic complexity 66 (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 · WMFFont.`for` (cyclomatic 65) · ×1
  • WMFFont.`for` (cyclomatic 65) WMFComponents/Sources/WMFComponents/Style/WMFFont.swift:61 — WMFFont.`for` has cyclomatic complexity 65 (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 · ReadingListsSyncOperation.processLocalUpdates (cyclomatic 55) · ×1
  • ReadingListsSyncOperation.processLocalUpdates (cyclomatic 55) WMF Framework/ReadingListsSyncOperation.swift:479 — ReadingListsSyncOperation.processLocalUpdates has cyclomatic complexity 55 (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 · WMFAccountLoginLogoutFetcher.login (cyclomatic 54) · ×1
  • WMFAccountLoginLogoutFetcher.login (cyclomatic 54) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89 — WMFAccountLoginLogoutFetcher.login has cyclomatic complexity 54 (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 · PlacesViewController.regroupArticlesIfNecessary (cyclomatic 43) · ×1
  • PlacesViewController.regroupArticlesIfNecessary (cyclomatic 43) Wikipedia/Code/PlacesViewController.swift:1449 — PlacesViewController.regroupArticlesIfNecessary has cyclomatic complexity 43 (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 · Router.destinationForWikiResourceURL (cyclomatic 42) · ×1
  • Router.destinationForWikiResourceURL (cyclomatic 42) WMF Framework/Router.swift:54 — Router.destinationForWikiResourceURL 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 · PlacesViewController.adjustLayout (cyclomatic 42) · ×1
  • PlacesViewController.adjustLayout (cyclomatic 42) Wikipedia/Code/PlacesViewController.swift:1829 — PlacesViewController.adjustLayout 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 · Router.destinationForWResourceURL (cyclomatic 37) · ×1
  • Router.destinationForWResourceURL (cyclomatic 37) WMF Framework/Router.swift:163 — Router.destinationForWResourceURL has cyclomatic complexity 37 (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 · HtmlUtils.addStyling (cyclomatic 34) · ×1
  • HtmlUtils.addStyling (cyclomatic 34) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:320 — HtmlUtils.addStyling has cyclomatic complexity 34 (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 · WMFWatchlistFilterViewModel.generateDataForNewFilterSettings (cyclomatic 34) · ×1
  • WMFWatchlistFilterViewModel.generateDataForNewFilterSettings (cyclomatic 34) WMFComponents/Sources/WMFComponents/Components/Watchlist/Filter/WMFWatchlistFilterViewModel.swift:140 — WMFWatchlistFilterViewModel.generateDataForNewFilterSettings has cyclomatic complexity 34 (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 · WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles (cyclomatic 33) · ×1
  • WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles (cyclomatic 33) Wikipedia/Code/WMFDatabaseHousekeeper.swift:40 — WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles 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 · ArticleCacheDBWriter.syncResources (cyclomatic 32) · ×1
  • ArticleCacheDBWriter.syncResources (cyclomatic 32) Wikipedia/Code/ArticleCacheDBWriter.swift:35 — ArticleCacheDBWriter.syncResources has cyclomatic complexity 32 (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 · ReadingListsSyncOperation.locallyCreate (cyclomatic 31) · ×1
  • ReadingListsSyncOperation.locallyCreate (cyclomatic 31) WMF Framework/ReadingListsSyncOperation.swift:756 — ReadingListsSyncOperation.locallyCreate has cyclomatic complexity 31 (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 · DetailTransition.animateTransition (cyclomatic 30) · ×1
  • DetailTransition.animateTransition (cyclomatic 30) Wikipedia/Code/DetailTransition.swift:36 — DetailTransition.animateTransition has cyclomatic complexity 30 (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 · NotificationsCenterDetailViewModel.primaryAction (cyclomatic 30) · ×1
  • NotificationsCenterDetailViewModel.primaryAction (cyclomatic 30) Wikipedia/Code/NotificationsCenterDetailViewModel.swift:4 — NotificationsCenterDetailViewModel.primaryAction 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 · ReadingListsCollectionViewCell.sizeThatFits (cyclomatic 30) · ×1
  • ReadingListsCollectionViewCell.sizeThatFits (cyclomatic 30) Wikipedia/Code/ReadingListsCollectionViewCell.swift:114 — ReadingListsCollectionViewCell.sizeThatFits 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 · CollectionViewUpdater.controllerDidChangeContent (cyclomatic 29) · ×1
  • CollectionViewUpdater.controllerDidChangeContent (cyclomatic 29) Wikipedia/Code/CollectionViewUpdater.swift:69 — CollectionViewUpdater.controllerDidChangeContent has cyclomatic complexity 29 (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 · AppOnboardingCoordinator.start (cyclomatic 28) · ×1
  • AppOnboardingCoordinator.start (cyclomatic 28) Wikipedia/Code/AppOnboardingCoordinator.swift:33 — AppOnboardingCoordinator.start has cyclomatic complexity 28 (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 · WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cyclomatic 28) · ×1
  • WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cyclomatic 28) Wikipedia/Code/WMFAppViewController.swift:495 — WMFAppViewController.logWatchlistUserDidSaveFilterSettings has cyclomatic complexity 28 (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 · WMFNavigationBarConfiguring.configureNavigationBar (cyclomatic 27) · ×1
  • WMFNavigationBarConfiguring.configureNavigationBar (cyclomatic 27) WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:119 — WMFNavigationBarConfiguring.configureNavigationBar has cyclomatic complexity 27 (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 · ReadingListsSyncOperation.executeSync (cyclomatic 27) · ×1
  • ReadingListsSyncOperation.executeSync (cyclomatic 27) WMF Framework/ReadingListsSyncOperation.swift:60 — ReadingListsSyncOperation.executeSync has cyclomatic complexity 27 (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 · DescriptionEditViewController.save (cyclomatic 27) · ×1
  • DescriptionEditViewController.save (cyclomatic 27) Wikipedia/Code/DescriptionEditViewController.swift:342 — DescriptionEditViewController.save has cyclomatic complexity 27 (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 · DiffTransformer.populateAdditionalSectionAndMoveInfo (cyclomatic 27) · ×1
  • DiffTransformer.populateAdditionalSectionAndMoveInfo (cyclomatic 27) Wikipedia/Code/DiffTransformer.swift:99 — DiffTransformer.populateAdditionalSectionAndMoveInfo has cyclomatic complexity 27 (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 · WMFAppViewController.processUserActivity (cyclomatic 27) · ×1
  • WMFAppViewController.processUserActivity (cyclomatic 27) Wikipedia/Code/WMFAppViewController.swift:1319 — WMFAppViewController.processUserActivity has cyclomatic complexity 27 (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 · HomeCoordinator.makeHomeViewController (cyclomatic 26) · ×1
  • HomeCoordinator.makeHomeViewController (cyclomatic 26) Wikipedia/Code/HomeCoordinator.swift:53 — HomeCoordinator.makeHomeViewController has cyclomatic complexity 26 (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 · ViewControllerRouter.route (cyclomatic 26) · ×1
  • ViewControllerRouter.route (cyclomatic 26) Wikipedia/Code/ViewControllerRouter.swift:89 — ViewControllerRouter.route has cyclomatic complexity 26 (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 · WMFUserImpactDataController.fetch (cyclomatic 24) · ×1
  • WMFUserImpactDataController.fetch (cyclomatic 24) WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:26 — WMFUserImpactDataController.fetch has cyclomatic complexity 24 (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 · NotificationsCenterCommonViewModel.verboseTitle (cyclomatic 24) · ×1
  • NotificationsCenterCommonViewModel.verboseTitle (cyclomatic 24) Wikipedia/Code/NotificationsCenterCommonViewModel.swift:10 — NotificationsCenterCommonViewModel.verboseTitle 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 · SavedArticlesFetcher.handleFailure (cyclomatic 24) · ×1
  • SavedArticlesFetcher.handleFailure (cyclomatic 24) Wikipedia/Code/SavedArticlesFetcher.swift:308 — SavedArticlesFetcher.handleFailure 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 · String.pluralDictionary (cyclomatic 24) · ×1
  • String.pluralDictionary (cyclomatic 24) WMF Framework/HasText.swift:83 — String.pluralDictionary has cyclomatic complexity 24 (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 · PermanentlyPersistableURLCache.updateCacheWithCachedResponse (cyclomatic 23) · ×1
  • PermanentlyPersistableURLCache.updateCacheWithCachedResponse (cyclomatic 23) WMF Framework/PermanentlyPersistableURLCache.swift:452 — PermanentlyPersistableURLCache.updateCacheWithCachedResponse has cyclomatic complexity 23 (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 · ReadingListsSyncOperation.createOrUpdate (cyclomatic 23) · ×1
  • ReadingListsSyncOperation.createOrUpdate (cyclomatic 23) WMF Framework/ReadingListsSyncOperation.swift:914 — ReadingListsSyncOperation.createOrUpdate 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 · ArticlePeekPreviewViewController.contextMenuItems (cyclomatic 23) · ×1
  • ArticlePeekPreviewViewController.contextMenuItems (cyclomatic 23) Wikipedia/Code/ArticlePeekPreviewViewController.swift:115 — ArticlePeekPreviewViewController.contextMenuItems 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 · SavedArticlesCollectionViewCell.sizeThatFits (cyclomatic 23) · ×1
  • SavedArticlesCollectionViewCell.sizeThatFits (cyclomatic 23) Wikipedia/Code/SavedArticlesCollectionViewCell.swift:134 — SavedArticlesCollectionViewCell.sizeThatFits 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 · WMFEditorInputView.didSelectIndex (cyclomatic 22) · ×1
  • WMFEditorInputView.didSelectIndex (cyclomatic 22) WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift:419 — WMFEditorInputView.didSelectIndex has cyclomatic complexity 22 (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 · WMFArticleTabsDataController.getAdjacentArticleInTab (cyclomatic 22) · ×1
  • WMFArticleTabsDataController.getAdjacentArticleInTab (cyclomatic 22) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:422 — WMFArticleTabsDataController.getAdjacentArticleInTab 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 · WMFArticleSavedStateMigrationManager.migrateSyncedArticles (cyclomatic 22) · ×1
  • WMFArticleSavedStateMigrationManager.migrateSyncedArticles (cyclomatic 22) WMF Framework/WMFArticle+Migration.swift:201 — WMFArticleSavedStateMigrationManager.migrateSyncedArticles 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 · WikipediaLanguageCommandLineUtility.getSiteInfoLookup (cyclomatic 22) · ×1
  • WikipediaLanguageCommandLineUtility.getSiteInfoLookup (cyclomatic 22) Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtility.swift:72 — WikipediaLanguageCommandLineUtility.getSiteInfoLookup has cyclomatic complexity 22 (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 · DiffContainerViewController.setupDiffListViewControllerIfNeeded (cyclomatic 22) · ×1
  • DiffContainerViewController.setupDiffListViewControllerIfNeeded (cyclomatic 22) Wikipedia/Code/DiffContainerViewController.swift:882 — DiffContainerViewController.setupDiffListViewControllerIfNeeded 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 · EditorViewController.loadContent (cyclomatic 22) · ×1
  • EditorViewController.loadContent (cyclomatic 22) Wikipedia/Code/EditorViewController.swift:192 — EditorViewController.loadContent 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 · NotificationsCenterViewController.userDidPanCell (cyclomatic 22) · ×1
  • NotificationsCenterViewController.userDidPanCell (cyclomatic 22) Wikipedia/Code/NotificationsCenterViewController.swift:778 — NotificationsCenterViewController.userDidPanCell 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 · PlacesViewController.performSearch (cyclomatic 22) · ×1
  • PlacesViewController.performSearch (cyclomatic 22) Wikipedia/Code/PlacesViewController.swift:682 — PlacesViewController.performSearch 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 · Session.request (cyclomatic 22) · ×1
  • Session.request (cyclomatic 22) Wikipedia/Code/Session.swift:230 — Session.request 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 · TalkPageViewController.tappedPublish (cyclomatic 22) · ×1
  • TalkPageViewController.tappedPublish (cyclomatic 22) Wikipedia/Code/TalkPageViewController.swift:1136 — TalkPageViewController.tappedPublish 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 · HtmlUtils.addStyling (cyclomatic 21) · ×1
  • HtmlUtils.addStyling (cyclomatic 21) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:168 — HtmlUtils.addStyling has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · HtmlUtils.listInsertData (cyclomatic 21) · ×1
  • HtmlUtils.listInsertData (cyclomatic 21) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:518 — HtmlUtils.listInsertData 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 · EditSaveViewController.handleEditFailure (cyclomatic 21) · ×1
  • EditSaveViewController.handleEditFailure (cyclomatic 21) Wikipedia/Code/EditSaveViewController.swift:574 — EditSaveViewController.handleEditFailure 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 · TalkPageViewController.tappedPublish (cyclomatic 21) · ×1
  • TalkPageViewController.tappedPublish (cyclomatic 21) Wikipedia/Code/TalkPageViewController.swift:1231 — TalkPageViewController.tappedPublish 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 · WMFDailyGameExploreCell.sizeThatFits (cyclomatic 21) · ×1
  • WMFDailyGameExploreCell.sizeThatFits (cyclomatic 21) Wikipedia/Code/WMFDailyGameExploreCell.swift:226 — WMFDailyGameExploreCell.sizeThatFits 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 · WMFWatchlistDataController.apply (cyclomatic 20) · ×1
  • WMFWatchlistDataController.apply (cyclomatic 20) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:254 — WMFWatchlistDataController.apply has cyclomatic complexity 20 (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 · ExploreCardCollectionViewCell.sizeThatFits (cyclomatic 20) · ×1
  • ExploreCardCollectionViewCell.sizeThatFits (cyclomatic 20) WMF Framework/ExploreCardCollectionViewCell.swift:204 — ExploreCardCollectionViewCell.sizeThatFits 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 · PageNamespace.isTalkBased (cyclomatic 20) · ×1
  • PageNamespace.isTalkBased (cyclomatic 20) WMF Framework/PageNamespace.swift:91 — PageNamespace.isTalkBased 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. This is NOT this file's highest cyclomatic complexity: PageNamespace.stringValue (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · DiffListChangeItemViewModel.calculateAttributedString (cyclomatic 20) · ×1
  • DiffListChangeItemViewModel.calculateAttributedString (cyclomatic 20) Wikipedia/Code/DiffListChangeItemViewModel.swift:302 — DiffListChangeItemViewModel.calculateAttributedString 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 · SchemeHandler.kickOffDataTask (cyclomatic 20) · ×1
  • SchemeHandler.kickOffDataTask (cyclomatic 20) Wikipedia/Code/SchemeHandler/SchemeHandler.swift:163 — SchemeHandler.kickOffDataTask has cyclomatic complexity 20 (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 · UIView.wmf_preferredFrame (cyclomatic 20) · ×1
  • UIView.wmf_preferredFrame (cyclomatic 20) WMF Framework/UIStackView+SubviewVerification.swift:20 — UIView.wmf_preferredFrame has cyclomatic complexity 20 (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 · WMFActivityTabView.loggedInList (cyclomatic 19) · ×1
  • WMFActivityTabView.loggedInList (cyclomatic 19) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:80 — WMFActivityTabView.loggedInList 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 · TimelineViewModel.fetch (cyclomatic 19) · ×1
  • TimelineViewModel.fetch (cyclomatic 19) WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:40 — TimelineViewModel.fetch 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 · WMFAppViewControllerTipWrapper.listenForTooltips (cyclomatic 19) · ×1
  • WMFAppViewControllerTipWrapper.listenForTooltips (cyclomatic 19) Wikipedia/Code/AppViewControllerTipWrapper.swift:28 — WMFAppViewControllerTipWrapper.listenForTooltips 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 · ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cyclomatic 19) · ×1
  • ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cyclomatic 19) Wikipedia/Code/ArticleViewController.swift:14 — ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded has cyclomatic complexity 19 (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 · PageHistoryFetcher.fetchEditCounts (cyclomatic 19) · ×1
  • PageHistoryFetcher.fetchEditCounts (cyclomatic 19) Wikipedia/Code/PageHistoryFetcher.swift:155 — PageHistoryFetcher.fetchEditCounts 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 · PlacesViewController.updatePlaces (cyclomatic 19) · ×1
  • PlacesViewController.updatePlaces (cyclomatic 19) Wikipedia/Code/PlacesViewController.swift:843 — PlacesViewController.updatePlaces 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 · SavedArticlesFetcher._update (cyclomatic 19) · ×1
  • SavedArticlesFetcher._update (cyclomatic 19) Wikipedia/Code/SavedArticlesFetcher.swift:164 — SavedArticlesFetcher._update has cyclomatic complexity 19 (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 · WMFAuthenticationManager.loginWithSavedCredentials (cyclomatic 19) · ×1
  • WMFAuthenticationManager.loginWithSavedCredentials (cyclomatic 19) Wikipedia/Code/WMFAuthenticationManager.swift:253 — WMFAuthenticationManager.loginWithSavedCredentials 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 · WMFHCaptchaViewController.setupHCaptcha (cyclomatic 19) · ×1
  • WMFHCaptchaViewController.setupHCaptcha (cyclomatic 19) Wikipedia/Code/WMFHCaptchaViewController.swift:98 — WMFHCaptchaViewController.setupHCaptcha 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 · WMFArticleTabsDataController.fetchAllArticleTabs (cyclomatic 18) · ×1
  • WMFArticleTabsDataController.fetchAllArticleTabs (cyclomatic 18) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:768 — WMFArticleTabsDataController.fetchAllArticleTabs 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 · WMFExperimentsDataController.determineBucketForExperiment (cyclomatic 18) · ×1
  • WMFExperimentsDataController.determineBucketForExperiment (cyclomatic 18) WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift:117 — WMFExperimentsDataController.determineBucketForExperiment 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 · ArticleCacheController.syncCachedResources (cyclomatic 18) · ×1
  • ArticleCacheController.syncCachedResources (cyclomatic 18) WMF Framework/ArticleCacheController.swift:20 — ArticleCacheController.syncCachedResources has cyclomatic complexity 18 (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 · MediaWikiFetcher.perform (cyclomatic 18) · ×1
  • MediaWikiFetcher.perform (cyclomatic 18) WMF Framework/MediaWikiFetcher.swift:53 — MediaWikiFetcher.perform 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 · ArticleTabCoordinating.trackArticleTab (cyclomatic 18) · ×1
  • ArticleTabCoordinating.trackArticleTab (cyclomatic 18) Wikipedia/Code/ArticleCoordinator.swift:32 — ArticleTabCoordinating.trackArticleTab 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 · ArticleRightAlignedImageCollectionViewCell.sizeThatFits (cyclomatic 18) · ×1
  • ArticleRightAlignedImageCollectionViewCell.sizeThatFits (cyclomatic 18) Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:41 — ArticleRightAlignedImageCollectionViewCell.sizeThatFits 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 · PageHistoryCollectionViewCell.sizeThatFits (cyclomatic 18) · ×1
  • PageHistoryCollectionViewCell.sizeThatFits (cyclomatic 18) Wikipedia/Code/PageHistoryCollectionViewCell.swift:173 — PageHistoryCollectionViewCell.sizeThatFits 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 · localization.swift.importLocalizationsFromTWN (cyclomatic 18) · ×1
  • localization.swift.importLocalizationsFromTWN (cyclomatic 18) Command Line Tools/Update Localizations/localization.swift:433 — localization.swift.importLocalizationsFromTWN 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 · WMFCommunityFeedView.feedList (cyclomatic 17) · ×1
  • WMFCommunityFeedView.feedList (cyclomatic 17) WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift:39 — WMFCommunityFeedView.feedList 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 · WMFBasicService.performPOST (cyclomatic 17) · ×1
  • WMFBasicService.performPOST (cyclomatic 17) WMFData/Sources/WMFData/Service/WMFBasicService.swift:59 — WMFBasicService.performPOST 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 · WMFDonateDataController.submitPayment (cyclomatic 17) · ×1
  • WMFDonateDataController.submitPayment (cyclomatic 17) WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFDonateDataController.swift:204 — WMFDonateDataController.submitPayment 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 · WMFArticleDataController.fetchArticleInfo (cyclomatic 17) · ×1
  • WMFArticleDataController.fetchArticleInfo (cyclomatic 17) WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.swift:102 — WMFArticleDataController.fetchArticleInfo 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 · WikipediaLanguageCommandLineUtilityAPI.getSites (cyclomatic 17) · ×1
  • WikipediaLanguageCommandLineUtilityAPI.getSites (cyclomatic 17) Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift:22 — WikipediaLanguageCommandLineUtilityAPI.getSites 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 · RemoteNotificationsController.predicateForFilterSavedState (cyclomatic 17) · ×1
  • RemoteNotificationsController.predicateForFilterSavedState (cyclomatic 17) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:404 — RemoteNotificationsController.predicateForFilterSavedState 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 · DonateCoordinator.nativeDonateFormViewModel (cyclomatic 17) · ×1
  • DonateCoordinator.nativeDonateFormViewModel (cyclomatic 17) Wikipedia/Code/DonateCoordinator.swift:461 — DonateCoordinator.nativeDonateFormViewModel 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 · DonateCoordinator.logNativeFormDidTriggerPaymentSuccess (cyclomatic 17) · ×1
  • DonateCoordinator.logNativeFormDidTriggerPaymentSuccess (cyclomatic 17) Wikipedia/Code/DonateCoordinator.swift:872 — DonateCoordinator.logNativeFormDidTriggerPaymentSuccess has cyclomatic complexity 17 (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 · ExploreViewController.collectionView (cyclomatic 17) · ×1
  • ExploreViewController.collectionView (cyclomatic 17) Wikipedia/Code/ExploreViewController.swift:613 — ExploreViewController.collectionView 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 · PageHistoryViewController.configure (cyclomatic 17) · ×1
  • PageHistoryViewController.configure (cyclomatic 17) Wikipedia/Code/PageHistoryViewController.swift:458 — PageHistoryViewController.configure 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 · PlacesViewController.merge (cyclomatic 17) · ×1
  • PlacesViewController.merge (cyclomatic 17) Wikipedia/Code/PlacesViewController.swift:1402 — PlacesViewController.merge 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 · WMFAppViewController.logTabBarSelectionsForActivityTab (cyclomatic 17) · ×1
  • WMFAppViewController.logTabBarSelectionsForActivityTab (cyclomatic 17) Wikipedia/Code/WMFAppViewController.swift:1261 — WMFAppViewController.logTabBarSelectionsForActivityTab 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 · WikimediaProject.init (cyclomatic 17) · ×1
  • WikimediaProject.init (cyclomatic 17) Wikipedia/Code/WikimediaProject.swift:92 — WikimediaProject.init 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 · WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates (cyclomatic 16) · ×1
  • WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates (cyclomatic 16) WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:150 — WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates 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 · WMFWatchlistDataController.fetchWatchlist (cyclomatic 16) · ×1
  • WMFWatchlistDataController.fetchWatchlist (cyclomatic 16) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:103 — WMFWatchlistDataController.fetchWatchlist 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 · CacheController.remove (cyclomatic 16) · ×1
  • CacheController.remove (cyclomatic 16) WMF Framework/CacheController.swift:290 — CacheController.remove 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 · CollectionViewEditController.handlePanGesture (cyclomatic 16) · ×1
  • CollectionViewEditController.handlePanGesture (cyclomatic 16) WMF Framework/CollectionViewEditController.swift:264 — CollectionViewEditController.handlePanGesture 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 · ColumnarCollectionViewLayout.prepare (cyclomatic 16) · ×1
  • ColumnarCollectionViewLayout.prepare (cyclomatic 16) WMF Framework/ColumnarCollectionViewLayout.swift:190 — ColumnarCollectionViewLayout.prepare 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 · ReadingListsSyncOperation.createOrUpdate (cyclomatic 16) · ×1
  • ReadingListsSyncOperation.createOrUpdate (cyclomatic 16) WMF Framework/ReadingListsSyncOperation.swift:1010 — ReadingListsSyncOperation.createOrUpdate 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 · WMFArticleSavedStateMigrationManager.runMigration (cyclomatic 16) · ×1
  • WMFArticleSavedStateMigrationManager.runMigration (cyclomatic 16) WMF Framework/WMFArticle+Migration.swift:117 — WMFArticleSavedStateMigrationManager.runMigration 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 · WidgetController.fetchTopReadContent (cyclomatic 16) · ×1
  • WidgetController.fetchTopReadContent (cyclomatic 16) WMF Framework/Widget/WidgetController.swift:370 — WidgetController.fetchTopReadContent 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 · DiffContainerViewController.populatePrevNextModelsForToolbar (cyclomatic 16) · ×1
  • DiffContainerViewController.populatePrevNextModelsForToolbar (cyclomatic 16) Wikipedia/Code/DiffContainerViewController.swift:446 — DiffContainerViewController.populatePrevNextModelsForToolbar 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 · DiffContainerViewController.completeRollbackOrUndo (cyclomatic 16) · ×1
  • DiffContainerViewController.completeRollbackOrUndo (cyclomatic 16) Wikipedia/Code/DiffContainerViewController.swift:1291 — DiffContainerViewController.completeRollbackOrUndo 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 · DonateCoordinator.logWebViewFormThankYouDidDisappear (cyclomatic 16) · ×1
  • DonateCoordinator.logWebViewFormThankYouDidDisappear (cyclomatic 16) Wikipedia/Code/DonateCoordinator.swift:990 — DonateCoordinator.logWebViewFormThankYouDidDisappear 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 · NotificationsCenterViewController.userDidTapMoreActionForCell (cyclomatic 16) · ×1
  • NotificationsCenterViewController.userDidTapMoreActionForCell (cyclomatic 16) Wikipedia/Code/NotificationsCenterViewController.swift:870 — NotificationsCenterViewController.userDidTapMoreActionForCell 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 · PageHistoryViewController.getEditCounts (cyclomatic 16) · ×1
  • PageHistoryViewController.getEditCounts (cyclomatic 16) Wikipedia/Code/PageHistoryViewController.swift:189 — PageHistoryViewController.getEditCounts 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 · SavedAllArticlesCoordinator.fetchAllSavedArticles (cyclomatic 16) · ×1
  • SavedAllArticlesCoordinator.fetchAllSavedArticles (cyclomatic 16) Wikipedia/Code/SavedAllArticlesCoordinator.swift:435 — SavedAllArticlesCoordinator.fetchAllSavedArticles 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 · SinglePageWebViewController.handleNavigation (cyclomatic 16) · ×1
  • SinglePageWebViewController.handleNavigation (cyclomatic 16) Wikipedia/Code/SinglePageWebViewController.swift:389 — SinglePageWebViewController.handleNavigation 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 · ThanksGiving.tappedThank (cyclomatic 16) · ×1
  • ThanksGiving.tappedThank (cyclomatic 16) Wikipedia/Code/ThanksGiving.swift:35 — ThanksGiving.tappedThank 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 · WatchlistController.presentChooseExpiryActionSheet (cyclomatic 16) · ×1
  • WatchlistController.presentChooseExpiryActionSheet (cyclomatic 16) Wikipedia/Code/WatchlistController.swift:127 — WatchlistController.presentChooseExpiryActionSheet 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 · WikitextFetcher.fetchSection (cyclomatic 16) · ×1
  • WikitextFetcher.fetchSection (cyclomatic 16) Wikipedia/Code/WikitextFetcher.swift:74 — WikitextFetcher.fetchSection has cyclomatic complexity 16 (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 · WMFContentGroup.detailViewControllerWithDataStore (cyclomatic 16) · ×1
  • WMFContentGroup.detailViewControllerWithDataStore (cyclomatic 16) WMF Framework/WMFContentGroup+Display.swift:34 — WMFContentGroup.detailViewControllerWithDataStore 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 · GenerateTopicsStrings.swift.injectIntoStringsFile (cyclomatic 16) · ×1
  • GenerateTopicsStrings.swift.injectIntoStringsFile (cyclomatic 16) scripts/GenerateTopicsStrings.swift:291 — GenerateTopicsStrings.swift.injectIntoStringsFile 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.
D2 · Cognitive Complexity · ReadingListsSyncOperation.processLocalUpdates (cognitive 133) · ×1
  • ReadingListsSyncOperation.processLocalUpdates (cognitive 133) WMF Framework/ReadingListsSyncOperation.swift:479 — ReadingListsSyncOperation.processLocalUpdates has cognitive complexity 133 (threshold 15). Drivers by points: if/else 35 (93 pts), loops 17 (35 pts), boolean chains 5 (nesting depth added 76). 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 · PlacesViewController.regroupArticlesIfNecessary (cognitive 88) · ×1
  • PlacesViewController.regroupArticlesIfNecessary (cognitive 88) Wikipedia/Code/PlacesViewController.swift:1449 — PlacesViewController.regroupArticlesIfNecessary has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (66 pts), loops 9 (15 pts), boolean chains 5, ternaries 2 (nesting depth added 43). 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 · WMFAccountLoginLogoutFetcher.login (cognitive 87) · ×1
  • WMFAccountLoginLogoutFetcher.login (cognitive 87) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89 — WMFAccountLoginLogoutFetcher.login has cognitive complexity 87 (threshold 15). Drivers by points: if/else 28 (59 pts), boolean chains 22, match/switch 2 (6 pts) (nesting depth added 35). 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 · DiffTransformer.populateAdditionalSectionAndMoveInfo (cognitive 67) · ×1
  • DiffTransformer.populateAdditionalSectionAndMoveInfo (cognitive 67) Wikipedia/Code/DiffTransformer.swift:99 — DiffTransformer.populateAdditionalSectionAndMoveInfo has cognitive complexity 67 (threshold 15). Drivers by points: if/else 11 (29 pts), ternaries 6 (24 pts), boolean chains 7, match/switch 1 (5 pts), loops 2 (nesting depth added 40). 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 · HtmlUtils.addStyling (cognitive 64) · ×1
  • HtmlUtils.addStyling (cognitive 64) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:320 — HtmlUtils.addStyling has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (43 pts), loops 14 (19 pts), boolean chains 2 (nesting depth added 31). 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 · DonateCoordinator.presentActionSheet (cognitive 61) · ×1
  • DonateCoordinator.presentActionSheet (cognitive 61) Wikipedia/Code/DonateCoordinator.swift:226 — DonateCoordinator.presentActionSheet has cognitive complexity 61 (threshold 15). Drivers by points: if/else 32 (52 pts), match/switch 7, boolean chains 1, ternaries 1 (nesting depth added 20). 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 · Router.destinationForWikiResourceURL (cognitive 59) · ×1
  • Router.destinationForWikiResourceURL (cognitive 59) WMF Framework/Router.swift:54 — Router.destinationForWikiResourceURL has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 18, ternaries 2 (4 pts), match/switch 1 (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 · WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles (cognitive 59) · ×1
  • WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles (cognitive 59) Wikipedia/Code/WMFDatabaseHousekeeper.swift:40 — WMFDatabaseHousekeeper.deleteStaleUnreferencedArticles has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 4 (8 pts), boolean chains 5, match/switch 1 (3 pts), ternaries 2 (nesting depth added 29). 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 · TimelineViewModel.fetch (cognitive 57) · ×1
  • TimelineViewModel.fetch (cognitive 57) WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:40 — TimelineViewModel.fetch has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 2 (9 pts), boolean chains 6, error handling 1 (nesting depth added 34). 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 · ReadingListsSyncOperation.locallyCreate (cognitive 57) · ×1
  • ReadingListsSyncOperation.locallyCreate (cognitive 57) WMF Framework/ReadingListsSyncOperation.swift:756 — ReadingListsSyncOperation.locallyCreate has cognitive complexity 57 (threshold 15). Drivers by points: if/else 23 (46 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlacesViewController.adjustLayout (cognitive 57) · ×1
  • PlacesViewController.adjustLayout (cognitive 57) Wikipedia/Code/PlacesViewController.swift:1829 — PlacesViewController.adjustLayout has cognitive complexity 57 (threshold 15). Drivers by points: if/else 24 (32 pts), boolean chains 16, ternaries 4 (8 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 · WMFUserImpactDataController.fetch (cognitive 56) · ×1
  • WMFUserImpactDataController.fetch (cognitive 56) WMFData/Sources/WMFData/Data Controllers/Shared/WMFUserImpactDataController.swift:26 — WMFUserImpactDataController.fetch has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (13 pts), boolean chains 2, match/switch 1 (nesting depth added 34). 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 · ArticleCacheDBWriter.syncResources (cognitive 56) · ×1
  • ArticleCacheDBWriter.syncResources (cognitive 56) Wikipedia/Code/ArticleCacheDBWriter.swift:35 — ArticleCacheDBWriter.syncResources has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (3 pts), error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WMFDailyGameExploreCell.sizeThatFits (cognitive 55) · ×1
  • WMFDailyGameExploreCell.sizeThatFits (cognitive 55) Wikipedia/Code/WMFDailyGameExploreCell.swift:226 — WMFDailyGameExploreCell.sizeThatFits has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28 (52 pts), ternaries 1 (3 pts) (nesting depth added 26). 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 · WMFArticleSavedStateMigrationManager.migrateSyncedArticles (cognitive 51) · ×1
  • WMFArticleSavedStateMigrationManager.migrateSyncedArticles (cognitive 51) WMF Framework/WMFArticle+Migration.swift:201 — WMFArticleSavedStateMigrationManager.migrateSyncedArticles has cognitive complexity 51 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (8 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 30). 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 · String.pluralDictionary (cognitive 50) · ×1
  • String.pluralDictionary (cognitive 50) WMF Framework/HasText.swift:83 — String.pluralDictionary has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiffContainerViewController.setupDiffListViewControllerIfNeeded (cognitive 47) · ×1
  • DiffContainerViewController.setupDiffListViewControllerIfNeeded (cognitive 47) Wikipedia/Code/DiffContainerViewController.swift:882 — DiffContainerViewController.setupDiffListViewControllerIfNeeded has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (40 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 24). 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 · ReadingListsCollectionViewCell.sizeThatFits (cognitive 45) · ×1
  • ReadingListsCollectionViewCell.sizeThatFits (cognitive 45) Wikipedia/Code/ReadingListsCollectionViewCell.swift:114 — ReadingListsCollectionViewCell.sizeThatFits has cognitive complexity 45 (threshold 15). Drivers by points: if/else 23 (32 pts), ternaries 4 (7 pts), boolean chains 6 (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 · localization.swift.importLocalizationsFromTWN (cognitive 45) · ×1
  • localization.swift.importLocalizationsFromTWN (cognitive 45) Command Line Tools/Update Localizations/localization.swift:433 — localization.swift.importLocalizationsFromTWN has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 4 (8 pts), boolean chains 3, error handling 1 (nesting depth added 24). 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 · CollectionViewUpdater.controllerDidChangeContent (cognitive 44) · ×1
  • CollectionViewUpdater.controllerDidChangeContent (cognitive 44) Wikipedia/Code/CollectionViewUpdater.swift:69 — CollectionViewUpdater.controllerDidChangeContent has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 10, loops 3 (4 pts), match/switch 2 (4 pts) (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 · DescriptionEditViewController.save (cognitive 43) · ×1
  • DescriptionEditViewController.save (cognitive 43) Wikipedia/Code/DescriptionEditViewController.swift:342 — DescriptionEditViewController.save has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 20). 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 · PlacesViewController.performSearch (cognitive 43) · ×1
  • PlacesViewController.performSearch (cognitive 43) Wikipedia/Code/PlacesViewController.swift:682 — PlacesViewController.performSearch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 2, error handling 1 (2 pts), match/switch 1 (nesting depth added 22). 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 · WMFWatchlistFilterViewModel.generateDataForNewFilterSettings (cognitive 42) · ×1
  • WMFWatchlistFilterViewModel.generateDataForNewFilterSettings (cognitive 42) WMFComponents/Sources/WMFComponents/Components/Watchlist/Filter/WMFWatchlistFilterViewModel.swift:140 — WMFWatchlistFilterViewModel.generateDataForNewFilterSettings has cognitive complexity 42 (threshold 15). Drivers by points: if/else 31 (33 pts), boolean chains 7, loops 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 · ReadingListsSyncOperation.executeSync (cognitive 42) · ×1
  • ReadingListsSyncOperation.executeSync (cognitive 42) WMF Framework/ReadingListsSyncOperation.swift:60 — ReadingListsSyncOperation.executeSync has cognitive complexity 42 (threshold 15). Drivers by points: if/else 27 (39 pts), boolean chains 3 (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 · ReadingListsSyncOperation.createOrUpdate (cognitive 42) · ×1
  • ReadingListsSyncOperation.createOrUpdate (cognitive 42) WMF Framework/ReadingListsSyncOperation.swift:914 — ReadingListsSyncOperation.createOrUpdate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 4 (5 pts), boolean chains 2 (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 · WMFNavigationBarConfiguring.configureNavigationBar (cognitive 41) · ×1
  • WMFNavigationBarConfiguring.configureNavigationBar (cognitive 41) WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:119 — WMFNavigationBarConfiguring.configureNavigationBar has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotificationsCenterViewController.userDidPanCell (cognitive 41) · ×1
  • NotificationsCenterViewController.userDidPanCell (cognitive 41) Wikipedia/Code/NotificationsCenterViewController.swift:778 — NotificationsCenterViewController.userDidPanCell has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 3 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 18). 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 · PageHistoryViewController.configure (cognitive 40) · ×1
  • PageHistoryViewController.configure (cognitive 40) Wikipedia/Code/PageHistoryViewController.swift:458 — PageHistoryViewController.configure has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (28 pts), ternaries 3 (10 pts), boolean chains 2 (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 · DetailTransition.animateTransition (cognitive 39) · ×1
  • DetailTransition.animateTransition (cognitive 39) Wikipedia/Code/DetailTransition.swift:36 — DetailTransition.animateTransition has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (21 pts), boolean chains 12, ternaries 4 (6 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 · DiffContainerViewController.completeRollbackOrUndo (cognitive 39) · ×1
  • DiffContainerViewController.completeRollbackOrUndo (cognitive 39) Wikipedia/Code/DiffContainerViewController.swift:1291 — DiffContainerViewController.completeRollbackOrUndo has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (31 pts), match/switch 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 17). 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 · Router.destinationForWResourceURL (cognitive 37) · ×1
  • Router.destinationForWResourceURL (cognitive 37) WMF Framework/Router.swift:163 — Router.destinationForWResourceURL has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 20, if/else 15 (16 pts), loops 1 (nesting depth added 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 · PlacesViewController.merge (cognitive 37) · ×1
  • PlacesViewController.merge (cognitive 37) Wikipedia/Code/PlacesViewController.swift:1402 — PlacesViewController.merge has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (22 pts), boolean chains 6, loops 2 (5 pts), ternaries 1 (4 pts) (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 · SavedAllArticlesCoordinator.fetchAllSavedArticles (cognitive 37) · ×1
  • SavedAllArticlesCoordinator.fetchAllSavedArticles (cognitive 37) Wikipedia/Code/SavedAllArticlesCoordinator.swift:435 — SavedAllArticlesCoordinator.fetchAllSavedArticles has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 21). 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 · ArticleCollectionViewCell.sizeThatFits (cognitive 36) · ×1
  • ArticleCollectionViewCell.sizeThatFits (cognitive 36) Wikipedia/Code/ArticleCollectionViewCell.swift:154 — ArticleCollectionViewCell.sizeThatFits has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 5 (14 pts), boolean chains 2 (nesting depth added 18). 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 · ArticlePeekPreviewViewController.contextMenuItems (cognitive 36) · ×1
  • ArticlePeekPreviewViewController.contextMenuItems (cognitive 36) Wikipedia/Code/ArticlePeekPreviewViewController.swift:115 — ArticlePeekPreviewViewController.contextMenuItems has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, ternaries 3 (6 pts), error handling 1 (2 pts) (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 · WMFAppViewController.processUserActivity (cognitive 36) · ×1
  • WMFAppViewController.processUserActivity (cognitive 36) Wikipedia/Code/WMFAppViewController.swift:1319 — WMFAppViewController.processUserActivity has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 2 (4 pts), boolean chains 3 (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 · TalkPageFindInPageSearchController.search (cognitive 34) · ×1
  • TalkPageFindInPageSearchController.search (cognitive 34) Wikipedia/Code/TalkPageFindInPageSearchController.swift:43 — TalkPageFindInPageSearchController.search has cognitive complexity 34 (threshold 15). Drivers by points: loops 6 (18 pts), if/else 6 (14 pts), boolean chains 2 (nesting depth added 20). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · TalkPageViewController.tappedPublish (cognitive 34) · ×1
  • TalkPageViewController.tappedPublish (cognitive 34) Wikipedia/Code/TalkPageViewController.swift:1136 — TalkPageViewController.tappedPublish has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HtmlUtils.addStyling (cognitive 33) · ×1
  • HtmlUtils.addStyling (cognitive 33) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:168 — HtmlUtils.addStyling has cognitive complexity 33 (threshold 15). Drivers by points: loops 14 (19 pts), if/else 6 (14 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · PageHistoryCollectionViewCell.sizeThatFits (cognitive 33) · ×1
  • PageHistoryCollectionViewCell.sizeThatFits (cognitive 33) Wikipedia/Code/PageHistoryCollectionViewCell.swift:173 — PageHistoryCollectionViewCell.sizeThatFits has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 8 (15 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 · WMFAppViewControllerTipWrapper.listenForTooltips (cognitive 32) · ×1
  • WMFAppViewControllerTipWrapper.listenForTooltips (cognitive 32) Wikipedia/Code/AppViewControllerTipWrapper.swift:28 — WMFAppViewControllerTipWrapper.listenForTooltips has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, ternaries 1 (3 pts), loops 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 · WMFAuthenticationManager.loginWithSavedCredentials (cognitive 32) · ×1
  • WMFAuthenticationManager.loginWithSavedCredentials (cognitive 32) Wikipedia/Code/WMFAuthenticationManager.swift:253 — WMFAuthenticationManager.loginWithSavedCredentials has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 2 (4 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 · HtmlUtils.listInsertData (cognitive 31) · ×1
  • HtmlUtils.listInsertData (cognitive 31) WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:518 — HtmlUtils.listInsertData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, match/switch 1 (2 pts) (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 · WMFActivityTabView.loggedInList (cognitive 31) · ×1
  • WMFActivityTabView.loggedInList (cognitive 31) WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabView.swift:80 — WMFActivityTabView.loggedInList has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 5 (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 · WMFBasicService.performPOST (cognitive 31) · ×1
  • WMFBasicService.performPOST (cognitive 31) WMFData/Sources/WMFData/Service/WMFBasicService.swift:59 — WMFBasicService.performPOST has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 1 (4 pts), error handling 1 (3 pts), boolean chains 2, match/switch 1 (2 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 · WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates (cognitive 31) · ×1
  • WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates (cognitive 31) WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:150 — WMFWikitextUtils.insertImageWikitextIntoArticleWikitextAfterTemplates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (27 pts), loops 3 (4 pts) (nesting depth added 15). 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 · ActionsView.sizeThatFits (cognitive 31) · ×1
  • ActionsView.sizeThatFits (cognitive 31) WMF Framework/CollectionViewCellActionsView.swift:89 — ActionsView.sizeThatFits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 4 (8 pts), loops 2 (6 pts), boolean chains 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 · SavedArticlesCollectionViewCell.sizeThatFits (cognitive 31) · ×1
  • SavedArticlesCollectionViewCell.sizeThatFits (cognitive 31) Wikipedia/Code/SavedArticlesCollectionViewCell.swift:134 — SavedArticlesCollectionViewCell.sizeThatFits has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 4 (8 pts), boolean chains 4 (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 · TalkPageViewController.tappedPublish (cognitive 31) · ×1
  • TalkPageViewController.tappedPublish (cognitive 31) Wikipedia/Code/TalkPageViewController.swift:1231 — TalkPageViewController.tappedPublish has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 5, match/switch 2 (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 · ReadingListsSyncOperation.executeRandomArticlePopulation (cognitive 30) · ×1
  • ReadingListsSyncOperation.executeRandomArticlePopulation (cognitive 30) WMF Framework/ReadingListsSyncOperation.swift:379 — ReadingListsSyncOperation.executeRandomArticlePopulation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (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 · ReadingListsSyncOperation.createOrUpdate (cognitive 30) · ×1
  • ReadingListsSyncOperation.createOrUpdate (cognitive 30) WMF Framework/ReadingListsSyncOperation.swift:1010 — ReadingListsSyncOperation.createOrUpdate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 5 (8 pts), boolean chains 2 (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 · WidgetController.fetchTopReadContent (cognitive 30) · ×1
  • WidgetController.fetchTopReadContent (cognitive 30) WMF Framework/Widget/WidgetController.swift:370 — WidgetController.fetchTopReadContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 2 (5 pts), loops 1 (3 pts), boolean chains 2, ternaries 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 · DiffListChangeItemViewModel.calculateAttributedString (cognitive 30) · ×1
  • DiffListChangeItemViewModel.calculateAttributedString (cognitive 30) Wikipedia/Code/DiffListChangeItemViewModel.swift:302 — DiffListChangeItemViewModel.calculateAttributedString has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (7 pts), boolean chains 5, match/switch 3 (5 pts), loops 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 · PlacesViewController.updatePlaces (cognitive 30) · ×1
  • PlacesViewController.updatePlaces (cognitive 30) Wikipedia/Code/PlacesViewController.swift:843 — PlacesViewController.updatePlaces has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 8, loops 2 (4 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 · ArticleCacheController.syncCachedResources (cognitive 29) · ×1
  • ArticleCacheController.syncCachedResources (cognitive 29) WMF Framework/ArticleCacheController.swift:20 — ArticleCacheController.syncCachedResources has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 5 (15 pts), if/else 4 (9 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 17). 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 · NotificationsCenterDetailViewModel.primaryAction (cognitive 29) · ×1
  • NotificationsCenterDetailViewModel.primaryAction (cognitive 29) Wikipedia/Code/NotificationsCenterDetailViewModel.swift:4 — NotificationsCenterDetailViewModel.primaryAction has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (26 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 · WMFWatchlistDataController.fetchWatchlist (cognitive 28) · ×1
  • WMFWatchlistDataController.fetchWatchlist (cognitive 28) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:103 — WMFWatchlistDataController.fetchWatchlist has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (2 pts), boolean chains 1, loops 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 · WMFArticleTabsDataController.appendArticle (cognitive 27) · ×1
  • WMFArticleTabsDataController.appendArticle (cognitive 27) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:340 — WMFArticleTabsDataController.appendArticle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3, 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 · WMFArticleTabsDataController.fetchAllArticleTabs (cognitive 27) · ×1
  • WMFArticleTabsDataController.fetchAllArticleTabs (cognitive 27) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:768 — WMFArticleTabsDataController.fetchAllArticleTabs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, loops 2 (3 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 · WMFExperimentsDataController.determineBucketForExperiment (cognitive 27) · ×1
  • WMFExperimentsDataController.determineBucketForExperiment (cognitive 27) WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift:117 — WMFExperimentsDataController.determineBucketForExperiment has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CacheController.finishDBAdd (cognitive 27) · ×1
  • CacheController.finishDBAdd (cognitive 27) WMF Framework/CacheController.swift:186 — CacheController.finishDBAdd has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 3 (8 pts), loops 1 (2 pts), boolean chains 1 (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 · ExploreCardCollectionViewCell.sizeThatFits (cognitive 27) · ×1
  • ExploreCardCollectionViewCell.sizeThatFits (cognitive 27) WMF Framework/ExploreCardCollectionViewCell.swift:204 — ExploreCardCollectionViewCell.sizeThatFits has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 5 (9 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 · MediaWikiFetcher.perform (cognitive 27) · ×1
  • MediaWikiFetcher.perform (cognitive 27) WMF Framework/MediaWikiFetcher.swift:53 — MediaWikiFetcher.perform has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 2 (4 pts), boolean chains 3 (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 · DiffTransformer.transformSectionInfosOfItems (cognitive 27) · ×1
  • DiffTransformer.transformSectionInfosOfItems (cognitive 27) Wikipedia/Code/DiffTransformer.swift:182 — DiffTransformer.transformSectionInfosOfItems has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (7 pts), boolean chains 4 (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 · WMFArticleTabsDataController.getAdjacentArticleInTab (cognitive 26) · ×1
  • WMFArticleTabsDataController.getAdjacentArticleInTab (cognitive 26) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:422 — WMFArticleTabsDataController.getAdjacentArticleInTab has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 10, 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 · CollectionViewUpdater.performBatchUpdates (cognitive 26) · ×1
  • CollectionViewUpdater.performBatchUpdates (cognitive 26) Wikipedia/Code/CollectionViewUpdater.swift:178 — CollectionViewUpdater.performBatchUpdates has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 2 (4 pts), loops 2, 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 · SavedArticlesFetcher._update (cognitive 26) · ×1
  • SavedArticlesFetcher._update (cognitive 26) Wikipedia/Code/SavedArticlesFetcher.swift:164 — SavedArticlesFetcher._update has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 6 (9 pts), boolean chains 4, error handling 2 (3 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 · Session.request (cognitive 26) · ×1
  • Session.request (cognitive 26) Wikipedia/Code/Session.swift:230 — Session.request has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 1 (3 pts), boolean chains 2, loops 2, 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 · WMFForYouArticleCardView.body (cognitive 25) · ×1
  • WMFForYouArticleCardView.body (cognitive 25) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift:879 — WMFForYouArticleCardView.body has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (7 pts), match/switch 3 (4 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 · ColumnarCollectionViewLayout.prepare (cognitive 25) · ×1
  • ColumnarCollectionViewLayout.prepare (cognitive 25) WMF Framework/ColumnarCollectionViewLayout.swift:190 — ColumnarCollectionViewLayout.prepare has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WMFArticleSavedStateMigrationManager.runMigration (cognitive 25) · ×1
  • WMFArticleSavedStateMigrationManager.runMigration (cognitive 25) WMF Framework/WMFArticle+Migration.swift:117 — WMFArticleSavedStateMigrationManager.runMigration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3 (5 pts), loops 2 (4 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 · ArticleTabCoordinating.trackArticleTab (cognitive 25) · ×1
  • ArticleTabCoordinating.trackArticleTab (cognitive 25) Wikipedia/Code/ArticleCoordinator.swift:32 — ArticleTabCoordinating.trackArticleTab has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (7 pts), boolean chains 3, error handling 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 · EditSaveViewController.handleEditFailure (cognitive 25) · ×1
  • EditSaveViewController.handleEditFailure (cognitive 25) Wikipedia/Code/EditSaveViewController.swift:574 — EditSaveViewController.handleEditFailure has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, 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 · ExploreViewController.collectionView (cognitive 25) · ×1
  • ExploreViewController.collectionView (cognitive 25) Wikipedia/Code/ExploreViewController.swift:613 — ExploreViewController.collectionView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 6, ternaries 1 (3 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 · HomeCoordinator.makeHomeViewController (cognitive 25) · ×1
  • HomeCoordinator.makeHomeViewController (cognitive 25) Wikipedia/Code/HomeCoordinator.swift:53 — HomeCoordinator.makeHomeViewController has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13, boolean chains 12. 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 · PageHistoryViewController.collectionView (cognitive 25) · ×1
  • PageHistoryViewController.collectionView (cognitive 25) Wikipedia/Code/PageHistoryViewController.swift:702 — PageHistoryViewController.collectionView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6 (nesting depth added 10). 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 · ViewControllerRouter.route (cognitive 25) · ×1
  • ViewControllerRouter.route (cognitive 25) Wikipedia/Code/ViewControllerRouter.swift:89 — ViewControllerRouter.route has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 1 (nesting depth added 9). 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 · CacheController.remove (cognitive 24) · ×1
  • CacheController.remove (cognitive 24) WMF Framework/CacheController.swift:290 — CacheController.remove has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 4 (10 pts), loops 1 (2 pts) (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 · ArticleRightAlignedImageCollectionViewCell.sizeThatFits (cognitive 24) · ×1
  • ArticleRightAlignedImageCollectionViewCell.sizeThatFits (cognitive 24) Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:41 — ArticleRightAlignedImageCollectionViewCell.sizeThatFits has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 5 (10 pts), boolean chains 4 (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 · DiffListChangeItemViewModel.moveAttributedString (cognitive 24) · ×1
  • DiffListChangeItemViewModel.moveAttributedString (cognitive 24) Wikipedia/Code/DiffListChangeItemViewModel.swift:130 — DiffListChangeItemViewModel.moveAttributedString has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 5 (7 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (2 pts) (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 · PageHistoryCollectionViewCell.apply (cognitive 24) · ×1
  • PageHistoryCollectionViewCell.apply (cognitive 24) Wikipedia/Code/PageHistoryCollectionViewCell.swift:270 — PageHistoryCollectionViewCell.apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageHistoryFetcher.fetchEditCounts (cognitive 24) · ×1
  • PageHistoryFetcher.fetchEditCounts (cognitive 24) Wikipedia/Code/PageHistoryFetcher.swift:155 — PageHistoryFetcher.fetchEditCounts has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, 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 · SchemeHandler.kickOffDataTask (cognitive 24) · ×1
  • SchemeHandler.kickOffDataTask (cognitive 24) Wikipedia/Code/SchemeHandler/SchemeHandler.swift:163 — SchemeHandler.kickOffDataTask has cognitive complexity 24 (threshold 15). Drivers by points: if/else 20 (23 pts), 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 · GenerateTopicsStrings.swift.injectIntoStringsFile (cognitive 24) · ×1
  • GenerateTopicsStrings.swift.injectIntoStringsFile (cognitive 24) scripts/GenerateTopicsStrings.swift:291 — GenerateTopicsStrings.swift.injectIntoStringsFile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 2, ternaries 1 (2 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 · localization.swift.exportLocalizationsFromSourceCode (cognitive 24) · ×1
  • localization.swift.exportLocalizationsFromSourceCode (cognitive 24) Command Line Tools/Update Localizations/localization.swift:341 — localization.swift.exportLocalizationsFromSourceCode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (6 pts), boolean chains 2, error handling 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 · WMFEditorInputView.didSelectIndex (cognitive 23) · ×1
  • WMFEditorInputView.didSelectIndex (cognitive 23) WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift:419 — WMFEditorInputView.didSelectIndex has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 8 (15 pts), if/else 8 (nesting depth added 7). 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 · WMFArticleDataController.fetchArticleInfo (cognitive 23) · ×1
  • WMFArticleDataController.fetchArticleInfo (cognitive 23) WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleDataController.swift:102 — WMFArticleDataController.fetchArticleInfo has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (3 pts), boolean chains 2, 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 · WidgetController.fetchPictureOfTheDayContent (cognitive 23) · ×1
  • WidgetController.fetchPictureOfTheDayContent (cognitive 23) WMF Framework/Widget/WidgetController.swift:553 — WidgetController.fetchPictureOfTheDayContent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, 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 · DiffListViewController.didTapItem (cognitive 23) · ×1
  • DiffListViewController.didTapItem (cognitive 23) Wikipedia/Code/DiffListViewController.swift:383 — DiffListViewController.didTapItem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), loops 2 (4 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 · NotificationsCenterViewController.userDidTapMoreActionForCell (cognitive 23) · ×1
  • NotificationsCenterViewController.userDidTapMoreActionForCell (cognitive 23) Wikipedia/Code/NotificationsCenterViewController.swift:870 — NotificationsCenterViewController.userDidTapMoreActionForCell has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, 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 · PlacesViewController.updateSearchSuggestions (cognitive 23) · ×1
  • PlacesViewController.updateSearchSuggestions (cognitive 23) Wikipedia/Code/PlacesViewController.swift:1981 — PlacesViewController.updateSearchSuggestions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (4 pts), match/switch 2 (3 pts), boolean chains 2, error handling 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 · SavedArticlesFetcher.handleFailure (cognitive 23) · ×1
  • SavedArticlesFetcher.handleFailure (cognitive 23) Wikipedia/Code/SavedArticlesFetcher.swift:308 — SavedArticlesFetcher.handleFailure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 5). 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 · WMFDailyGameContentSource.loadNewContent (cognitive 23) · ×1
  • WMFDailyGameContentSource.loadNewContent (cognitive 23) Wikipedia/Code/WMFDailyGameContentSource.swift:26 — WMFDailyGameContentSource.loadNewContent has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 1 (4 pts), boolean chains 2, error handling 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WMFContentGroup.imageURLsCompatibleWithTraitCollection (cognitive 23) · ×1
  • WMFContentGroup.imageURLsCompatibleWithTraitCollection (cognitive 23) WMF Framework/WMFContentGroup+Display.swift:15 — WMFContentGroup.imageURLsCompatibleWithTraitCollection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 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 · CollectionViewEditController.handlePanGesture (cognitive 22) · ×1
  • CollectionViewEditController.handlePanGesture (cognitive 22) WMF Framework/CollectionViewEditController.swift:264 — CollectionViewEditController.handlePanGesture has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (7 pts), boolean chains 2, 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 · ReadingList.updateArticlesAndEntries (cognitive 22) · ×1
  • ReadingList.updateArticlesAndEntries (cognitive 22) WMF Framework/ReadingList+CoreDataClass.swift:34 — ReadingList.updateArticlesAndEntries has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 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 · WikipediaLanguageCommandLineUtility.getSiteInfoLookup (cognitive 22) · ×1
  • WikipediaLanguageCommandLineUtility.getSiteInfoLookup (cognitive 22) Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtility.swift:72 — WikipediaLanguageCommandLineUtility.getSiteInfoLookup has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, if/else 2 (3 pts), loops 2 (nesting depth added 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 · WikipediaLanguageCommandLineUtilityAPI.getSites (cognitive 22) · ×1
  • WikipediaLanguageCommandLineUtilityAPI.getSites (cognitive 22) Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift:22 — WikipediaLanguageCommandLineUtilityAPI.getSites has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7 (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 · TableOfContentsAnimator.gestureRecognizerShouldBegin (cognitive 22) · ×1
  • TableOfContentsAnimator.gestureRecognizerShouldBegin (cognitive 22) Wikipedia/Code/TableOfContentsAnimator.swift:313 — TableOfContentsAnimator.gestureRecognizerShouldBegin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, match/switch 1 (2 pts) (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 · DatabasePopulationViewModel.populateViewedArticles (cognitive 22) · ×1
  • DatabasePopulationViewModel.populateViewedArticles (cognitive 22) Wikipedia/Code/Database Population/DatabasePopulationViewModel.swift:110 — DatabasePopulationViewModel.populateViewedArticles has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, error handling 1 (3 pts), loops 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 · WMFFont.`for` (cognitive 21) · ×1
  • WMFFont.`for` (cognitive 21) WMFComponents/Sources/WMFComponents/Style/WMFFont.swift:61 — WMFFont.`for` has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ArticleFetcher.fetchMediaListURLs (cognitive 21) · ×1
  • ArticleFetcher.fetchMediaListURLs (cognitive 21) Wikipedia/Code/ArticleFetcher.swift:51 — ArticleFetcher.fetchMediaListURLs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (6 pts), boolean chains 3, 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 · ArticlePlaceView.setSelected (cognitive 21) · ×1
  • ArticlePlaceView.setSelected (cognitive 21) Wikipedia/Code/ArticlePlaceView.swift:408 — ArticlePlaceView.setSelected has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 3, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cognitive 21) · ×1
  • ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cognitive 21) Wikipedia/Code/ArticleViewController.swift:14 — ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8 (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 · DiffListChangeItemViewModel.constructAccessibilityLabel (cognitive 21) · ×1
  • DiffListChangeItemViewModel.constructAccessibilityLabel (cognitive 21) Wikipedia/Code/DiffListChangeItemViewModel.swift:229 — DiffListChangeItemViewModel.constructAccessibilityLabel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (6 pts), boolean chains 1, loops 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 · ThanksGiving.tappedThank (cognitive 21) · ×1
  • ThanksGiving.tappedThank (cognitive 21) Wikipedia/Code/ThanksGiving.swift:35 — ThanksGiving.tappedThank has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), match/switch 4 (6 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 · MWKDataStore.migrateWikipediaEntities (cognitive 21) · ×1
  • MWKDataStore.migrateWikipediaEntities (cognitive 21) WMF Framework/MWKDataStore+LanguageVariantMigration.swift:161 — MWKDataStore.migrateWikipediaEntities has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (7 pts), error handling 2 (4 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · AppleStringsFile.readFromVariable (cognitive 21) · ×1
  • AppleStringsFile.readFromVariable (cognitive 21) scripts/update-qqq.php:29 — AppleStringsFile.readFromVariable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 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 · WMFSurveyView.body (cognitive 20) · ×1
  • WMFSurveyView.body (cognitive 20) WMFComponents/Sources/WMFComponents/Components/Shared/Survey/WMFSurveyView.swift:49 — WMFSurveyView.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 2 (3 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (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 · WMFArticle.merge (cognitive 20) · ×1
  • WMFArticle.merge (cognitive 20) WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift:4 — WMFArticle.merge has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 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 · PermanentlyPersistableURLCache.updateCacheWithCachedResponse (cognitive 20) · ×1
  • PermanentlyPersistableURLCache.updateCacheWithCachedResponse (cognitive 20) WMF Framework/PermanentlyPersistableURLCache.swift:452 — PermanentlyPersistableURLCache.updateCacheWithCachedResponse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 8, match/switch 2, ternaries 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 · ReadingListsSyncOperation.execute (cognitive 20) · ×1
  • ReadingListsSyncOperation.execute (cognitive 20) WMF Framework/ReadingListsSyncOperation.swift:11 — ReadingListsSyncOperation.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 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 · WidgetController.fetchFeaturedArticleContent (cognitive 20) · ×1
  • WidgetController.fetchFeaturedArticleContent (cognitive 20) WMF Framework/Widget/WidgetController.swift:489 — WidgetController.fetchFeaturedArticleContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WMFActivityTabViewController.viewDidLoad (cognitive 20) · ×1
  • WMFActivityTabViewController.viewDidLoad (cognitive 20) Wikipedia/Code/ActivityTabViewController.swift:40 — WMFActivityTabViewController.viewDidLoad has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 3 (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 · EditorViewController.loadContent (cognitive 20) · ×1
  • EditorViewController.loadContent (cognitive 20) Wikipedia/Code/EditorViewController.swift:192 — EditorViewController.loadContent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 6, match/switch 2. 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 · ColumnarCollectionViewLayout.layoutAttributesForElements (cognitive 19) · ×1
  • ColumnarCollectionViewLayout.layoutAttributesForElements (cognitive 19) WMF Framework/ColumnarCollectionViewLayout.swift:35 — ColumnarCollectionViewLayout.layoutAttributesForElements has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 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 · PageNamespace.isTalkBased (cognitive 19) · ×1
  • PageNamespace.isTalkBased (cognitive 19) WMF Framework/PageNamespace.swift:91 — PageNamespace.isTalkBased has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 19. 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 · RemoteNotificationsController.predicateForFilterSavedState (cognitive 19) · ×1
  • RemoteNotificationsController.predicateForFilterSavedState (cognitive 19) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:404 — RemoteNotificationsController.predicateForFilterSavedState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, match/switch 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 · ActivityTabFunnel.logActivityTabCustomizeExit (cognitive 19) · ×1
  • ActivityTabFunnel.logActivityTabCustomizeExit (cognitive 19) Wikipedia/Code/ActivityTabFunnel.swift:136 — ActivityTabFunnel.logActivityTabCustomizeExit has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7, if/else 3 (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 · AppearanceSettingsViewController.tableView (cognitive 19) · ×1
  • AppearanceSettingsViewController.tableView (cognitive 19) Wikipedia/Code/AppearanceSettingsViewController.swift:158 — AppearanceSettingsViewController.tableView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (3 pts), boolean chains 2 (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 · ArticleViewController.showNewDonateExperienceCampaignModal (cognitive 19) · ×1
  • ArticleViewController.showNewDonateExperienceCampaignModal (cognitive 19) Wikipedia/Code/ArticleViewController.swift:108 — ArticleViewController.showNewDonateExperienceCampaignModal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, 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 · DiffContainerViewController.evaluateState (cognitive 19) · ×1
  • DiffContainerViewController.evaluateState (cognitive 19) Wikipedia/Code/DiffContainerViewController.swift:534 — DiffContainerViewController.evaluateState has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 7 (9 pts) (nesting depth added 6). 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 · DiffListChangeItemViewModel.calculateTextPaddingAndInBetweenSpacing (cognitive 19) · ×1
  • DiffListChangeItemViewModel.calculateTextPaddingAndInBetweenSpacing (cognitive 19) Wikipedia/Code/DiffListChangeItemViewModel.swift:99 — DiffListChangeItemViewModel.calculateTextPaddingAndInBetweenSpacing has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), ternaries 2 (4 pts), 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 · DiffListViewController.updateListViewModels (cognitive 19) · ×1
  • DiffListViewController.updateListViewModels (cognitive 19) Wikipedia/Code/DiffListViewController.swift:157 — DiffListViewController.updateListViewModels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · PlacesViewController.handlePanGesture (cognitive 19) · ×1
  • PlacesViewController.handlePanGesture (cognitive 19) Wikipedia/Code/PlacesViewController.swift:1057 — PlacesViewController.handlePanGesture has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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 · SceneDelegate.openURLContexts (cognitive 19) · ×1
  • SceneDelegate.openURLContexts (cognitive 19) Wikipedia/Code/SceneDelegate.swift:176 — SceneDelegate.openURLContexts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (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 · SinglePageWebViewController.handleNavigation (cognitive 19) · ×1
  • SinglePageWebViewController.handleNavigation (cognitive 19) Wikipedia/Code/SinglePageWebViewController.swift:389 — SinglePageWebViewController.handleNavigation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TalkPageViewController.scrollToFindInPageResultRect (cognitive 19) · ×1
  • TalkPageViewController.scrollToFindInPageResultRect (cognitive 19) Wikipedia/Code/TalkPageViewController.swift:48 — TalkPageViewController.scrollToFindInPageResultRect has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WMFAccountCreationViewController.createAccount (cognitive 19) · ×1
  • WMFAccountCreationViewController.createAccount (cognitive 19) REDACTED:517 — WMFAccountCreationViewController.createAccount has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 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 · WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cognitive 19) · ×1
  • WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cognitive 19) Wikipedia/Code/WMFAppViewController.swift:495 — WMFAppViewController.logWatchlistUserDidSaveFilterSettings has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7 (9 pts), if/else 6 (7 pts), boolean chains 2, loops 1 (nesting depth added 3). 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 · WMFAppViewController.logTabBarSelectionsForActivityTab (cognitive 19) · ×1
  • WMFAppViewController.logTabBarSelectionsForActivityTab (cognitive 19) Wikipedia/Code/WMFAppViewController.swift:1261 — WMFAppViewController.logTabBarSelectionsForActivityTab has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3 (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 · WMFHCaptchaViewController.setupHCaptcha (cognitive 19) · ×1
  • WMFHCaptchaViewController.setupHCaptcha (cognitive 19) Wikipedia/Code/WMFHCaptchaViewController.swift:98 — WMFHCaptchaViewController.setupHCaptcha has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 2 (4 pts), error handling 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 · WikidataFetcher.processResponse (cognitive 19) · ×1
  • WikidataFetcher.processResponse (cognitive 19) Wikipedia/Code/WikidataFetcher.swift:197 — WikidataFetcher.processResponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (3 pts), boolean chains 2 (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 · MWKDataStore.migrateNewVariants (cognitive 19) · ×1
  • MWKDataStore.migrateNewVariants (cognitive 19) WMF Framework/MWKDataStore+LanguageVariantMigration.swift:110 — MWKDataStore.migrateNewVariants has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (10 pts), error handling 4 (8 pts), if/else 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · WMFContentGroup.detailViewControllerWithDataStore (cognitive 19) · ×1
  • WMFContentGroup.detailViewControllerWithDataStore (cognitive 19) WMF Framework/WMFContentGroup+Display.swift:34 — WMFContentGroup.detailViewControllerWithDataStore has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), match/switch 2 (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 · WMFDonateViewModel.paymentAuthorizationController (cognitive 18) · ×1
  • WMFDonateViewModel.paymentAuthorizationController (cognitive 18) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:546 — WMFDonateViewModel.paymentAuthorizationController has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (4 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ColumnarCollectionViewLayoutSection.invalidate (cognitive 18) · ×1
  • ColumnarCollectionViewLayoutSection.invalidate (cognitive 18) WMF Framework/ColumarCollectionViewLayoutSection.swift:155 — ColumnarCollectionViewLayoutSection.invalidate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). 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 · ArticlePlaceView.set (cognitive 18) · ×1
  • ArticlePlaceView.set (cognitive 18) Wikipedia/Code/ArticlePlaceView.swift:191 — ArticlePlaceView.set has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 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 · ArticleToolbarController.createMoreMenu (cognitive 18) · ×1
  • ArticleToolbarController.createMoreMenu (cognitive 18) Wikipedia/Code/ArticleToolbarController.swift:125 — ArticleToolbarController.createMoreMenu has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 3 (5 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 · DonateCoordinator.nativeDonateFormViewModel (cognitive 18) · ×1
  • DonateCoordinator.nativeDonateFormViewModel (cognitive 18) Wikipedia/Code/DonateCoordinator.swift:461 — DonateCoordinator.nativeDonateFormViewModel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ExploreViewController.exploreCardViewController (cognitive 18) · ×1
  • ExploreViewController.exploreCardViewController (cognitive 18) Wikipedia/Code/ExploreViewController.swift:792 — ExploreViewController.exploreCardViewController has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, match/switch 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 · PageHistoryViewController.getEditCounts (cognitive 18) · ×1
  • PageHistoryViewController.getEditCounts (cognitive 18) Wikipedia/Code/PageHistoryViewController.swift:189 — PageHistoryViewController.getEditCounts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (5 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 · SavedAllArticlesCoordinator.determineAlertType (cognitive 18) · ×1
  • SavedAllArticlesCoordinator.determineAlertType (cognitive 18) Wikipedia/Code/SavedAllArticlesCoordinator.swift:359 — SavedAllArticlesCoordinator.determineAlertType has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (5 pts) (nesting depth added 5). 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 · SessionDelegate.urlSession (cognitive 18) · ×1
  • SessionDelegate.urlSession (cognitive 18) Wikipedia/Code/Session.swift:736 — SessionDelegate.urlSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5 (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 · WMFArticleTabsViewModel.prefetchBatch (cognitive 17) · ×1
  • WMFArticleTabsViewModel.prefetchBatch (cognitive 17) WMFComponents/Sources/WMFComponents/Components/Article Tabs/WMFArticleTabsViewModel.swift:330 — WMFArticleTabsViewModel.prefetchBatch has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 4 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (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 · WMFCommunityFeedView.feedList (cognitive 17) · ×1
  • WMFCommunityFeedView.feedList (cognitive 17) WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift:39 — WMFCommunityFeedView.feedList has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 7. 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 · WMFDonateDataController.submitPayment (cognitive 17) · ×1
  • WMFDonateDataController.submitPayment (cognitive 17) WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFDonateDataController.swift:204 — WMFDonateDataController.submitPayment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, ternaries 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 2). 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 · WMFGamesDataController.makeWhichCameFirstQuestions (cognitive 17) · ×1
  • WMFGamesDataController.makeWhichCameFirstQuestions (cognitive 17) WMFData/Sources/WMFData/Data Controllers/Games/WMFGamesDataController.swift:363 — WMFGamesDataController.makeWhichCameFirstQuestions has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 5, if/else 4 (5 pts), loops 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 · DiffFetcher.fetchWikitext (cognitive 17) · ×1
  • DiffFetcher.fetchWikitext (cognitive 17) Wikipedia/Code/DiffFetcher.swift:44 — DiffFetcher.fetchWikitext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 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 · ExploreFeedSettingsViewController.settingsTableViewCell (cognitive 17) · ×1
  • ExploreFeedSettingsViewController.settingsTableViewCell (cognitive 17) Wikipedia/Code/ExploreFeedSettingsViewController.swift:357 — ExploreFeedSettingsViewController.settingsTableViewCell has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 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 · OldTalkPageReplyCell.sizeThatFits (cognitive 17) · ×1
  • OldTalkPageReplyCell.sizeThatFits (cognitive 17) Wikipedia/Code/OldTalkPageReplyCell.swift:34 — OldTalkPageReplyCell.sizeThatFits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (6 pts), 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 · TalkPageReplyComposeController.userDidPanContainerView (cognitive 17) · ×1
  • TalkPageReplyComposeController.userDidPanContainerView (cognitive 17) Wikipedia/Code/TalkPageReplyComposeController.swift:257 — TalkPageReplyComposeController.userDidPanContainerView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, 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 · WikimediaProject.init (cognitive 17) · ×1
  • WikimediaProject.init (cognitive 17) Wikipedia/Code/WikimediaProject.swift:92 — WikimediaProject.init has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14, boolean chains 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 · UIView.wmf_preferredFrame (cognitive 17) · ×1
  • UIView.wmf_preferredFrame (cognitive 17) WMF Framework/UIStackView+SubviewVerification.swift:20 — UIView.wmf_preferredFrame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 6, match/switch 2. 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 · localization.swift.writeStrings (cognitive 17) · ×1
  • localization.swift.writeStrings (cognitive 17) Command Line Tools/Update Localizations/localization.swift:297 — localization.swift.writeStrings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (3 pts), boolean chains 1, 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 · WMFBasicService.performGET (cognitive 16) · ×1
  • WMFBasicService.performGET (cognitive 16) WMFData/Sources/WMFData/Service/WMFBasicService.swift:148 — WMFBasicService.performGET has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, 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 · WMFGamesDataController.fetchWhichCameFirstStats (cognitive 16) · ×1
  • WMFGamesDataController.fetchWhichCameFirstStats (cognitive 16) WMFData/Sources/WMFData/Data Controllers/Games/WMFGamesDataController.swift:195 — WMFGamesDataController.fetchWhichCameFirstStats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, loops 1, ternaries 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 · WMFYearInReviewDataController.populateYearInReviewReportData (cognitive 16) · ×1
  • WMFYearInReviewDataController.populateYearInReviewReportData (cognitive 16) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:478 — WMFYearInReviewDataController.populateYearInReviewReportData has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3, error handling 1 (2 pts), boolean chains 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 · ExploreFeedPreferencesUpdateCoordinator.coordinateUpdate (cognitive 16) · ×1
  • ExploreFeedPreferencesUpdateCoordinator.coordinateUpdate (cognitive 16) WMF Framework/ExploreFeedPreferencesUpdateCoordinator.swift:22 — ExploreFeedPreferencesUpdateCoordinator.coordinateUpdate 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 · ReadingListsAPIController.addEntriesToList (cognitive 16) · ×1
  • ReadingListsAPIController.addEntriesToList (cognitive 16) WMF Framework/ReadingListsAPIController.swift:352 — ReadingListsAPIController.addEntriesToList has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 1 (3 pts), loops 1 (2 pts), boolean chains 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 · ArticleCacheDBWriter.add (cognitive 16) · ×1
  • ArticleCacheDBWriter.add (cognitive 16) Wikipedia/Code/ArticleCacheDBWriter.swift:43 — ArticleCacheDBWriter.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 2 (4 pts), match/switch 2 (3 pts), error handling 1 (2 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 · EditSaveViewController.handleEditSuccess (cognitive 16) · ×1
  • EditSaveViewController.handleEditSuccess (cognitive 16) Wikipedia/Code/EditSaveViewController.swift:523 — EditSaveViewController.handleEditSuccess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (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 · InsertMediaSearchViewController.search (cognitive 16) · ×1
  • InsertMediaSearchViewController.search (cognitive 16) Wikipedia/Code/InsertMediaSearchViewController.swift:48 — InsertMediaSearchViewController.search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 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 · TalkPageArchivesView.body (cognitive 16) · ×1
  • TalkPageArchivesView.body (cognitive 16) Wikipedia/Code/TalkPageArchivesView.swift:30 — TalkPageArchivesView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 2 (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 · TalkPageTopicComposeViewController.tappedPublish (cognitive 16) · ×1
  • TalkPageTopicComposeViewController.tappedPublish (cognitive 16) Wikipedia/Code/TalkPageTopicComposeViewController.swift:535 — TalkPageTopicComposeViewController.tappedPublish has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 1 (2 pts) (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 · WMFAccountCreator.createAccount (cognitive 16) · ×1
  • WMFAccountCreator.createAccount (cognitive 16) Wikipedia/Code/WMFAccountCreator.swift:162 — WMFAccountCreator.createAccount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 1 (3 pts), boolean chains 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 · WMFAppViewController.configureTabController (cognitive 16) · ×1
  • WMFAppViewController.configureTabController (cognitive 16) Wikipedia/Code/WMFAppViewController.swift:367 — WMFAppViewController.configureTabController has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). 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 · WMFAuthenticationManager.logout (cognitive 16) · ×1
  • WMFAuthenticationManager.logout (cognitive 16) Wikipedia/Code/WMFAuthenticationManager.swift:425 — WMFAuthenticationManager.logout has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3 (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 · WMFLoginViewController.save (cognitive 16) · ×1
  • WMFLoginViewController.save (cognitive 16) REDACTED:233 — WMFLoginViewController.save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (4 pts), boolean chains 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 · WikitextFetcher.fetchSection (cognitive 16) · ×1
  • WikitextFetcher.fetchSection (cognitive 16) Wikipedia/Code/WikitextFetcher.swift:74 — WikitextFetcher.fetchSection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, match/switch 1 (nesting depth added 2). 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 · UIViewController.push (cognitive 16) · ×1
  • UIViewController.push (cognitive 16) Wikipedia/Code/FundraisingAnnouncementPanel.swift:4 — UIViewController.push has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (16 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 · Locale.uniqueWikipediaLanguages (cognitive 16) · ×1
  • Locale.uniqueWikipediaLanguages (cognitive 16) Wikipedia/Code/NSLocale+WMFExtras.swift:52 — Locale.uniqueWikipediaLanguages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), loops 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.
D22 · Internal API Consistency · Redundant lifecycle method across component types. While these are distinct types, the method `appEnvironmentDidChange` appears on 5 different component-related types with identical signatures and likely identical implementation logic (reacting to theme/trait changes). This suggests a shared protocol or base class could unify this behavior, reducing boilerplate and ensuring consistent handling of environment changes across the component hierarchy. · ×1
  • Redundant lifecycle method across component types. While these are distinct types, the method `appEnvironmentDidChange` appears on 5 different component-related types with identical signatures and likely identical implementation logic (reacting to theme/trait changes). This suggests a shared protocol or base class could unify this behavior, reducing boilerplate and ensuring consistent handling of environment changes across the component hierarchy. — Extract `appEnvironmentDidChange()` into a common protocol (e.g., `EnvironmentAwareComponent`) or a base class that all these component types inherit from or conform to. (signatures: WMFComponentHostingController.appEnvironmentDidChange() | WMFComponentNavigationController.appEnvironmentDidChange() | WMFComponentView.appEnvironmentDidChange() | WMFComponentViewController.appEnvironmentDidChange() | WMFCanvas.appEnvironmentDidChange())
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (4 members, 12 shared lines) · ×1
  • Near-duplicate member family (4 members, 12 shared lines) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:54 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:54-68 | WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift:33-47 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:92-142 | WMFComponents/Sources/WMFComponents/Components/Watchlist/Filter/WMFWatchlistFilterViewModel.swift:38-66 — These 4 members are variants of one another: a block of 12 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 (22 shared lines) · ×1
  • Near-duplicate member pair (22 shared lines) WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:51 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:51-100 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsViewModel.swift:46-77 — These two members are variants of one another: 22 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 (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) Wikipedia/Code/TalkPageTopicComposeViewController+TalkPageFormattingToolbar.swift:16 — Wikipedia/Code/TalkPageTopicComposeViewController+TalkPageFormattingToolbar.swift:16-41 | Wikipedia/Code/TalkPageViewController+TalkPageFormattingToolbar.swift:19-45 — These two members are one piece of code written twice and then edited apart: 22 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 · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:56 — WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:56-79 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:51-74 — These two members are one piece of code written twice and then edited apart: 24 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 (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) Wikipedia/Code/DiffContainerViewController.swift:998 — Wikipedia/Code/DiffContainerViewController.swift:998-1011 | Wikipedia/Code/NotificationsCenterViewController.swift:593-631 | Wikipedia/Code/ReadingListsAlertController.swift:95-123 | Wikipedia/Code/ThanksGiving.swift:35-140 | Wikipedia/Code/UIViewController+Extensions.swift:81-126 | Wikipedia/Code/UIViewController+Extensions.swift:136-156 | Wikipedia/Code/UIViewController+Extensions.swift:171-185 | Wikipedia/Code/UIViewController+Extensions.swift:187-206 | Wikipedia/Code/UIViewController+Extensions.swift:208-227 | Wikipedia/Code/UIViewController+Extensions.swift:229-242 — These 10 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 10 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 10 times.
D4 · Code Duplication · Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (9 members, 50+ identical tokens) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:562 — WMF Framework/Remote Notifications/RemoteNotificationsController.swift:562-624 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Main/WMFHomeFeedSettingsViewModel.swift:12-38 | Wikipedia/Code/ArticleViewController+DonationReminder.swift:197-250 | Wikipedia/Code/DiffListChangeItemViewModel.swift:229-300 | Wikipedia/Code/DonateCoordinator.swift:461-574 | Wikipedia/Code/FindAndReplaceKeyboardBar.swift:344-378 | Wikipedia/Code/NotificationsCenterViewController.swift:555-591 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1038-1247 | Wikipedia/Code/WatchlistController.swift:127-221 — These 9 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 9 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 9 times.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:16 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:16-47 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsView.swift:14-39 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsView.swift:14-36 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift:14-44 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:16-52 | WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:16-47 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:16-47 | WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift:16-47 — These 8 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 8 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 8 times.
D4 · Code Duplication · Duplicated block (48–49 lines × 2) · ×1
  • Duplicated block (48–49 lines × 2) Wikipedia/Code/TempAccountSheetCoordinator.swift:72 — Wikipedia/Code/TempAccountSheetCoordinator.swift:72-119 | Wikipedia/Code/TempAccountSheetCoordinator.swift:138-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/TempAccountSheetCoordinator.swift:72` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (43–44 lines × 3) · ×1
  • Duplicated block (43–44 lines × 3) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:164 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:164-207 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:293-335 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:383-426 — 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 (42 lines × 2) · ×1
  • Duplicated block (42 lines × 2) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:18 — Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:18-59 | Wikipedia/Code/NotificationsCenterDetailViewModel+ActionExtensions.swift:82-123 — 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 `Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:18` 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 (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) WMFData/Sources/WMFData/Service/WMFBasicService.swift:109 — WMFData/Sources/WMFData/Service/WMFBasicService.swift:109-146 | WMFData/Sources/WMFData/Service/WMFBasicService.swift:182-220 — 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 `WMFData/Sources/WMFData/Service/WMFBasicService.swift:109` 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) Wikipedia/Code/ArticleViewController.swift:592 — Wikipedia/Code/ArticleViewController.swift:592-624 | Wikipedia/Code/ExploreViewController.swift:1141-1173 — 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 `Wikipedia/Code/ArticleViewController.swift:592` 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 lines × 2) · ×1
  • Duplicated block (29 lines × 2) WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift:73 — WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift:73-101 | WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift:110-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift:108` calls `min` and `WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetView.swift:72` 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 (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) Wikipedia/Code/Session.swift:460 — Wikipedia/Code/Session.swift:460-485 | Wikipedia/Code/Session.swift:491-517 — 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 `Wikipedia/Code/Session.swift:460` 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) Wikipedia/Code/DiffContainerViewController.swift:940 — Wikipedia/Code/DiffContainerViewController.swift:940-963 | Wikipedia/Code/DiffContainerViewController.swift:966-991 — 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 `Wikipedia/Code/DiffContainerViewController.swift:940` 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 (25 lines × 5) · ×1
  • Duplicated block (25 lines × 5) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:19 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:19-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:19-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:19-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:19-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift:19-43 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift` and `WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:19` 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 `viewModel` to `WMFAccountSettingsViewModel` in one and `WMFPushNotificationsSettingsViewModel` 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) Wikipedia/Code/DescriptionWelcomePageViewController.swift:76 — Wikipedia/Code/DescriptionWelcomePageViewController.swift:76-100 | Wikipedia/Code/WMFWelcomePageViewController.swift:86-108 — before extracting anything, compare `Wikipedia/Code/DescriptionWelcomePageViewController.swift` and `Wikipedia/Code/WMFWelcomePageViewController.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 84 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) Wikipedia/Code/SettingsCoordinator.swift:84 — Wikipedia/Code/SettingsCoordinator.swift:84-108 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1343-1367 — 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 `Wikipedia/Code/WMFAppViewController+Extensions.swift:1343` 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 (11–21 lines × 3) · ×1
  • Duplicated block (11–21 lines × 3) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorAccessibilityIdentifiers.swift:7 — WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorAccessibilityIdentifiers.swift:7-17 | WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:18-38 | WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewModel.swift:31-41 — 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 (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:42 — WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:42-56 | Wikipedia/Code/Database Population/DatabasePopulationHostingController.swift:26-45 — 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 `WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:42` 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–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift:40 — WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift:40-58 | Wikipedia/Code/WMFWhichCameFirstArchiveViewController.swift:37-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 `WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewController.swift:40` 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 (16–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:68 — WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:68-83 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewHostingController.swift:177-194 — 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 `WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:68` 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 (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) Wikipedia/Code/ArticleCollectionViewController.swift:197 — Wikipedia/Code/ArticleCollectionViewController.swift:197-214 | Wikipedia/Code/ExploreCardViewController.swift:597-614 — 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 (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) WMF Framework/Widget/WidgetController.swift:372 — WMF Framework/Widget/WidgetController.swift:372-388 | WMF Framework/Widget/WidgetController.swift:491-507 | WMF Framework/Widget/WidgetController.swift:555-571 — 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 `WMF Framework/Widget/WidgetController.swift:372` 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 `result` to `WidgetContentFetcher.TopReadResult` in one and `WidgetContentFetcher.FeaturedArticleResult` 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 (16–17 lines × 3) · ×1
  • Duplicated block (16–17 lines × 3) Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:215 — Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:215-231 | Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:233-249 | Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:250-265 — 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 `Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:215` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:212` calls `slides` and `Wikipedia/Code/EvergreenAccountCreationCoordinator.swift:229` 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift:26 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift:26-41 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Main/WMFHomeFeedSettingsView.swift:21-35 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsView.swift:95-110 — 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift:26` 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, `WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsView.swift:111` calls `ignoresSafeArea` and `WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.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 (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:134 — Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:134-147 | Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:192-207 | Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:242-255 — 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 `Wikipedia/Code/NotificationsCenterCellViewModel+SheetActionExtensions.swift:134` 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–16 lines × 2) · ×1
  • Duplicated block (7–16 lines × 2) Wikipedia/Code/SettingsTabViewController.swift:188 — Wikipedia/Code/SettingsTabViewController.swift:188-203 | Wikipedia/Code/WMFSettingsViewController+Extensions.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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/SettingsTabViewController.swift:188` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:63 — WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:63-76 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewModel.swift:49-62 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:115-128 — 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 `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewModel.swift:48` calls `Sendable` and `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:62` 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) · ×1
  • Duplicated block (13–14 lines × 2) Wikipedia/Code/DiffController.swift:149 — Wikipedia/Code/DiffController.swift:149-162 | Wikipedia/Code/DiffController.swift:164-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) Wikipedia/Code/HelpViewController.swift:88 — Wikipedia/Code/HelpViewController.swift:88-99 | Wikipedia/Code/ReferenceBackLinksViewController.swift:47-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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ReferenceBackLinksViewController.swift:47` 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 × 6) · ×1
  • Duplicated block (13 lines × 6) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:31 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:31-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsView.swift:22-34 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:31-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:31-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:31-43 | WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift:31-43 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift` and `WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:31` 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, `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:44` calls `navigationTitle`, `navigationBarTitleDisplayMode` and `WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsView.swift:35` 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 (12–13 lines × 6) · ×1
  • Duplicated block (12–13 lines × 6) Wikipedia/Code/ActivityTabFunnel.swift:63 — Wikipedia/Code/ActivityTabFunnel.swift:63-74 | Wikipedia/Code/ArticleTabsFunnel.swift:66-77 | Wikipedia/Code/DonateFunnel.swift:117-129 | Wikipedia/Code/EditInteractionFunnel.swift:80-92 | Wikipedia/Code/ImageRecommendationsFunnel.swift:85-97 | Wikipedia/Code/SearchFunnel.swift:47-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 all 6 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–13 lines × 4) · ×1
  • Duplicated block (11–13 lines × 4) Wikipedia/Code/ActivityTabViewController.swift:550 — Wikipedia/Code/ActivityTabViewController.swift:550-562 | Wikipedia/Code/DonationReminderSetupCoordinator.swift:150-160 | Wikipedia/Code/ExploreViewController.swift:1720-1730 | Wikipedia/Code/YearInReviewCoordinator.swift:109-120 — 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. 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 lines × 4) · ×1
  • Duplicated block (13 lines × 4) Wikipedia/Code/WMFAppViewController.swift:1145 — Wikipedia/Code/WMFAppViewController.swift:1145-1157 | Wikipedia/Code/WMFAppViewController.swift:1159-1171 | Wikipedia/Code/WMFAppViewController.swift:1173-1185 | Wikipedia/Code/WMFAppViewController.swift:1186-1198 — 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 `Wikipedia/Code/WMFAppViewController.swift:1145` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Wikipedia/Code/WMFAppViewController.swift:1145` calls `WMFLocalizedString` and `Wikipedia/Code/WMFAppViewController.swift:1186` 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–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) WMF Framework/CacheController.swift:79 — WMF Framework/CacheController.swift:79-91 | WMF Framework/Event Platform/StorageManager.swift:33-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. Read the line range as the matched WINDOW rather than a finished unit: at `WMF Framework/CacheController.swift:79` 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 (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) WMF Framework/ReadingListsAPIController.swift:285 — WMF Framework/ReadingListsAPIController.swift:285-296 | WMF Framework/ReadingListsAPIController.swift:393-405 — 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 `WMF Framework/ReadingListsAPIController.swift:285` 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 (_ listIDs: []?,_ error: Error?) -> Swift.Void` in one and `@escaping (_ entryIDs: []?,_ error: Error?) -> Swift.Void` 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 (12 lines × 19) · ×1
  • Duplicated block (12 lines × 19) WMF Framework/ArticleSummary.swift:79 — WMF Framework/ArticleSummary.swift:79-90 | WMF Framework/NavigationState.swift:89-100 | WMF Framework/RelatedResponse.swift:88-99 | WMFComponents/Sources/WMFComponents/Components/Activity Tab/WMFActivityTabViewModel.swift:143-154 | WMFComponents/Sources/WMFComponents/Components/Article Tabs/WMFArticleTabsViewModel.swift:135-146 | WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:77-88 | WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorLocalizedStrings.swift:120-131 | WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/WMFSourceEditorTextFrameworkMediator.swift:45-56 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:57-68 | WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift:36-47 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:131-142 | WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRow.swift:39-50 | WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewModel.swift:81-92 | WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewModel.swift:112-123 | WMFComponents/Sources/WMFComponents/Components/Watchlist/Filter/WMFWatchlistFilterViewModel.swift:55-66 | WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewModel.swift:29-40 | WMFComponents/Sources/WMFComponents/Components/Watchlist/WMFWatchlistViewModel.swift:68-79 | WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:38-49 | WMFData/Sources/WMFData/Data Controllers/Activity Tab/WMFActivityTabDataController.swift:518-529 — there are 19 copies across 17 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 19 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `WMF Framework/ArticleSummary.swift:79` 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 `articleDescription` to `String? = nil` in one and `String?` 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 (12 lines × 8) · ×1
  • Duplicated block (12 lines × 8) WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:16 — WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:16-27 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsView.swift:14-25 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsView.swift:14-25 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/WMFHomeFeedWhatsDrivingSettingsView.swift:14-25 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift:16-27 | WMFComponents/Sources/WMFComponents/Components/Settings/Search/WMFSearchSettingsView.swift:16-27 | WMFComponents/Sources/WMFComponents/Components/Settings/Storage and Syncing/WMFStorageAndSyncingSettingsView.swift:16-27 | WMFComponents/Sources/WMFComponents/Components/Settings/Year In Review/WMFYearInReviewSettingsView.swift:16-27 — before extracting anything, compare `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift` and `WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 69 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 `WMFComponents/Sources/WMFComponents/Components/Settings/Account/WMFAccountSettingsView.swift:16` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `viewModel` to `WMFAccountSettingsViewModel` in one and `WMFHomeFeedCommunitySettingsViewModel` 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 (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:65 — WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:65-76 | WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:243-254 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewModel.swift:51-62 | WMFComponents/Sources/WMFComponents/Components/Reading Challenge Widget/WMFRandomWidgetViewModel.swift:54-65 | WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewModel.swift:117-128 | WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:36-47 | Wikipedia/Code/ArticleCoordinator.swift:179-190 — there are 7 copies across 6 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:65` 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, `WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewModel.swift:48` calls `Sendable` and `WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewModel.swift:62` 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–12 lines × 4) · ×1
  • Duplicated block (9–12 lines × 4) Wikipedia/Code/DescriptionEditViewController.swift:147 — Wikipedia/Code/DescriptionEditViewController.swift:147-155 | Wikipedia/Code/DescriptionEditViewController.swift:170-178 | Wikipedia/Code/EditSaveViewController.swift:262-273 | Wikipedia/Code/EditSaveViewController.swift:296-307 — 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 `Wikipedia/Code/DescriptionEditViewController.swift:147` 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 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 × 3) · ×1
  • Duplicated block (12 lines × 3) Wikipedia/Code/ArticleViewController+Editing.swift:400 — Wikipedia/Code/ArticleViewController+Editing.swift:400-411 | Wikipedia/Code/DescriptionEditViewController.swift:400-411 | Wikipedia/Code/TalkPageViewController.swift:757-768 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ArticleViewController+Editing.swift:400` 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) Wikipedia/Code/ViewControllerRouter.swift:235 — Wikipedia/Code/ViewControllerRouter.swift:235-246 | Wikipedia/Code/WMFAppViewController+Extensions.swift:456-465 — 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 (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) Wikipedia/Code/TalkPageFetcher.swift:199 — Wikipedia/Code/TalkPageFetcher.swift:199-209 | Wikipedia/Code/TalkPageFetcher.swift:222-230 — 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 `Wikipedia/Code/TalkPageFetcher.swift:199` 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 (2–11 lines × 14) · ×1
  • Duplicated block (2–11 lines × 14) WMF Framework/Remote Notifications/RemoteNotificationsController.swift:565 — WMF Framework/Remote Notifications/RemoteNotificationsController.swift:565-567 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Main/WMFHomeFeedSettingsViewModel.swift:13-14 | Wikipedia/Code/ArticleViewController+DonationReminder.swift:204-205 | Wikipedia/Code/DiffListChangeItemViewModel.swift:267-268 | Wikipedia/Code/DonateCoordinator.swift:519-521 | Wikipedia/Code/DonateCoordinator.swift:533-535 | Wikipedia/Code/FindAndReplaceKeyboardBar.swift:345-346 | Wikipedia/Code/NotificationsCenterViewController.swift:561-562 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1067-1077 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1092-1093 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1102-1105 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1124-1126 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1134-1141 | Wikipedia/Code/WatchlistController.swift:131-132 — there are 14 copies across 9 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 14 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/WMFAppViewController+Extensions.swift:1067` 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 (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:338 — WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:338-347 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:379-388 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:421-430 | WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:471-480 — 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 `WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:338` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `completion` to `@escaping @Sendable (Result<Void, Error>) -> Void` in one and `@escaping @Sendable (Result<WMFUndoOrRollbackResult, Error>) -> Void` 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 before the matched lines, `WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:469` calls `String` and `WMFData/Sources/WMFData/Data Controllers/Watchlist/WMFWatchlistDataController.swift:378` 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 (7–10 lines × 3) · ×1
  • Duplicated block (7–10 lines × 3) Wikipedia/Code/ArticlePeekPreviewViewController.swift:158 — Wikipedia/Code/ArticlePeekPreviewViewController.swift:158-167 | Wikipedia/Code/SavedAllArticlesCoordinator.swift:186-195 | Wikipedia/Code/WhichCameFirstCoordinator.swift:366-372 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ArticlePeekPreviewViewController.swift:158` 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, `Wikipedia/Code/ArticlePeekPreviewViewController.swift:157` calls `WMFArticle` and `Wikipedia/Code/WhichCameFirstCoordinator.swift:365` 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 (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouEndOfFeedCardView.swift:124 — WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouEndOfFeedCardView.swift:124-133 | WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift:930-936 — 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 `WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouEndOfFeedCardView.swift:124` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) Wikipedia/Code/ActivityTabViewController.swift:150 — Wikipedia/Code/ActivityTabViewController.swift:150-159 | Wikipedia/Code/HomeViewController.swift:337-345 — 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 `Wikipedia/Code/ActivityTabViewController.swift:150` 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 × 5) · ×1
  • Duplicated block (9 lines × 5) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:691 — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:691-699 | WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:23-31 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:37-45 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:53-61 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRelatedPagesDataController.swift:56-64 — 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:691` 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, `WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:21` calls `wikipedia` and `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:689` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:26 — Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:26-35 | Wikipedia/Code/WMFAuthLoginInfoFetcher.swift:26-35 | Wikipedia/Code/WMFCaptchaResetter.swift:23-31 | Wikipedia/Code/WMFCurrentUserFetcher.swift:62-71 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/WMFAuthAccountCreationInfoFetcher.swift:26` 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 (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:34 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:34-42 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:248-256 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:247-253 — 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 `WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:34` 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×1
  • Duplicated block (8–9 lines × 3) Wikipedia/Code/AppOnboardingCoordinator.swift:186 — Wikipedia/Code/AppOnboardingCoordinator.swift:186-193 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:98-105 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:183-191 — 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 `Wikipedia/Code/AppOnboardingCoordinator.swift:186` 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 (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) Wikipedia/Code/SettingsCoordinator.swift:113 — Wikipedia/Code/SettingsCoordinator.swift:113-121 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1334-1340 — 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 (8 lines × 6) · ×1
  • Duplicated block (8 lines × 6) WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:56 — WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:56-63 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:65-72 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:74-81 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:83-90 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsViewModel.swift:51-58 | WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/WMFHomeFeedForYouSettingsViewModel.swift:60-67 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `WMFComponents/Sources/WMFComponents/Components/Settings/Home/Community/WMFHomeFeedCommunitySettingsViewModel.swift:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (5–7 lines × 3) · ×1
  • Duplicated block (5–7 lines × 3) Wikipedia/Code/DescriptionEditViewController.swift:157 — Wikipedia/Code/DescriptionEditViewController.swift:157-163 | REDACTED:134-138 | REDACTED:114-118 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/DescriptionEditViewController.swift:157` 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 (6 lines × 5) · ×1
  • Duplicated block (6 lines × 5) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64 — WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64-72 | WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:97-105 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFCategoriesDataController.swift:24-31 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:248-254 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:247-252 — there are 5 copies across 4 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift:64` 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 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 (1–6 lines × 4) · ×1
  • Duplicated block (1–6 lines × 4) Wikipedia/Code/ActivityTabViewController.swift:562 — Wikipedia/Code/ActivityTabViewController.swift:562-570 | Wikipedia/Code/ExploreViewController.swift:1732-1737 | Wikipedia/Code/HelpViewController.swift:139-139 | Wikipedia/Code/YearInReviewCoordinator.swift:122-130 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/ActivityTabViewController.swift:562` 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 (5 lines × 10) · ×1
  • Duplicated block (5 lines × 10) Wikipedia/Code/DiffContainerViewController.swift:1003 — Wikipedia/Code/DiffContainerViewController.swift:1003-1007 | Wikipedia/Code/NotificationsCenterViewController.swift:614-618 | Wikipedia/Code/ReadingListsAlertController.swift:111-115 | Wikipedia/Code/ThanksGiving.swift:87-91 | Wikipedia/Code/UIViewController+Extensions.swift:101-105 | Wikipedia/Code/UIViewController+Extensions.swift:141-145 | Wikipedia/Code/UIViewController+Extensions.swift:172-176 | Wikipedia/Code/UIViewController+Extensions.swift:196-200 | Wikipedia/Code/UIViewController+Extensions.swift:217-221 | Wikipedia/Code/UIViewController+Extensions.swift:230-234 — there are 10 copies across 5 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 10 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication · Duplicated block (2–5 lines × 4) · ×1
  • Duplicated block (2–5 lines × 4) WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:243 — WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:243-244 | WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:245-249 | WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:251-255 | WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:256-259 — 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 `WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:243` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:255` calls `NSRegularExpression`, `matches`, `NSRange` and `WMFData/Sources/WMFData/Utility/WMFWikitextUtils.swift:244` 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 (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) Wikipedia/Code/ArticleViewController+Editing.swift:365 — Wikipedia/Code/ArticleViewController+Editing.swift:365-371 | Wikipedia/Code/DescriptionEditViewController.swift:40-46 | Wikipedia/Code/TempAccountSheetCoordinator.swift:38-44 | Wikipedia/Code/TempAccountSheetCoordinator.swift:45-51 | Wikipedia/Code/TempAccountSheetCoordinator.swift:53-59 — there are 5 copies across 3 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 5 sites; resolving a subset leaves the remainder to drift apart. 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 (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) Wikipedia/Code/TalkPageCellCommentView.swift:205 — Wikipedia/Code/TalkPageCellCommentView.swift:205-211 | Wikipedia/Code/TalkPageCellTopicView.swift:484-490 | Wikipedia/Code/TalkPageCoffeeRollView.swift:113-119 | Wikipedia/Code/TalkPageReplyComposeContentView.swift:428-434 — 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.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:8 — WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:8-20 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:22-33 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:35-46 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:73-87 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:108-117 — 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:173 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:173-186 | WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:190-203 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:109-123 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:155-168 — before extracting anything, compare `WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift` and `WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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. 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:156 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:156-169 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:92-106 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:138-151 — before extracting anything, compare `WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift` and `WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 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–8 lines × 4) · ×1
  • Duplicated block (6–8 lines × 4) WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:12 — WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:12-17 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:25-30 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:38-43 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:75-82 — before extracting anything, compare `WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift` and `WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift` as WHOLE FILES: this scan already matched 5 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. 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 (7–8 lines × 4) · ×1
  • Duplicated block (7–8 lines × 4) WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:7 — WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:7-14 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:18-25 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:59-66 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:97-103 — 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 `WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:7` 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 5) · ×1
  • Duplicated block (5 lines × 5) WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:12 — WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:12-17 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:25-30 | WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift:38-43 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:75-80 | WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift:110-114 — before extracting anything, compare `WMFData/Sources/WMFDataMocks/WMFMockGrowthTasksService.swift` and `WMFData/Sources/WMFDataMocks/WMFMockWatchlistMediaWikiService.swift` as WHOLE FILES: this scan already matched 5 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. 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.
D44 · Platform End-of-Life · End-of-life runtime · ×1
  • End-of-life runtime: Ruby 3.0 — .ruby-version declares Ruby 3.0 as this project's version file, and Ruby 3.0, support ended 2024-04-23. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2024-04-23 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Minor — 70 finding(s)
D10 · Test Quality · No direct assertions · ×47
  • No direct assertions: testFirstLaunchShowsOnboardingSmoke WikipediaUITests/AppOnboardingUITests.swift:6 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testOnboardingScreenshots WikipediaUITests/AppOnboardingUITests.swift:12 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testLearnMoreLinksPresentDestinations WikipediaUITests/AppOnboardingUITests.swift:36 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testAdditionalLanguageCanBeAddedDuringOnboarding WikipediaUITests/AppOnboardingUITests.swift:45 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testLaunchLocaleSeedsPreferredWikipediaLanguage WikipediaUITests/AppOnboardingUITests.swift:62 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testWelcomeScreensCanBeAdvancedByTappingNext WikipediaUITests/AppOnboardingUITests.swift:75 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testWelcomeScreensCanBeAdvancedBySwiping WikipediaUITests/AppOnboardingUITests.swift:87 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testOnboardingCanBeSkipped WikipediaUITests/AppOnboardingUITests.swift:96 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleBackButtonReturnsToExplore WikipediaUITests/ArticleControlsUITests.swift:4 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleHomeButtonReturnsToExplore WikipediaUITests/ArticleControlsUITests.swift:9 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleSearchButtonOpensSearch WikipediaUITests/ArticleControlsUITests.swift:14 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleTableOfContentsButtonOpensContents WikipediaUITests/ArticleControlsUITests.swift:19 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleLanguageControlSwitchesArticleLanguage WikipediaUITests/ArticleControlsUITests.swift:24 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleSaveControlTogglesSavedState WikipediaUITests/ArticleControlsUITests.swift:31 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleFindInArticleSearchesAndCloses WikipediaUITests/ArticleControlsUITests.swift:36 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleThemeControlAdjustsReadingTheme WikipediaUITests/ArticleControlsUITests.swift:42 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleTableOfContentsDismissesWhenTappingOutside WikipediaUITests/ArticleControlsUITests.swift:49 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleTableOfContentsSectionSelectionWorks WikipediaUITests/ArticleControlsUITests.swift:55 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleTableOfContentsWorksAfterRotation WikipediaUITests/ArticleControlsUITests.swift:70 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowMenuItemsAreAvailable WikipediaUITests/ArticleControlsUITests.swift:75 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowWatchCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:82 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowTalkPageCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:87 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowEditSourceCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:92 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowBackReturnsToPreviousArticle WikipediaUITests/ArticleControlsUITests.swift:97 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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: testArticleOverflowRevisionHistoryCanBeTapped WikipediaUITests/ArticleControlsUITests.swift:103 — No conventional assertion call was detected, and 47 of 47 tests in `WikipediaUITests` 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.
  • + 22 more in this group — see findings.md.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 64 significant file(s) lose their only recent owner: Wikipedia/Code/WhichCameFirstCoordinator.swift, WMF Framework/ExploreCardCollectionViewCell.swift, Widgets/Widgets/OnThisDayView.swift, Wikipedia/Code/EvergreenAccountCreationCoordinator.swift, WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift, WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingStepViews.swift, WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Results/WMFWhichCameFirstResultsView.swift, WMFData/Sources/WMFData/Data Controllers/Evergreen Account Creation/WMFEvergreenAccountCreationDataController.swift (+56 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 30 significant file(s) lose their only recent owner: WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift, Wikipedia/Code/FindAndReplaceKeyboardBar.swift, WMF Framework/ImageCacheController.swift, Wikipedia/Code/InsertMediaViewController.swift, WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFAsyncPageRowSaved.swift, WMF Framework/LocationManager.swift, Wikipedia/Code/UIViewController+FeatureComponentFactory.swift (+22 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 12 significant file(s) lose their only recent owner: WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFDonationReminderDataController.swift, WMFComponents/Sources/WMFComponents/Components/Donation Reminder/WMFDonationReminderSetupView.swift, Wikipedia/Code/NotificationsCenterCommonViewModel+LinkExtensions.swift, Wikipedia/Code/ArticleScrolling.swift, WMF Framework/Widget/Models/WidgetFeaturedContent.swift, WMF Framework/String+LinkParsing.swift, Wikipedia/Code/ChooseEditorSheetCoordinator.swift, WMF Framework/Widget/Models/WidgetCache.swift (+4 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: Wikipedia/Code/PageContentService+UITestAccessibilityScript.swift, Wikipedia/Code/TestNetworkFixtures/TestNetworkFixtureStore.swift, Wikipedia/Code/TestNetworkFixtures/TestNetworkFixtureHTTPClient.swift, Wikipedia/Code/SessionHTTPClient.swift, Wikipedia/Code/TestNetworkFixtures/TestNetworkFixture.swift, Wikipedia/Code/TestNetworkFixtures/TestNetworkFixtureURLProtocol.swift. Pair on, review, or document these before any departure.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D10 · Test Quality · Test project verifies nothing · ×1
  • Test project verifies nothing: WikipediaUITests WikipediaUITests/AppOnboardingUITests.swift:6 — No conventional assertion call was detected in 47 of 47 tests in `WikipediaUITests` — 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.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 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 (114 single-owned of 687 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 687 of the 1236 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
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 · Split WMFComponents · ×1
  • Split WMFComponents — At 32k LoC the component assembly is large but its 68 namespaces are all sources under WMFComponents/Sources/WMFComponents/* and should be treated as one unit. Suggested:
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 53 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Wikipedia/Code/TableOfContentsAnimator.swift, Widgets/Widgets/OnThisDayWidget.swift, Wikipedia/Code/PageHistoryCollectionViewCell.swift, WMF Framework/ColumnarCollectionViewLayout.swift, Wikipedia/Code/QuadKey.swift, Wikipedia/Code/NSLocale+WMFExtras.swift, WMF Framework/ColumnarCollectionViewLayoutInfo.swift, WMF Framework/UIView+SemanticContent.swift (and 45 more) (54 orphaned of 690 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 690 of the 1236 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
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.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
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 90246 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.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Minor — 4 finding(s)
D12 · Dependency Hygiene · Outdated · ×4
  • Outdated: cocoalumberjack — `cocoalumberjack` is resolved at 3.9.0, but 3.10.0 is the newest release tagged on https://github.com/CocoaLumberjack/CocoaLumberjack.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update cocoalumberjack` reaches this one with no change to Package.swift.
  • Outdated: rive-ios — `rive-ios` is resolved at 6.26.0, but 6.28.0 is the newest release tagged on https://github.com/rive-app/rive-ios.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update rive-ios` reaches this one with no change to Package.swift.
  • Outdated: sdwebimage — `sdwebimage` is resolved at 5.21.3, but 5.21.7 is the newest release tagged on https://github.com/SDWebImage/SDWebImage.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update sdwebimage` reaches this one with no change to Package.swift.
  • Outdated: swift-log — `swift-log` is resolved at 1.6.4, but 1.15.1 is the newest release tagged on https://github.com/apple/swift-log 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-log` 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-04ca834239774fc4aa0f3fa67b4eb8b3/history.json --exit-code 0 --source .134artifacts/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-04ca834239774fc4aa0f3fa67b4eb8b3/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 .38artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive .3artifacts/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: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 47 file(s) — `Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtilityAPI.swift`, `WMF Framework/CacheGroup+CoreDataProperties.swift`, `WMF Framework/CacheItem+CoreDataProperties.swift`, `WMF Framework/ReadingList+CoreDataProperties.swift`, `WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingFeedPreferenceViewModel.swift`, … (+42 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesosv-scanner—osv-scanner --format json --recursive .0artifacts/raw/osv-scanner.json

Run 01a0f44c-9f4c-726a-904b-9aab24ab7422 · 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