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

wikimedia/wikipedia-ios

Measured 28 October 2026, 22:27 UTC, at code version 293abee

No regression since the last survey

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

CAI score 45out of 100 Weak
CriticalWeakAdequateStrongExemplary
Up 4 since the last survey

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

A large codebase: 162,238 lines of product code in 12 projects, tests not counted · Estimated rebuild effort: about 1.2 person-years · Weakest lens: Accessibility, 32

Findings by how serious they are

67 critical 967 serious 191 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 22:27 UTC

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

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

72of 72 dimensions measured by tools.
1197of 1225 findings point to an exact file and line, so you can open each one in the code. The other 28 concern the repository as a whole, such as missing documentation.
72dimensions across 8 lenses, read from 162,238 lines of product code in 12 projects.
Chapters

Executive summary

wikimedia/wikipedia-ios falls short of our standard for production because it has images with no text description and pages that don't say their language. It scores 45 out of 100 and is rated Weak, and 43 of its 67 critical findings are security problems.

Accessibility, at 32, is the weakest lens and counts most in the score. The best first steps are adding text alternatives and structuring the pages, each worth about 9 points. Raising Accessibility to 70 would lift the score to about 56.

Twenty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Twelve passwords or keys are open to anyone who can read the repository, and nine secrets can leak from the build pipeline. Pinning each tool to an exact version, replacing each exposed password or key and limiting each secret to its own step would close these risks. Updating the vulnerable packages would fix the package with a known security hole. The 12 sets of files in separate parts that keep changing together need that dependency made explicit.

The product code is 162,238 lines, about €170,000 to rebuild.

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

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

If Accessibility rose from 32 to 70, the lowest score rated Strong, the score would rise from 45 to about 56.

Code composition: what the lines of code are
Product code 83%Tests 17%
New since the last survey: 55 findings

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

  • Cognitive Complexity · LegacyReadingListsDataSource.savedArticles (cognitive 20) Wikipedia/Code/LegacyReadingListsDataSource.swift
  • Cognitive Complexity · UITestReadingListsSeeder.apply (cognitive 17) Wikipedia/Code/UITestSeeds/UITestReadingListsSeeder.swift
  • Cognitive Complexity · WMFYearInReviewDataController.fullSlideCount (cognitive 16) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift
  • God Classes · ClassTooLong: YearInReviewSlideViewModelFactory Wikipedia/Code/YearInReviewSlideViewModelFactory.swift
  • God Classes · TooManyMethods: YearInReviewCoordinator Wikipedia/Code/YearInReviewCoordinator.swift
  • God Classes · FileTooLong: Code/Session.swift Wikipedia/Code/Session.swift
  • God Classes · TooManyMethods: YearInReviewSlideViewModelFactory Wikipedia/Code/YearInReviewSlideViewModelFactory.swift
  • God Classes · FileTooLong: Code/YearInReviewSlideViewModelFactory.swift Wikipedia/Code/YearInReviewSlideViewModelFactory.swift
  • God Classes · ClassTooLong: Session Wikipedia/Code/Session.swift
  • God Classes · TooManyMethods: SearchViewController Wikipedia/Code/SearchViewController.swift
  • God Classes · FileTooLong: Event Platform/EventPlatformClient.swift WMF Framework/Event Platform/EventPlatformClient.swift
  • God Classes · ClassTooLong: CollectionViewEditController WMF Framework/CollectionViewEditController.swift
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) Wikipedia/Code/DiffContainerViewController.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) Wikipedia/Code/ActivityTabFunnel.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) Wikipedia/Code/ActivityTabViewController.swift
  • Code Duplication · Duplicated block (21–22 lines × 2) Wikipedia/Code/ReadingListsCollectionViewCell.swift
  • Code Duplication · Duplicated block (10–12 lines × 3) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift
  • Code Duplication · Duplicated block (8–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift
  • Code Duplication · Duplicated block (2–10 lines × 5) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift
  • Code Duplication · Duplicated block (9 lines × 2) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift
  • Code Duplication · Duplicated block (9 lines × 2) Wikipedia/Code/SavedArticleDownloadProgressObserver.swift
  • Code Duplication · Duplicated block (8 lines × 2) WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListRow.swift
  • Code Duplication · Duplicated block (7 lines × 2) WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift
  • Code Duplication · Duplicated block (6 lines × 2) WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewModel.swift
  • Code Duplication · Duplicated block (6 lines × 2) Wikipedia/Code/ReadingListsCoordinator.swift
  • Code Duplication · Duplicated block (7 lines × 2) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift
  • Code Duplication · Duplicated block (9 lines × 2) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift
  • Code Duplication · Duplicated block (9 lines × 2) WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift
  • Code Duplication · Duplicated block (8 lines × 3) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewDaysVisitedSlideDataController.swift
  • Code Duplication · Duplicated block (16 lines × 2) WMFData/Sources/WMFData/Data Controllers/Discover/WMFDiscoverDataController.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift
  • Cohesion (LCOM4) · Low cohesion: SavedCoordinator (LCOM4 7) Wikipedia/Code/SavedCoordinator.swift
  • Cohesion (LCOM4) · Low cohesion: WMFDiscoverDataController (LCOM4 4) WMFData/Sources/WMFData/Data Controllers/Discover/WMFDiscoverDataController.swift
  • Cohesion (LCOM4) · Low cohesion: ReadingListsAlertController (LCOM4 4) Wikipedia/Code/ReadingListsAlertController.swift
  • Churn × Complexity Hotspots · Hotspot: WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift
  • Secrets (history) · REDACTED
  • Static Analysis (SAST) · REDACTED
  • Static Analysis (SAST) · REDACTED
  • Change Coupling · Boundary-crossing change coupling: WMFImageRecommendationsBottomSheetViewController.swift ↔ ExploreViewController.swift WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsBottomSheetViewController.swift
  • Change Coupling · Change coupling: WMFSavedAllArticlesViewModel.swift ↔ WMFPageRowSaved.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED
  • Supply-chain Provenance & Signing · REDACTED

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

Fixed since the last survey: 45 findings

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

  • Cyclomatic Complexity · ReadingListsCollectionViewCell.sizeThatFits (cyclomatic 30) Wikipedia/Code/ReadingListsCollectionViewCell.swift
  • Cyclomatic Complexity · SavedAllArticlesCoordinator.fetchAllSavedArticles (cyclomatic 16) Wikipedia/Code/SavedAllArticlesCoordinator.swift
  • Cognitive Complexity · SavedAllArticlesCoordinator.fetchAllSavedArticles (cognitive 37) Wikipedia/Code/SavedAllArticlesCoordinator.swift
  • Cognitive Complexity · WMFRiveAnimationViewModel.applyTextFits (cognitive 23) WMFComponents/Sources/WMFComponents/Components/Shared/Rive/WMFRiveAnimationViewModel.swift
  • Cognitive Complexity · SavedAllArticlesCoordinator.determineAlertType (cognitive 18) Wikipedia/Code/SavedAllArticlesCoordinator.swift
  • God Classes · TooManyMethods: SavedViewController Wikipedia/Code/SavedViewController.swift
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) Wikipedia/Code/DiffContainerViewController.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFPageInterestDataController.swift
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) Wikipedia/Code/ActivityTabFunnel.swift
  • Code Duplication · Duplicated block (13 lines × 2) REDACTED
  • Code Duplication · Duplicated block (12 lines × 2) WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift
  • Code Duplication · Duplicated block (12 lines × 2) Wikipedia/Code/ExploreViewController.swift
  • Code Duplication · Duplicated block (6 lines × 2) Wikipedia/Code/ReadingListsCollectionViewCell.swift
  • Code Duplication · Duplicated block (5 lines × 2) Wikipedia/Code/ActivityTabViewController.swift
  • Code Duplication · Duplicated block (5 lines × 2) Wikipedia/Code/Session.swift
  • Code Duplication · Duplicated block (16 lines × 2) Wikipedia/Code/ActivityTabViewController.swift
  • Code Duplication · Duplicated block (6 lines × 2) REDACTED
  • Code Duplication · Duplicated block (5 lines × 2) REDACTED
  • Code Duplication · Duplicated block (7 lines × 2) REDACTED
  • Code Duplication · Duplicated block (8 lines × 2) WMFComponents/Sources/WMFComponents/Components/Home/WMFForYouView.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift
  • Cohesion (LCOM4) · Low cohesion: SavedViewController (LCOM4 11) Wikipedia/Code/SavedViewController.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/ClientData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/ClientData.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/ExperimentData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/ExperimentData.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/InteractionData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/InteractionData.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/MediawikiData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/MediawikiData.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Event/Event.swift WMFTestKitchen/Sources/WMFTestKitchen/Event/Event.swift
  • Code Coverage · Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/TestKitchenClient.swift WMFTestKitchen/Sources/WMFTestKitchen/TestKitchenClient.swift
  • Churn × Complexity Hotspots · Hotspot: WMFComponents/Sources/WMFComponents/Components/Shared/Rive/WMFRiveAnimationViewModel.swift WMFComponents/Sources/WMFComponents/Components/Shared/Rive/WMFRiveAnimationViewModel.swift
  • Churn × Complexity Hotspots · Hotspot: WMFData/Sources/WMFData/Service/WMFBasicService.swift WMFData/Sources/WMFData/Service/WMFBasicService.swift
  • Explicit Debt · TodoComment WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController.swift
  • Explicit Debt · TodoComment WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewLocalConfig.swift
  • Explicit Debt · TodoComment Wikipedia/Code/YearInReviewSlideViewModelFactory.swift
  • Explicit Debt · TodoComment Wikipedia/Code/SemanticSearchResultsCoordinator.swift
  • Explicit Debt · TodoComment Wikipedia/Code/ArticleViewController+SemanticSearch.swift
  • Secrets (history) · REDACTED: REDACTED REDACTED
  • Static Analysis (SAST) · Medium: REDACTED Wikipedia/Code/ReadingListsViewController.swift
  • Change Coupling · Boundary-crossing change coupling: WMFImageRecommendation.swift ↔ ExploreViewController.swift WMFData/Sources/WMFData/Models/Image Recommendations/WMFImageRecommendation.swift
  • Change Coupling · Change coupling: WMFSavedAllArticlesViewModel.swift ↔ WMFAsyncPageRowSaved.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift
  • Supply-chain Provenance & Signing REDACTED
  • Exception handling · Swallowed exception (caught, then discarded) WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFAsyncPageRowSavedViewModel.swift
  • Exception handling · Swallowed exception (empty catch) Wikipedia/Code/SavedAllArticlesCoordinator.swift
  • Exception handling · Swallowed exception (caught, then discarded) Wikipedia/Code/SavedAllArticlesCoordinator.swift
  • Visual & motion safety · Animation without a prefers-reduced-motion guard Wikipedia/Code/WMFRandomDiceButton.html
Rebuild cost: about €170,000 · Estimate
Cost to rebuild€57,000 to €290,000, for 958 to 3,040 hours of work, about 1.2 person-years for 1 to 3 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 45. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 162,238 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
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.
Raises the score by about 9 points · 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.
Raises the score by about 9 points · 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.
Raises the score by about 6 points · Medium effort · A11y enforcement

Diagnosis: what the measurements show together

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

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

Architecture — module dependency graph

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

arch ContinueReadingWidget ContinueReadingWidget WMF WMF ContinueReadingWidget->WMF NotificationServiceExtension NotificationServiceExtension NotificationServiceExtension->WMF WMFComponents WMFComponents WMF->WMFComponents WMFData WMFData WMFComponents->WMFData WMFNativeLocalizations WMFNativeLocalizations WMFComponents->WMFNativeLocalizations WMFTestKitchen WMFTestKitchen WMFData->WMFTestKitchen WMFTranslateWikiLocalizations WMFTranslateWikiLocalizations WidgetsExtension WidgetsExtension WidgetsExtension->WMF Wikipedia-iOS Wikipedia-iOS Wikipedia-iOS->WMF languages languages localization localization

Architecture: which parts of the code depend on which

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

11 modules, with 13 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 (global)2 WMFLocalizations~WMFTranslateWikiLocalizations3 Wikipedia4 Wikipedia.Code5 Wikipedia.assets6 scripts7 repository8 WMFTestKitchen~WMFTestKitchen9 WMFData~WMFData10 WMFComponents~WMFComponents11 WMFLocalizations~WMFNativeLocalizations
1 (global)
2 WMFLocalizations~WMFTranslateWikiLocalizations
3 Wikipedia
4 Wikipedia.Code
5 Wikipedia.assets
6 scripts
7 repository29445409
8 WMFTestKitchen~WMFTestKitchen225
9 WMFData~WMFData355329
10 WMFComponents~WMFComponents7341230
11 WMFLocalizations~WMFNativeLocalizations41
Uses a module listed above itPart of a loopThe module itself
1 (global)2 WMFLocalizations~WMFTranslateWikiLocalizations3 Wikipedia4 Wikipedia.Code5 Wikipedia.assets6 scripts7 repository8 WMFTestKitchen~WMFTestKitchen9 WMFData~WMFData10 WMFComponents~WMFComponents11 WMFLocalizations~WMFNativeLocalizations(global)1WMFLocalizations~WMFTranslateWikiLocalizations2Wikipedia3Wikipedia.Code4Wikipedia.assets5scripts6repository7WMFTestKitchen~WMFTestKitchen8WMFData~WMFData9WMFComponents~WMFComponents10WMFLocalizations~WMFNativeLocalizations1129445409225355329734123041

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

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

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

At a glance — Readiness · 52% · Adequate · gated by P3 ·

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

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

At a glance — Accessibility · 32% · Weak · gated by AC1, AC3 ·

At a glance — Performance · 71% · Strong ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection37High / Critical
A03:2025 — Software Supply Chain Failures21High / Critical
A07:2025 — Authentication Failures13High / Critical

Roadmap

First, ensure all media elements have appropriate text alternatives and correct the page structure by defining language, title, and main landmarks while maintaining proper heading order. Next, integrate accessibility checks directly into your UI test suite and gate them in CI to prevent regressions from merging. Finally, resolve existing secret findings in your repository history and add a static analysis step to your CI pipeline to block security 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.+9.3 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.+8.6 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.+5.6 ptsMediumA11y enforcement
Resolve the 8 Low coverage finding(s) in Code Coverage — start with SourceConfig.swift, AgentData.swift, PageData.swift.+1.2 ptsLowCode Coverage
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.+1.7 ptsMediumSecurity & performance tooling
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with .ruby-version.+0.8 ptsLowPlatform End-of-Life
Resolve the 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.+0.8 ptsLowSupply-chain Provenance & Signing
Resolve the 1 No ADRs found finding(s) in ADR Quality.+0.7 ptsLowADR Quality

File quality

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

FileScoreBandWorst signal
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift3.1SlopChange Coupling: Boundary-crossing change coupling: TimelineViewModel.swift ↔ UserContributionsDataController.swift
REDACTED4.4MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.6MixedSecrets (history): REDACTED: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift4.8MixedChange Coupling: Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFDeveloperSettingsDataController.swift
WMFData/Sources/WMFData/Data Controllers/Article Tabs/WMFArticleTabsDataController.swift4.8MixedCyclomatic Complexity: WMFArticleTabsDataController.getAdjacentArticleInTab (cyclomatic 22)
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
Wikipedia/Code/TalkPageViewController.swift5.5MixedCyclomatic Complexity: TalkPageViewController.tappedPublish (cyclomatic 22)
Wikipedia/Code/PageHistoryViewController.swift5.5MixedCyclomatic Complexity: PageHistoryViewController.configure (cyclomatic 17)
Wikipedia/Code/WMFAppViewController.swift5.5MixedCyclomatic Complexity: WMFAppViewController.processUserActivity (cyclomatic 27)
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)
Wikipedia/Code/EditorViewController.swift5.6MixedCyclomatic Complexity: EditorViewController.loadContent (cyclomatic 22)

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

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

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

Could not be resolved — 14

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. 72 of 72 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 72 dimensions across the health lenses
D1D2D3D4D5D6D8D9D10D11D12D13D14D15D16D17D20D26D28D29D30D34D35D36D37D43D44AC1AC3AC6AC7AX10AX3AX4AX8AX9DM4DM5DM6M1M2M3M4P1P10P2P3P4P6PF2PF3X1X12X13X14X15X16X17X18X19X21X22X23X24X25X26X27X28X29X3X30X5

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 01a1849f-ced5-7a11-a8d7-9df1b9d43924.

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.
  • D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • 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`, … (+44 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.
  • 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, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's PHP, Swift, c, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's PHP, Swift, c, objectivec is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.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.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • 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.

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

104 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DonateCoordinator.presentActionSheet at 66. A further 23 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 139 — they are counted neither in the figure above nor in this dimension's score. 11 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift (WMFSFSymbolIcon.`for` at 139), Wikipedia/Code/NotificationsCenterAction.swift (PageNamespace.stringValue at 44), WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFArticleTopic.swift (WMFArticleTopic.displayName at 40), WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFArticleTopic+YearInReview.swift (WMFArticleTopic.yearInReviewSentence at 39), WMFData/Sources/WMFData/Models/Year In Review/WMFArticleTopic+YearInReviewIllustration.swift (WMFArticleTopic.yearInReviewIllustrationFileName at 34), and 6 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

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

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

What to do

  1. Bring the 13 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with DonateCoordinator.presentActionSheet (cyclomatic 66), WMFFont.`for` (cyclomatic 65), WMFAccountLoginLogoutFetcher.login (cyclomatic 56). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 13 together lifts Cyclomatic Complexity from 6.4 to about 7.3/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

175 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
WMFAccountLoginLogoutFetcher.login (cognitive 89)Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89
PlacesViewController.regroupArticlesIfNecessary (cognitive 88)Wikipedia/Code/PlacesViewController.swift:1447
DiffTransformer.populateAdditionalSectionAndMoveInfo (cognitive 67)Wikipedia/Code/DiffTransformer.swift:99
HtmlUtils.addStyling (cognitive 64)WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:320

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

What to do

  1. Bring the 6 bodies over 60 down to 60 or less in Cognitive Complexity — start with ReadingListsSyncOperation.processLocalUpdates (cognitive 133), WMFAccountLoginLogoutFetcher.login (cognitive 89), PlacesViewController.regroupArticlesIfNecessary (cognitive 88). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cognitive Complexity from 5.7 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

104 god class(es) detected.

TooManyMethods: ArticleViewController · ×41Wikipedia/Code/ArticleViewController.swift:10
FileTooLong: Code/PlacesViewController.swift · ×24Wikipedia/Code/PlacesViewController.swift
ClassTooLong: PlacesViewController · ×21Wikipedia/Code/PlacesViewController.swift:9
MethodTooLong: WMFSFSymbolIcon.`for` · ×18WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:205

What to do

  1. Resolve the 41 TooManyMethods finding(s) in God Classes — start with ArticleViewController.swift, WMFAppViewController.swift, ExploreViewController.swift. — One of this dimension's main actionable groups (41 warning-level).
  2. Resolve the 24 FileTooLong finding(s) in God Classes — start with PlacesViewController.swift, WMFAppViewController.swift, ExploreViewController.swift. — One of this dimension's main actionable groups (24 warning-level).
  3. Resolve the 21 ClassTooLong finding(s) in God Classes — start with PlacesViewController.swift, WMFAppViewController.swift, ArticleViewController.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.1 / 10Stronggated by 325 serious findings✓ Tool-verified

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

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

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

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

Duplicated block (6 lines × 2) · ×34WMF Framework/Collection+AsyncMap.swift:30
Duplicated block (5 lines × 2) · ×25WMFComponents/Sources/WMFComponents/Base/WMFCanvasViewController.swift:44
Duplicated block (7 lines × 2) · ×20WMF Framework/Fetcher.swift:110
Duplicated block (8 lines × 2) · ×19WMF Framework/ArticleCacheResourceDBWriting.swift:37
Duplicated block (9 lines × 2) · ×16WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/WMFActivityTabCustomizeViewModel.swift:103

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

What to do

  1. Resolve the 34 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with WMFAccountCreationViewController.swift (3), LockscreenSearchWidget.swift (2), DescriptionWelcomePageViewController.swift (2). — One of this dimension's main actionable groups (34 warning-level).
  2. Resolve the 25 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with AppOnboardingCoordinator.swift (2), InsertMediaImagePositionSettingsViewController.swift (2), WMFCanvasViewController.swift. — One of this dimension's main actionable groups (25 warning-level).
  3. Resolve the 20 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with WMFAccountCreationViewController.swift (2), Fetcher.swift, ReadingListsSyncOperation.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 · Coupling8.7 / 10Strong✓ Tool-verified

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

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

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

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

12 production modules (SwiftPM+Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 2 module(s) off the main sequence, with abstractness counted on 8 of the 12 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

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.8 / 10Strong✓ Tool-verified

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

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

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

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

110 of 599 classes have LCOM4 above 3.

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

What to do

  1. Resolve the 110 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 (110 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 Coverage6.3 / 10Adequate✓ 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 6.3 / 10 · rule-coverage 100% · ceiling Verified

Line coverage 29.5% — 8 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 · ×8WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift:1

What to do

  1. Resolve the 8 Low coverage finding(s) in Code Coverage — start with SourceConfig.swift, AgentData.swift, PageData.swift. — One of this dimension's main actionable groups (8 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Documented

1836 test methods: 1747 unit, 0 integration, 0 BDD, 89 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, 94 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1836 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 · ×83WikipediaUITests/AppOnboardingUITests.swift:7

What to do

  1. Resolve the 83 No direct assertions finding(s) in Test Quality — start with SavedUITests.swift (43), ArticleControlsUITests.swift (21), HomeUITests.swift (9). — One of this dimension's main actionable groups (83 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 7.4 / 10Strong✓ 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 7.4 / 10 · rule-coverage 75% · ceiling Verified

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

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 Scanning10.0 / 10Exemplary○ Nothing flagged

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

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.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.8 / 10Stronggated by 15 serious findings✓ Tool-verified

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

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

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

Top hotspots: Wikipedia/Code/WMFAppViewController.swift (61×27=1647); WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift (10×139=1390); Wikipedia/Code/DonateCoordinator.swift (18×66=1188)

Hotspot: Wikipedia/Code/WMFAppViewController.swift · ×15Wikipedia/Code/WMFAppViewController.swift:1326

What to do

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

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

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

129 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Wikipedia/Code/YearInReviewSlideViewModelFactory.swift. Counted over 721 of the 1273 production source files in this repository: 547 are under the ~2,400-byte size floor this dimension measures over, and the remaining 5 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 51 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

51 deducted task-comment markers across 162238 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 · ×49Wikipedia/Code/ActivityTabViewController.swift:275
HackComment · ×2Wikipedia/Code/ArticleViewController.swift:1076

What to do

  1. Resolve the 49 TodoComment finding(s) in Explicit Debt — start with Fetcher.swift (4), ExploreViewController.swift (3), WMFContentGroup+DetailViewControllers.swift (3). — One of this dimension's main actionable groups (49 warning-level).
  2. Resolve the 2 HackComment finding(s) in Explicit Debt — start with ArticleViewController.swift, WMFComponentNavigationController.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.

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

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

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

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project 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.

Projects may be oversized for their cohesion

What to do

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

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

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

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

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

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

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
REDACTED

What to do

  1. Resolve the 11 REDACTED finding(s) in Secrets (history) — start with REDACTED (7), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (11 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Documented

38 finding(s): 0 critical, 30 high, 4 medium, 4 low. 20 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 10 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 341, line 342, line 345, …), `WMFData/Tests/WMFDataTests/WMFFundraisingCampaignDataControllerTests.swift` (line 24, line 25, line 27, …), … (+5 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 15 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 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 1 REDACTED finding(s) charged to Static Analysis (SAST) — the other 20 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 (21 issue-level, 1 of them charged here).

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.3 / 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.3 / 10 · rule-coverage 100% · ceiling Documented

51 of 726 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 726 of the 1273 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:1
Orphaned file · ×50Widgets/Widgets/OnThisDayWidget.swift:1
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 50 Orphaned file finding(s) in Knowledge Freshness — start with OnThisDayWidget.swift, PageHistoryCollectionViewCell.swift, ColumnarCollectionViewLayout.swift. — One of this dimension's main actionable groups (50 recommendation-level).
  3. Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.6 / 10Adequategated by 12 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: WMFCommunityFeedView.swift↔WMFHomeViewModel.swift 73%; WMFDeveloperSettingsView.swift↔WMFDeveloperSettingsDataController.swift 70%; ArticleViewController+ArticlePreviewing.swift↔ColumnarCollectionViewController.swift 69%

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

What to do

  1. Resolve the 12 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 (12 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 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 5 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 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.ruby-version:1

What to do

  1. Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with .ruby-version. — 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 safety10.0 / 10Exemplary○ Nothing flagged

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.

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:733

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 your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project 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○ Nothing flagged

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 188583 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 192,531 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.
PF3 · Async & latency hygiene8.5 / 10Strong✓ Tool-verified

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

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

  • `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingViewModel.swift:237

What to do

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

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

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

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X3 · Exception handling6.1 / 10Adequate✓ Tool-verified

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

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

  • `catch _` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — Wikipedia/Code/UIViewController+Extensions.swift:25
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×15) — Wikipedia/Code/WMFAccountCreationViewController.swift:227, Wikipedia/Code/WMFKeychainCredentials.swift:19, Wikipedia/Code/WMFKeychainCredentials.swift:36, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:338, WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:354, WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Results/Articles View/WMFWhichCameFirstArticlesViewModel.swift:59, …

What to do

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

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

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

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

Other · Code Health — Whether PHP's static analysis checks null and is not undermined by a nullness baseline — PHPStan from level 8 (`checkNullables`) or Psalm at `errorLevel` 3 or stricter is what makes `?User` a type whose method call is an error, and the null entries of a baseline, `@psalm-suppress PossiblyNull…` and `@phpstan-ignore *.nonObject` are what silence it.

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

  • This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.

What to do

  • Raise PHPStan to level 8 (`level: 8` in `phpstan.neon.dist`, or `max`) or Psalm to `errorLevel="3"` or stricter, so `?Type` is a type the checker holds you to; generate a baseline for what that surfaces only to pay it down, not to keep it. Then resolve the baselined nullness errors rather than adding to them: each is a call on a value the checker showed could be null — narrow it (`if ($x === null) { … }`, `?->`, an early return), make the property non-nullable and initialise it in the constructor, or change the return type so the null cannot arrive.

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 Health59%Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture82%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity64%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness52%Adequate — gated by 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.
Accessibility32%Weak — gated by AC1, AC3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance71%StrongSolid.
Unscored — 2 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 18 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 13 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 49 check(s) not relevant to this codebase

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

  • 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 applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. PHP builds its object graph per request and shares none of it between requests. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — 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.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, PHP, Swift not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .php, .rb, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 49 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • 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#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, 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.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Ruby was read, and it logs through none: the standard library's Logger, which Rails.logger is, takes one finished message and no template arguments or fields (as log4net does in C#), so an interpolated message there loses nothing the API could have kept. The console gem (`Console.info`), SemanticLogger, Ougai and dry-logger would be judged.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×12
  • Boundary-crossing change coupling: WMFDeveloperSettingsView.swift ↔ WMFDeveloperSettingsDataController.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:1 — `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 70% of the time (31 of the 44 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 31 shared commits counted here, the most recent 3 are `91d9f81f` Add the Discover data controller, experiment and developer settings; `cf19ac4b` Decide the Year in Review experience from the slides with data; `c9ce202d` Remove games dev settings — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFTempAccountsSheetView.swift ↔ EditorViewController.swift WMFComponents/Sources/WMFComponents/Components/Temp Accounts/WMFTempAccountsSheetView.swift:1 — `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: WMFDeveloperSettingsView.swift ↔ WMFUserDefaultsKey.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:1 — `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 59% of the time (26 of the 44 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 26 shared commits counted here, the most recent 3 are `91d9f81f` Add the Discover data controller, experiment and developer settings; `c9ce202d` Remove games dev settings; `bab87769` Add the semantic search experiment and its developer settings — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFDeveloperSettingsViewModel.swift ↔ WMFMockDeveloperSettingsDataController.swift WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewModel.swift:1 — `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 58% of the time (22 of the 38 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 22 shared commits counted here, the most recent 3 are `cf19ac4b` Decide the Year in Review experience from the slides with data; `b37d1391` Create YiR dev settings section; `7e1cd722` Spacing — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFDonateViewController.swift ↔ SinglePageWebViewController.swift WMFComponents/Sources/WMFComponents/Components/Donate Form/WMFDonateViewController.swift:1 — `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: WMFYearInReviewView.swift ↔ YearInReviewCoordinator.swift WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewView.swift:1 — `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 54% of the time (22 of the 41 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 22 shared commits counted here, the most recent 3 are `19038776` add experience, fix iscontrib, skyscroll, fade; `2abb2b8f` Update iscontributor status/where it ocmes from, currentchrome, pagin…; `2e92f1a6` Rework mock to location slide — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFYearInReviewSlide.swift ↔ YearInReviewCoordinator.swift WMFData/Sources/WMFData/Models/Year In Review/WMFYearInReviewSlide.swift:1 — `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 52% of the time (11 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) — 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 `50bd8a9d` Remove excess data stuff; `ce1bb42e` Add templates; `abd983af` Add time, month calculations and add standard slide — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFSavedAllArticlesView.swift ↔ SavedAllArticlesCoordinator.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:1 — `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 52% of the time (11 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) — 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 `ddb60789` Trim the reading lists sheet and the Saved tab view models; `84627de0` Rewrite the Saved tab container in SwiftUI; `9ca84168` Add missing Saved All Articles events — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFImageRecommendationsBottomSheetViewController.swift ↔ ExploreViewController.swift WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsBottomSheetViewController.swift:1 — `WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsBottomSheetViewController.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 `c7642b03` Add filename and recommendation_source to warning action data (at that commit the file was still `Components/Sources/Components/Components/Suggested Edits/Image Recommendations/WKImageRecommendationsBottomSheetViewController.swift`); `a79bd678` Add event logging to warning (at that commit the file was still `Components/Sources/Components/Components/Suggested Edits/Image Recommendations/WKImageRecommendationsBottomSheetViewController.swift`); `329ed7bb` Add time warning to image recs (at that commit the file was still `Components/Sources/Components/Components/Suggested Edits/Image Recommendations/WKImageRecommendationsBottomSheetViewController.swift`) — run `git show` on any of them.
  • Boundary-crossing change coupling: WMFFeatureAnnouncementView.swift ↔ ExploreViewController.swift WMFComponents/Sources/WMFComponents/Components/Shared/Feature Announcement/WMFFeatureAnnouncementView.swift:1 — `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:1 — `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:1 — `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.
D28 · Secrets (history) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
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.
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:733 — `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.
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×1
  • Orphaned knowledge Wikipedia/Code/NotificationsCenterCell.swift:1 — No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Serious — 967 finding(s)
D6 · Cohesion (LCOM4) · Low cohesion · ×110
  • 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 27) Wikipedia/Code/WMFAppViewController.swift:49 — WMFAppViewController's methods fall into 27 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 27 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 15) WMF Framework/UIStackView+SubviewVerification.swift:1 — UIView's methods fall into 15 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 15 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: WMFDeveloperSettingsViewModel (LCOM4 13) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewModel.swift:51 — WMFDeveloperSettingsViewModel'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: 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: 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: 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: ReadingListsViewController (LCOM4 10) Wikipedia/Code/ReadingListsViewController.swift:13 — ReadingListsViewController'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: ArticleURLListViewController (LCOM4 9) Wikipedia/Code/ArticleURLListViewController.swift:5 — ArticleURLListViewController'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: SavedAllArticlesCoordinator (LCOM4 9) Wikipedia/Code/SavedAllArticlesCoordinator.swift:7 — SavedAllArticlesCoordinator'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.
  • + 85 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×49
  • TodoComment Wikipedia/Code/ActivityTabViewController.swift:275 — // TODO: Will probably need some special logging 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 Wikipedia/Code/AppDelegate.swift:24 — // TODO: Refactor background task refresh and notification token registration logic out of WMFAppViewController. Then we can then move tab bar instantiation into SceneDelegate. — 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/ArticleViewController.swift:987 — // todo: fix logging source, custom tab config? .appendArticleAndAssignCurrentTabAndCleanoutFutureArticles — 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/EditInteractionFunnel.swift:314 — // todo: confirm commas don't get cut 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 Wikipedia/Code/ExploreViewController.swift:863 — // todo: we may want to switch to get article source if we want to be more specific: — 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/ExploreViewController.swift:877 — // todo: we may want to switch to get article source if we want to be more specific: — 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/ExploreViewController.swift:1099 — // TODO: confirm with analytics — 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/HomeViewController.swift:149 — // TODO: Confirm the logging ID for Home with data before release. — 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/LocalNotificationCoordinator.swift:53 — // todo: localize if this prototype becomes a real experiment — 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/OldTalkPageReplyCell.swift:43 — // todo: may want to shift this higher or lower depending on screen size. Also possibly give it a max value — 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/PageHistoryCollectionViewCell.swift:256 — // TODO: Make sure all icons have the same sizes — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment Wikipedia/Code/PageHistoryFetcher.swift:315 — // TODO: get rid of this when the VC is swift and we can use default values in the other init — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment REDACTED:17 — // TODO: make non-optional? — 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/PlacesViewController.swift:1228 — // TODO: remember last setting? — 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/ProfileCoordinator.swift:195 — // todo: share localizations — 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/ReferenceShowing.swift:9 — // TODO: Fix duplication — 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/WMFReferencePageViewController.swift:31 — // TODO: Fix duplication — 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/SavedArticlesFetcher.swift:337 — // TODO: Clean up these DB inconsistencies in the DatabaseHousekeeper — 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/TalkPageReplyComposeController.swift:426 — // TODO: Allow if NOT temp accounts pilot wiki — 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/TalkPageTopicComposeViewController.swift:559 — // TODO: Allow if NOT temp accounts pilot wiki — 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: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:61 — // todo: pass in article source Explore > Nearby List — 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/YearInReviewCoordinator.swift:55 — /// TODO: add when data ticket 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.
  • + 24 more in this group — see findings.md.
D3 · God Classes · TooManyMethods · ×41
  • TooManyMethods: ArticleViewController Wikipedia/Code/ArticleViewController.swift:10 — TooManyMethods — 255 methods, declared across 20 files: Code/ArticleViewController.swift (97), Code/ArticleViewController+FindInPage.swift (19), Code/ArticleViewController+DonationReminder.swift (18), Code/ArticleViewController+ArticleToolbarHandling.swift (17), +16 more file(s). The bar is 30 methods; this is 225 over it, 8.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: WMFAppViewController Wikipedia/Code/WMFAppViewController.swift:49 — TooManyMethods — 191 methods, declared across 2 files: Code/WMFAppViewController.swift (134), Code/WMFAppViewController+Extensions.swift (57). The bar is 30 methods; this is 161 over it, 6.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ExploreViewController Wikipedia/Code/ExploreViewController.swift:9 — TooManyMethods — 143 methods. The bar is 30 methods; this is 113 over it, 4.77× 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, declared across 3 files: Code/TalkPageViewController.swift (77), Code/TalkPageViewController+FindInPage.swift (12), Code/TalkPageViewController+TalkPageFormattingToolbar.swift (9). The bar is 30 methods; this is 68 over it, 3.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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: WMFHomeDataController WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:3 — TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.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: 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 — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: 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:10 — TooManyMethods — 54 methods, declared across 2 files: Code/SearchResultsViewController.swift (32), Code/SearchResultsViewController+ResultsList.swift (22). The bar is 30 methods; this is 24 over it, 1.80× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Session Wikipedia/Code/Session.swift:26 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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: CommonStrings WMFLocalizations/Sources/WMFNativeLocalizations/CommonStrings.swift:7 — 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: WMFActivityTabViewController Wikipedia/Code/ActivityTabViewController.swift:12 — 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: 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: 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: UIViewController Wikipedia/Code/FundraisingAnnouncementPanel.swift:97 — TooManyMethods — 41 methods, declared across 16 files: Code/UIViewController+Extensions.swift (14), Code/UIViewController+WMFAlerts.swift (5), Code/UIViewController+WMFEmptyView.swift (4), Code/ViewController+URLHandling.swift (4), +12 more file(s). The bar is 30 methods; this is 11 over it, 1.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: UserDefaults Wikipedia/Code/NSUserDefaults+WMFApplicationDefaults.swift:35 — TooManyMethods — 40 methods, declared across 2 files: Code/NSUserDefaults+WMFExtensions.swift (37), Code/NSUserDefaults+WMFApplicationDefaults.swift (3). The bar is 30 methods; this is 10 over it, 1.33× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HomeViewController Wikipedia/Code/HomeViewController.swift:12 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 16 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×34
  • 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/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/Games/Splash Screen/WMFGamesSplashScreenViewModel.swift:39 — WMFComponents/Sources/WMFComponents/Components/Games/Splash Screen/WMFGamesSplashScreenViewModel.swift:39-44 | WMFComponents/Sources/WMFComponents/Components/Settings/Push Notifications/WMFPushNotificationsSettingsViewModel.swift:49-54 — 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/WMFGamesSplashScreenViewModel.swift:39` 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) 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) 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) 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/AppOnboardingCoordinator.swift:125 — Wikipedia/Code/AppOnboardingCoordinator.swift:125-130 | Wikipedia/Code/AppOnboardingCoordinator.swift:148-153 — both copies are in the same file, so extract the 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:125` 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/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:53 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:53-58 | 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:53` 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/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/ExploreViewController.swift:1038 — Wikipedia/Code/ExploreViewController.swift:1038-1043 | Wikipedia/Code/ExploreViewController.swift:1055-1061 — both copies are in the same file, so extract the 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:1038` 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:1314 — Wikipedia/Code/PlacesViewController.swift:1314-1319 | Wikipedia/Code/PlacesViewController.swift:1997-2002 — both copies are in the same file, so extract the 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:1314` 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/ReadingListsCoordinator.swift:111 — Wikipedia/Code/ReadingListsCoordinator.swift:111-116 | Wikipedia/Code/ReadingListsViewController.swift:131-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (6 lines × 2) Wikipedia/Code/SettingsCoordinator.swift:112 — Wikipedia/Code/SettingsCoordinator.swift:112-119 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1331-1336 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/TableOfContentsAnimator.swift:241 — Wikipedia/Code/TableOfContentsAnimator.swift:241-246 | Wikipedia/Code/TableOfContentsAnimator.swift:288-293 — both copies are in the same file, so extract the 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/TableOfContentsAnimator.swift:241` 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/WMFAccountCreationViewController.swift:173 — Wikipedia/Code/WMFAccountCreationViewController.swift:173-178 | Wikipedia/Code/WMFLoginViewController.swift: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 `Wikipedia/Code/WMFAccountCreationViewController.swift:173` 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/WMFAccountCreationViewController.swift:213 — Wikipedia/Code/WMFAccountCreationViewController.swift:213-218 | Wikipedia/Code/WMFLoginViewController.swift: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 `Wikipedia/Code/WMFAccountCreationViewController.swift:213` 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/WMFAccountCreationViewController.swift:646 — Wikipedia/Code/WMFAccountCreationViewController.swift:646-651 | Wikipedia/Code/WMFLoginViewController.swift: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 `Wikipedia/Code/WMFAccountCreationViewController.swift:646` 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) 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) 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) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewReadCountSlideDataController.swift:22 — WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewReadCountSlideDataController.swift:22-27 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopArticlesSlideDataController.swift:84-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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, `WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopArticlesSlideDataController.swift:92` calls `WMFPageViewsDataController` and `WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewReadCountSlideDataController.swift:31` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (6 lines × 2) 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.
  • + 9 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×25
  • 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) WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:93 — WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:93-97 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewHostingController.swift:259-263 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (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) 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/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/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) Wikipedia/Code/WMFAccountCreationViewController.swift:641 — Wikipedia/Code/WMFAccountCreationViewController.swift:641-645 | Wikipedia/Code/WMFLoginViewController.swift: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) 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/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:121 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:121-125 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:140-144 — before extracting anything, compare `Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift` and `Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) Wikipedia/Code/ArticleViewController+Editing.swift:358 — Wikipedia/Code/ArticleViewController+Editing.swift:358-362 | 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/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) 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) 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/WMFYearInReviewSaveCountSlideDataController.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 both call sites, so a change lands once.
  • 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/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:24 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:24-28 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:23-27 — before extracting anything, compare `Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift` and `Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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) 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.
  • Duplicated block (5 lines × 2) Wikipedia/Code/DiffListChangeCell.swift:139 — Wikipedia/Code/DiffListChangeCell.swift:139-143 | Wikipedia/Code/DiffListChangeCell.swift:168-172 — both copies are in the same file, so extract the 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) Wikipedia/Code/ExploreCardViewController.swift:353 — Wikipedia/Code/ExploreCardViewController.swift:353-357 | Wikipedia/Code/ExploreCardViewController.swift:360-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) Wikipedia/Code/HomeFeedSettingsCoordinator.swift:84 — Wikipedia/Code/HomeFeedSettingsCoordinator.swift:84-88 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:169-173 — both copies are in the same file, so extract the 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) WMFData/Sources/WMFDataMocks/WMFMockURLSession.swift:62 — WMFData/Sources/WMFDataMocks/WMFMockURLSession.swift:62-66 | WMFData/Sources/WMFDataMocks/WMFMockURLSession.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. 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.
D3 · God Classes · FileTooLong · ×24
  • FileTooLong: Code/PlacesViewController.swift Wikipedia/Code/PlacesViewController.swift — FileTooLong — 1722 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: PlacesViewController (10-2398). The bar is 500 significant lines; this is 1222 over it, 3.44× 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 — 1516 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: WMFAppViewController (49-1824). The bar is 500 significant lines; this is 1016 over it, 3.03× 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 — 1180 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 680 over it, 2.36× 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 — 1040 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: ArticleViewController (11-1476). The bar is 500 significant lines; this is 540 over it, 2.08× 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 — 907 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 407 over it, 1.81× 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 — 878 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 378 over it, 1.76× 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: WMFNativeLocalizations/CommonStrings.swift WMFLocalizations/Sources/WMFNativeLocalizations/CommonStrings.swift — FileTooLong — 786 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: CommonStrings (8-1158). The bar is 500 significant lines; this is 286 over it, 1.57× 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 — 608 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: PageHistoryViewController (21-827). The bar is 500 significant lines; this is 108 over it, 1.22× 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: Code/ActivityTabViewController.swift Wikipedia/Code/ActivityTabViewController.swift — FileTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: WMFActivityTabHostingController (10-816). The bar is 500 significant lines; this is 93 over it, 1.19× 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/Session.swift Wikipedia/Code/Session.swift — FileTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: Session (27-714). The bar is 500 significant lines; this is 65 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Code/SettingsCoordinator.swift Wikipedia/Code/SettingsCoordinator.swift — FileTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: SettingsCoordinator (13-859). The bar is 500 significant lines; this is 50 over it, 1.10× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: 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: Code/YearInReviewSlideViewModelFactory.swift Wikipedia/Code/YearInReviewSlideViewModelFactory.swift — FileTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: YearInReviewSlideViewModelFactory (9-854). 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: Event Platform/EventPlatformClient.swift WMF Framework/Event Platform/EventPlatformClient.swift — FileTooLong — 509 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 9 over it, 1.02× 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 — 502 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2 over it, 1.00× 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.
D3 · God Classes · ClassTooLong · ×21
  • ClassTooLong: PlacesViewController Wikipedia/Code/PlacesViewController.swift:9 — ClassTooLong — 1572 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 1172 over it, 3.93× 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:49 — ClassTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded), 191 methods. The bar is 400 significant lines; this is 732 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ArticleViewController Wikipedia/Code/ArticleViewController.swift:10 — ClassTooLong — 840 significant lines (blank, comment-only and punctuation-only lines excluded), 255 methods. The bar is 400 significant lines; this is 440 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CommonStrings WMFLocalizations/Sources/WMFNativeLocalizations/CommonStrings.swift:7 — ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 323 over it, 1.81× 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 — 642 significant lines (blank, comment-only and punctuation-only lines excluded), 143 methods. The bar is 400 significant lines; this is 242 over it, 1.61× 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 — 543 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 143 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: YearInReviewSlideViewModelFactory Wikipedia/Code/YearInReviewSlideViewModelFactory.swift:9 — ClassTooLong — 540 significant lines (blank, comment-only and punctuation-only lines excluded), 33 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: 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 — 519 significant lines (blank, comment-only and punctuation-only lines excluded), 46 methods. The bar is 400 significant lines; this is 119 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WMFActivityTabHostingController Wikipedia/Code/ActivityTabViewController.swift:10 — ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 99 over it, 1.25× 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: WMFSFSymbolIcon WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:55 — ClassTooLong — 435 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 35 over it, 1.09× 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: Session Wikipedia/Code/Session.swift:26 — ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 25 over it, 1.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: 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 Wikipedia/Code/WMFAccountCreationViewController.swift:10 — ClassTooLong — 414 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 14 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: 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.
  • ClassTooLong: CollectionViewEditController WMF Framework/CollectionViewEditController.swift:28 — ClassTooLong — 401 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 1 over it, 1.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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) WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:169 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:169-175 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift:212-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.
  • 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/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) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:83 — WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:83-89 | WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListsView.swift:72-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) 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) 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) Wikipedia/Code/WMFAccountCreationViewController.swift:280 — Wikipedia/Code/WMFAccountCreationViewController.swift:280-287 | Wikipedia/Code/WMFLoginViewController.swift:198-204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/WMFAccountCreationViewController.swift:328 — Wikipedia/Code/WMFAccountCreationViewController.swift:328-334 | Wikipedia/Code/WMFLoginViewController.swift:162-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:986 — Wikipedia/Code/ArticleViewController.swift:986-992 | 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×19
  • 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) 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/Saved/Reading Lists/WMFReadingListRow.swift:45 — WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListRow.swift:45-52 | WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRowSaved.swift:31-38 — 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) 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) Wikipedia/Code/ActivityTabViewController.swift:885 — Wikipedia/Code/ActivityTabViewController.swift:885-892 | 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:885` 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:64 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:64-71 | 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: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 (8 lines × 2) Wikipedia/Code/DiffContainerViewController.swift:1031 — Wikipedia/Code/DiffContainerViewController.swift:1031-1040 | Wikipedia/Code/PageHistoryViewController.swift:818-825 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:733 — Wikipedia/Code/ActivityTabViewController.swift:733-740 | 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) 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.
D3 · God Classes · MethodTooLong · ×18
  • MethodTooLong: WMFSFSymbolIcon.`for` WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift:205 — MethodTooLong — `for` runs 289 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× 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:92 — MethodTooLong — sections runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 171 over it, 2.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: WMFDeveloperSettingsView.body WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:13 — MethodTooLong — body runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: 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: PlacesViewController.regroupArticlesIfNecessary Wikipedia/Code/PlacesViewController.swift:1447 — 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: WMFAppViewController.generateActivityTab Wikipedia/Code/WMFAppViewController+Extensions.swift:1036 — MethodTooLong — generateActivityTab runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: WMFNavigationBarConfiguring.configureNavigationBar WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:119 — MethodTooLong — configureNavigationBar 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: WMFAppViewController.viewDidLoad Wikipedia/Code/WMFAppViewController.swift:156 — 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: DetailTransition.animateTransition Wikipedia/Code/DetailTransition.swift:36 — MethodTooLong — animateTransition runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ArticlePlaceView.setup Wikipedia/Code/ArticlePlaceView.swift:61 — MethodTooLong — setup runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ArticleCacheDBWriter.syncResources WMF Framework/ArticleCacheDBWriter+SyncResources.swift:35 — MethodTooLong — syncResources runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ReadingListsSyncOperation.locallyCreate WMF Framework/ReadingListsSyncOperation.swift:756 — MethodTooLong — locallyCreate runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AppOnboardingCoordinator.start Wikipedia/Code/AppOnboardingCoordinator.swift:33 — MethodTooLong — start runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NotificationsCenterCell.setup Wikipedia/Code/NotificationsCenterCell.swift:312 — MethodTooLong — setup runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×16
  • 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) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:92 — WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:92-100 | WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListsView.swift:81-89 — 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:41 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:41-49 | 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:41` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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:192 — Wikipedia/Code/PageHistoryViewController.swift:192-200 | Wikipedia/Code/PageHistoryViewController.swift:230-238 — both copies are in the same file, so extract the 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:192` 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:166 — Wikipedia/Code/SavedAllArticlesCoordinator.swift:166-176 | 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:166` 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/SavedArticleDownloadProgressObserver.swift:19 — Wikipedia/Code/SavedArticleDownloadProgressObserver.swift:19-27 | Wikipedia/Code/SavedTabBadgeController.swift:121-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) Wikipedia/Code/SavedArticlesFetcher.swift:267 — Wikipedia/Code/SavedArticlesFetcher.swift:267-275 | Wikipedia/Code/SavedArticlesFetcher.swift:319-327 — both copies are in the same file, so extract the 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:267` 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) WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift:67 — WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift:67-75 | WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListsViewModel.swift:67-75 — 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) WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:66 — WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:66-74 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewHostingController.swift:101-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:66` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) 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:309 — Wikipedia/Code/BaseExploreFeedSettingsViewController.swift:309-317 | 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×16
  • Swallowed exception (caught, then discarded) Wikipedia/Code/UIViewController+Extensions.swift:25 — `catch _` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Wikipedia/Code/WMFAccountCreationViewController.swift:227 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Wikipedia/Code/WMFKeychainCredentials.swift:19 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Wikipedia/Code/WMFKeychainCredentials.swift:36 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Wikipedia/Code/WMFKeychainCredentials.swift:53 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Wikipedia/Code/WMFLoginViewController.swift:482 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:625 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:863 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/WMFYearInReviewDonateCountSlideDataController.swift:42 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFData/Sources/WMFData/Data Controllers/Settings/WMFSettingsDataController.swift:130 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFData/Sources/WMFData/Data Controllers/Saved Articles/WMFSavedArticlesDataController.swift:251 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:287 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMFComponents/Sources/WMFComponents/Components/Article Tabs/WMFArticleTabsViewModel.swift:367 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMF Framework/CacheController.swift:30 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMF Framework/CacheDBWriterHelper.swift:85 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) WMF Framework/CacheDBWriterHelper.swift:96 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D15 · Churn × Complexity Hotspots · Hotspot · ×15
  • Hotspot: Wikipedia/Code/WMFAppViewController.swift Wikipedia/Code/WMFAppViewController.swift:1326 — Wikipedia/Code/WMFAppViewController.swift changed 61 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in WMFAppViewController.processUserActivity at line 1326. 9 of those changes were fix/bug commits, and the other 52 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -03:00' --full-history --no-merges -- Wikipedia/Code/WMFAppViewController.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:205 — WMFComponents/Sources/WMFComponents/Style/WMFIcon.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in WMFSFSymbolIcon.`for` at line 205. 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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/DonateCoordinator.swift Wikipedia/Code/DonateCoordinator.swift:226 — Wikipedia/Code/DonateCoordinator.swift changed 18 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 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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: WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:188 — WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in WMFYearInReviewDataController.fullSlideCount at line 188. 1 of those changes was a fix/bug commit, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -03:00' --full-history --no-merges -- WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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/ArticleViewController+Announcements.swift Wikipedia/Code/ArticleViewController+Announcements.swift:82 — Wikipedia/Code/ArticleViewController+Announcements.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 15 in ArticleViewController.showNewDonateExperienceCampaignModal at line 82. 4 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -03:00' --full-history --no-merges -- Wikipedia/Code/ArticleViewController+Announcements.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 10 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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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:136 — Wikipedia/Code/SettingsCoordinator.swift changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in SettingsCoordinator.handleSettingsAction at line 136. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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: WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift:126 — WMFData/Sources/WMFData/Data Controllers/Experiments/WMFExperimentsDataController.swift changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in WMFExperimentsDataController.determineBucketForExperiment at line 126. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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: 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 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in WMFActivityTabView.loggedInList at line 80. 1 of those changes was a fix/bug commit, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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: WMF Framework/Widget/WidgetController.swift WMF Framework/Widget/WidgetController.swift:370 — WMF Framework/Widget/WidgetController.swift changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in WidgetController.fetchTopReadContent at line 370. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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/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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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-30..2026-10-28, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-30 16:27:35 -03:00' --until='2026-10-28 16:27:35 -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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×13
  • 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) WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:79 — WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementHostingController.swift:79-89 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewHostingController.swift:246-256 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/Year in Review/WMFYearInReviewAnnouncementHostingController.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.
  • 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/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/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:243 — Wikipedia/Code/SavedArticlesFetcher.swift:243-253 | Wikipedia/Code/SavedArticlesFetcher.swift:292-302 — both copies are in the same file, so extract the 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: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.
  • 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/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) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:239 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:239-249 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:266-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:239` 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) 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.
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:37 — 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) · ×10
  • 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:139-148 — 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) 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) 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:460-469 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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/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:303 — Wikipedia/Code/WMFAuthenticationManager.swift:303-312 | Wikipedia/Code/WMFAuthenticationManager.swift:376-385 — both copies are in the same file, so extract the 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:303` 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:387` calls `submitInteraction` and `Wikipedia/Code/WMFAuthenticationManager.swift:313` 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 — before extracting anything, compare `Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift` and `Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: WMFCommunityFeedView.swift ↔ WMFHomeViewModel.swift WMFComponents/Sources/WMFComponents/Components/Home/WMFCommunityFeedView.swift:1 — `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:1 — `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:1 — `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:1 — `WMFData/Sources/WMFData/Store/WMFUserDefaultsKey.swift` and `WMFData/Sources/WMFDataMocks/WMFMockDeveloperSettingsDataController.swift` change together 58% of the time (22 of the 38 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 22 shared commits counted here, the most recent 3 are `a4da54a5` Split YiR eligibility into a data state and a slides experience; `ad82e504` Start dev settings; `10687bcc` Combine dev settings — run `git show` on any of them.
  • Change coupling: TimelineViewModel.swift ↔ WMFActivityTabView.swift WMFComponents/Sources/WMFComponents/Components/Activity Tab/View Models/TimelineViewModel.swift:1 — `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:1 — `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: WMFSavedAllArticlesViewModel.swift ↔ WMFPageRowSaved.swift WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift:1 — `WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesViewModel.swift` and `WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFPageRowSaved.swift` change together 54% of the time (14 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `e8a7ed6d` Remove Async from the name of the saved page row; `ddb60789` Trim the reading lists sheet and the Saved tab view models (at that commit the file was still `WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFAsyncPageRowSaved.swift`); `9ca84168` Add missing Saved All Articles events (at that commit the file was still `WMFComponents/Sources/WMFComponents/Components/Shared/Page/WMFAsyncPageRowSaved.swift`) — run `git show` on any of them.
  • Change coupling: RandomArticleCoordinator.swift ↔ TabsOverviewCoordinator.swift Wikipedia/Code/RandomArticleCoordinator.swift:1 — `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.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • 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) 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) 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) 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/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) 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) Wikipedia/Code/WMFAccountCreationViewController.swift:158 — Wikipedia/Code/WMFAccountCreationViewController.swift:158-171 | Wikipedia/Code/WMFLoginViewController.swift: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 `Wikipedia/Code/WMFAccountCreationViewController.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.
  • 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.
D8 · Code Coverage · Low coverage · ×8
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift WMFTestKitchen/Sources/WMFTestKitchen/Config/SourceConfig.swift:1 — 0.0% line coverage (0/6).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/AgentData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/AgentData.swift:1 — 0.0% line coverage (0/12).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/PageData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/PageData.swift:1 — 0.0% line coverage (0/9).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Context/PerformerData.swift WMFTestKitchen/Sources/WMFTestKitchen/Context/PerformerData.swift:1 — 0.0% line coverage (0/28).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/ContextController.swift WMFTestKitchen/Sources/WMFTestKitchen/ContextController.swift:1 — 3.9% line coverage (2/51).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Error+Extension.swift WMFTestKitchen/Sources/WMFTestKitchen/Error+Extension.swift:1 — 0.0% line coverage (0/14).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Instrument/Funnel.swift WMFTestKitchen/Sources/WMFTestKitchen/Instrument/Funnel.swift:1 — 0.0% line coverage (0/34).
  • Low coverage: WMFTestKitchen/Sources/WMFTestKitchen/Instrument/InstrumentImpl.swift WMFTestKitchen/Sources/WMFTestKitchen/Instrument/InstrumentImpl.swift:1 — 0.0% line coverage (0/54).
D36 · Supply-chain Provenance & Signing REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×7
  • 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) 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) 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) Wikipedia/Code/ExploreViewController.swift:1104 — Wikipedia/Code/ExploreViewController.swift:1104-1118 | Wikipedia/Code/HomeViewController.swift:159-173 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:1104` 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:259 — Wikipedia/Code/NewsViewController.swift:259-273 | 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/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:125 — Wikipedia/Code/ArticleViewController.swift:125-139 | 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 (12 lines × 2) · ×7
  • 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) WMFData/Sources/WMFData/Extensions/URL+API.swift:97 — WMFData/Sources/WMFData/Extensions/URL+API.swift:97-108 | WMFData/Sources/WMFData/Extensions/URL+API.swift:112-123 — both copies are in the same file, so extract the 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 (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/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) Wikipedia/Code/WMFAccountCreationViewController.swift:135 — Wikipedia/Code/WMFAccountCreationViewController.swift:135-146 | Wikipedia/Code/WMFLoginViewController.swift:115-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Wikipedia/Code/WMFAccountCreationViewController.swift:135` 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.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • 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) 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) 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 — before extracting anything, compare `Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift` and `Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • 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) 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/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewDaysVisitedSlideDataController.swift:74 — WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewDaysVisitedSlideDataController.swift:74-81 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopArticlesSlideDataController.swift:136-143 | WMFData/Sources/WMFData/Data Controllers/Year In Review/Slide Data Controllers/YearInReviewTopTopicsSlideDataController.swift:236-243 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:149 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:149-156 | 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×7
  • Swallowed exception (empty catch) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:338 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) WMFComponents/Sources/WMFComponents/Components/Settings/Home/For You/Whats Driving/Your Interests/WMFHomeFeedInterestsSettingsViewModel.swift:354 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Results/Articles View/WMFWhichCameFirstArticlesViewModel.swift:59 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/Cards/WMFWhichCameFirstCardViewModel.swift:61 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) WMF Framework/PermanentlyPersistableURLCache.swift:663 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) WMF Framework/Event Platform/StorageManager.swift:41 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Command Line Tools/Update Localizations/localization.swift:324 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
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 · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
  • 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/ActivityTabViewController.swift:40 — Wikipedia/Code/ActivityTabViewController.swift:40-122 | Wikipedia/Code/ExploreViewController.swift:122-153 | Wikipedia/Code/PlacesViewController.swift:121-211 | Wikipedia/Code/SearchViewController.swift:375-394 — 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:259-273 | 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:173 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:173-188 | WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:197-212 | 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 (13 lines × 2) · ×6
  • 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) WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:343 — WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:343-355 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:372-384 — both copies are in the same file, so extract the 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/WMFPageViewsDataController.swift:343` 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, `WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:371` calls `NSPredicate` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageViewsDataController.swift:342` 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 (13 lines × 2) WMFData/Sources/WMFData/Service/WMFBasicService.swift:232 — WMFData/Sources/WMFData/Service/WMFBasicService.swift:232-244 | WMFData/Sources/WMFData/Service/WMFBasicService.swift:267-279 — both copies are in the same file, so extract the 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:232` 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) Wikipedia/Code/HomeFeedSettingsCoordinator.swift:90 — Wikipedia/Code/HomeFeedSettingsCoordinator.swift:90-102 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:175-187 — both copies are in the same file, so extract the 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 (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.
D36 · Supply-chain Provenance & Signing REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift:41 — WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift:41-45 | WMFComponents/Sources/WMFComponents/Components/Editors/Choose Editor/WMFChooseEditorHostingController.swift:22-26 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:64-96 | WMFComponents/Sources/WMFComponents/Components/Search/Semantic Search Info/WMFSemanticSearchInfoHostingController.swift:31-45 | Wikipedia/Code/TalkPageTopicComposeViewController.swift:211-217 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:634 — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:634-683 | WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:31-86 | WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:10-78 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:23-67 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:44-84 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) 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 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) 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 (20–21 lines × 2) · ×4
  • 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) WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:164 — WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:164-183 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.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. 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:164` 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) Wikipedia/Code/ArticleViewController+Editing.swift:161 — Wikipedia/Code/ArticleViewController+Editing.swift:161-181 | Wikipedia/Code/ArticleViewController+Editing.swift:215-234 — both copies are in the same file, so extract the 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:161` 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 (16 lines × 2) · ×4
  • 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/DiffTransformer.swift:209 — Wikipedia/Code/DiffTransformer.swift:209-224 | Wikipedia/Code/DiffTransformer.swift:231-246 — both copies are in the same file, so extract the 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.
  • Duplicated block (16 lines × 2) WMFData/Sources/WMFData/Data Controllers/Discover/WMFDiscoverDataController.swift:107 — WMFData/Sources/WMFData/Data Controllers/Discover/WMFDiscoverDataController.swift:107-122 | WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFDonationReminderDataController.swift:371-386 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×4
  • 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) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:94 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:94-108 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:236-249 — both copies are in the same file, so extract the 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: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.
  • Duplicated block (14–15 lines × 2) WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFFundraisingCampaignDataController.swift:253 — WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFFundraisingCampaignDataController.swift:253-267 | 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:253` 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) Wikipedia/Code/ArticleViewController+Editing.swift:408 — Wikipedia/Code/ArticleViewController+Editing.swift:408-422 | 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:408` 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 (10–11 lines × 2) · ×4
  • 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.
  • 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) WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:37 — WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:37-46 | WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:24-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:37` 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, `WMFData/Sources/WMFData/Data Controllers/Shared/UserContributionsDataController.swift:21` calls `wikipedia` and `WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:34` 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 (10 lines × 3) · ×4
  • 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/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) · ×4
  • Duplicated block (9 lines × 3) Wikipedia/Code/ColumnarCollectionViewController.swift:510 — Wikipedia/Code/ColumnarCollectionViewController.swift:510-518 | Wikipedia/Code/NewsViewController.swift:262-270 | 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:239 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:239-247 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:251-259 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:266-274 — 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:239` 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 (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:229 — Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:229-235 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:242-248 | Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:269-275 — 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 (24 lines × 2) · ×3
  • 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.
  • 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.
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 × 2) · ×3
  • 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) 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.
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×3
  • 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) 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) 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 (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:260-267 | 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) Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:55 — Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift:55-59 | Wikipedia/Code/Advanced Settings/InsertMediaImageSizeSettingsViewController.swift:95-99 | Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift:55-59 — before extracting anything, compare `Wikipedia/Code/Advanced Settings/InsertMediaImagePositionSettingsViewController.swift` and `Wikipedia/Code/Advanced Settings/InsertMediaImageTypeSettingsViewController.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D17 · Explicit Debt · HackComment · ×2
  • HackComment Wikipedia/Code/ArticleViewController.swift:1076 — // 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.
  • 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
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 · Duplicated block (22–23 lines × 2) · ×2
  • 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.
  • 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.
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:1367 — Wikipedia/Code/DiffContainerViewController.swift:1367-1386 | 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:1367` 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:239 — Wikipedia/Code/NewsViewController.swift:239-257 | 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 (19 lines × 3) · ×2
  • 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:636 — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:636-654 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:29-47 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:45-63 — before extracting anything, compare `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift` as WHOLE FILES: this scan already matched 3 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:636` 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:655` 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 (18–19 lines × 2) · ×2
  • 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.
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) Wikipedia/Code/AppOnboardingCoordinator.swift:244 — Wikipedia/Code/AppOnboardingCoordinator.swift:244-256 | Wikipedia/Code/AppOnboardingCoordinator.swift:260-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:260` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) 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 (13 lines × 3) · ×2
  • Duplicated block (13 lines × 3) WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:150 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:150-162 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:283-295 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:373-385 — 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:150` 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 (12 lines × 8) · ×2
  • Duplicated block (12 lines × 8) 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/Components/Year in Review/WMFYearInReviewSlideViewModel.swift:80-91 | WMFComponents/Sources/WMFComponents/Utility/HTMLUtils.swift:36-47 | Wikipedia/Code/ArticleCoordinator.swift:185-196 — there are 8 copies across 7 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `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.
  • 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 (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 (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:1812 — Wikipedia/Code/ArticleViewController.swift:1812-1816 | Wikipedia/Code/ExploreViewController.swift:1949-1953 | Wikipedia/Code/HomeViewController.swift:527-531 | Wikipedia/Code/PlacesViewController.swift:2619-2623 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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).
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 · WMFAccountLoginLogoutFetcher.login (cyclomatic 56) · ×1
  • WMFAccountLoginLogoutFetcher.login (cyclomatic 56) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89 — WMFAccountLoginLogoutFetcher.login has cyclomatic complexity 56 (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.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 · PlacesViewController.regroupArticlesIfNecessary (cyclomatic 43) · ×1
  • PlacesViewController.regroupArticlesIfNecessary (cyclomatic 43) Wikipedia/Code/PlacesViewController.swift:1447 — 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:1827 — 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) WMF Framework/ArticleCacheDBWriter+SyncResources.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+ActionExtensions.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 · 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+Extensions.swift:494 — 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:1326 — 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+TextExtensions.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:371 — 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) Command Line Tools/Update Localizations/localization.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:473 — PermanentlyPersistableURLCache.updateCacheWithCachedResponse has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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:271 — 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.canonicalName (cyclomatic 30) 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 · SavedArticlesFetcher._update (cyclomatic 20) · ×1
  • SavedArticlesFetcher._update (cyclomatic 20) Wikipedia/Code/SavedArticlesFetcher.swift:221 — SavedArticlesFetcher._update 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 · WMFAuthenticationManager.loginWithSavedCredentials (cyclomatic 20) · ×1
  • WMFAuthenticationManager.loginWithSavedCredentials (cyclomatic 20) Wikipedia/Code/WMFAuthenticationManager.swift:263 — WMFAuthenticationManager.loginWithSavedCredentials 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/UIView+SemanticContent.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 · 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 · 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:126 — 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 · WMFSourceEditorFormatterList.toggleListItem (cyclomatic 17) · ×1
  • WMFSourceEditorFormatterList.toggleListItem (cyclomatic 17) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatterList+ButtonActions.swift:66 — WMFSourceEditorFormatterList.toggleListItem 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 · 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:611 — 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:459 — 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:1400 — 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+Extensions.swift:1258 — 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 · WMFSourceEditorFormatterHeading.toggleHeadingFormatting (cyclomatic 16) · ×1
  • WMFSourceEditorFormatterHeading.toggleHeadingFormatting (cyclomatic 16) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatterHeading+ButtonActions.swift:3 — WMFSourceEditorFormatterHeading.toggleHeadingFormatting 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 · 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:1312 — 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:190 — 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 · 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) Wikipedia/Code/WMFContentGroup+DetailViewControllers.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). Of this number, 9 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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 · WMFAccountLoginLogoutFetcher.login (cognitive 89) · ×1
  • WMFAccountLoginLogoutFetcher.login (cognitive 89) Wikipedia/Code/WMFAccountLoginLogoutFetcher.swift:89 — WMFAccountLoginLogoutFetcher.login has cognitive complexity 89 (threshold 15). Drivers by points: if/else 29 (60 pts), boolean chains 23, 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 · PlacesViewController.regroupArticlesIfNecessary (cognitive 88) · ×1
  • PlacesViewController.regroupArticlesIfNecessary (cognitive 88) Wikipedia/Code/PlacesViewController.swift:1447 — 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 · 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:1827 — 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) WMF Framework/ArticleCacheDBWriter+SyncResources.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) Command Line Tools/Update Localizations/localization.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 · 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:459 — 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:1312 — 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:1400 — 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 · 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:1326 — 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 · GenerateTopicsStrings.swift.top-level code (cognitive 36) · ×1
  • GenerateTopicsStrings.swift.top-level code (cognitive 36) scripts/GenerateTopicsStrings.swift:33 — GenerateTopicsStrings.swift.top-level code has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 2 (7 pts), error handling 2 (4 pts), ternaries 1 (2 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 · WMFAuthenticationManager.loginWithSavedCredentials (cognitive 35) · ×1
  • WMFAuthenticationManager.loginWithSavedCredentials (cognitive 35) Wikipedia/Code/WMFAuthenticationManager.swift:263 — WMFAuthenticationManager.loginWithSavedCredentials has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 2 (4 pts), boolean chains 3 (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 · WMFSourceEditorFormatterList.toggleListItem (cognitive 34) · ×1
  • WMFSourceEditorFormatterList.toggleListItem (cognitive 34) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatterList+ButtonActions.swift:66 — WMFSourceEditorFormatterList.toggleListItem has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 19). 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 · 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 · 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 · WMFSourceEditorFormatter.toggleFormatting (cognitive 31) · ×1
  • WMFSourceEditorFormatter.toggleFormatting (cognitive 31) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatter+ButtonActions.swift:15 — WMFSourceEditorFormatter.toggleFormatting has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 2 (4 pts), boolean chains 2 (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 · 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+ActionExtensions.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:126 — 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 · SavedArticlesFetcher._update (cognitive 27) · ×1
  • SavedArticlesFetcher._update (cognitive 27) Wikipedia/Code/SavedArticlesFetcher.swift:221 — SavedArticlesFetcher._update has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 4 (10 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 · 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 · Session.request (cognitive 26) · ×1
  • Session.request (cognitive 26) Wikipedia/Code/Session.swift:271 — 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:611 — 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:703 — 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 · NSManagedObjectContext.wmf_createOrUpdateArticleSummmaries (cognitive 25) · ×1
  • NSManagedObjectContext.wmf_createOrUpdateArticleSummmaries (cognitive 25) WMF Framework/SummaryExtensions.swift:100 — NSManagedObjectContext.wmf_createOrUpdateArticleSummmaries has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (9 pts), boolean chains 2, error handling 1 (2 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 · 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 · TableOfContentsAnimator.gestureRecognizerShouldBegin (cognitive 24) · ×1
  • TableOfContentsAnimator.gestureRecognizerShouldBegin (cognitive 24) Wikipedia/Code/TableOfContentsAnimator.swift:323 — TableOfContentsAnimator.gestureRecognizerShouldBegin has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 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 · 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). Of this number, 12 points are the body's own statements and 12 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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:1979 — 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:371 — 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 · SessionDelegate.urlSession (cognitive 22) · ×1
  • SessionDelegate.urlSession (cognitive 22) Wikipedia/Code/Session.swift:852 — SessionDelegate.urlSession has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DatabasePopulationViewModel.populateViewedArticles (cognitive 22) · ×1
  • DatabasePopulationViewModel.populateViewedArticles (cognitive 22) Wikipedia/Code/Database Population/DatabasePopulationViewModel.swift:120 — 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). Of this number, 16 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · 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). Of this number, 18 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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) WMF Framework/SummaryExtensions.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:473 — PermanentlyPersistableURLCache.updateCacheWithCachedResponse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, boolean chains 8, match/switch 2, ternaries 1. Of this number, 17 points are the body's own statements and 3 belong to 2 function items inside it that branch. 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 · LegacyReadingListsDataSource.savedArticles (cognitive 20) · ×1
  • LegacyReadingListsDataSource.savedArticles (cognitive 20) Wikipedia/Code/LegacyReadingListsDataSource.swift:292 — LegacyReadingListsDataSource.savedArticles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (6 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WMFSourceEditorFormatter.textPositionsCloserToNearestFormattingStrings (cognitive 19) · ×1
  • WMFSourceEditorFormatter.textPositionsCloserToNearestFormattingStrings (cognitive 19) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatter+ButtonActions.swift:151 — WMFSourceEditorFormatter.textPositionsCloserToNearestFormattingStrings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, 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 · 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+Announcements.swift:82 — 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:1055 — 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:183 — 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+FindInPage.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 · WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cognitive 19) · ×1
  • WMFAppViewController.logWatchlistUserDidSaveFilterSettings (cognitive 19) Wikipedia/Code/WMFAppViewController+Extensions.swift:494 — 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+Extensions.swift:1258 — 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) Wikipedia/Code/WMFContentGroup+DetailViewControllers.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:127 — 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:790 — 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:190 — 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 · ReadingListsCollectionViewCell.sizeThatFits (cognitive 18) · ×1
  • ReadingListsCollectionViewCell.sizeThatFits (cognitive 18) Wikipedia/Code/ReadingListsCollectionViewCell.swift:73 — ReadingListsCollectionViewCell.sizeThatFits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, ternaries 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 · 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:364 — 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 · WMFYearInReviewDataController.populateYearInReviewReportData (cognitive 17) · ×1
  • WMFYearInReviewDataController.populateYearInReviewReportData (cognitive 17) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:576 — WMFYearInReviewDataController.populateYearInReviewReportData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 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 · 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 · 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 · UITestReadingListsSeeder.apply (cognitive 17) · ×1
  • UITestReadingListsSeeder.apply (cognitive 17) Wikipedia/Code/UITestSeeds/UITestReadingListsSeeder.swift:77 — UITestReadingListsSeeder.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (7 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 · UIView.wmf_preferredFrame (cognitive 17) · ×1
  • UIView.wmf_preferredFrame (cognitive 17) WMF Framework/UIView+SemanticContent.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 · WMFSourceEditorFormatter.getModifiedStartingFormattingStringForSingleWildcard (cognitive 16) · ×1
  • WMFSourceEditorFormatter.getModifiedStartingFormattingStringForSingleWildcard (cognitive 16) WMFComponents/Sources/WMFComponents/Components/Editors/Source Editor/Formatter Extensions/WKSourceEditorFormatter+ButtonActions.swift:93 — WMFSourceEditorFormatter.getModifiedStartingFormattingStringForSingleWildcard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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.fullSlideCount (cognitive 16) · ×1
  • WMFYearInReviewDataController.fullSlideCount (cognitive 16) WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:188 — WMFYearInReviewDataController.fullSlideCount has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 2 (3 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · 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 · ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cognitive 16) · ×1
  • ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded (cognitive 16) Wikipedia/Code/ArticleViewController+Announcements.swift:9 — ArticleViewController.showFundraisingCampaignAnnouncementIfNeeded has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (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 · 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 · WMFAccountCreationViewController.createAccount (cognitive 16) · ×1
  • WMFAccountCreationViewController.createAccount (cognitive 16) Wikipedia/Code/WMFAccountCreationViewController.swift:517 — WMFAccountCreationViewController.createAccount has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 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 · 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 · WMFAuthenticationManager.logout (cognitive 16) · ×1
  • WMFAuthenticationManager.logout (cognitive 16) Wikipedia/Code/WMFAuthenticationManager.swift:459 — 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) Wikipedia/Code/WMFLoginViewController.swift:234 — 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/UIViewController+Push.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.
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
D4 · Code Duplication · Near-duplicate member family (3 members, 12 shared lines) · ×1
  • Near-duplicate member family (3 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/Settings/WMFSettingsViewModel.swift:92-142 | WMFComponents/Sources/WMFComponents/Components/Watchlist/Filter/WMFWatchlistFilterViewModel.swift:38-66 — These 3 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 3 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 3 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:99-127 | 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:1036-1244 | 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • 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:285-307 | 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.
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:165 — WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:165-208 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:296-338 | WMFComponents/Sources/WMFComponents/Components/Profile/WMFProfileViewModel.swift:387-430 — 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:604 — Wikipedia/Code/ArticleViewController.swift:604-636 | Wikipedia/Code/ExploreViewController.swift:1158-1190 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:604` 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:567 — Wikipedia/Code/Session.swift:567-592 | Wikipedia/Code/Session.swift:598-624 — both copies are in the same file, so extract the 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:567` 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 (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:1339-1363 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:1339` 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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) Wikipedia/Code/ReadingListsCollectionViewCell.swift:106 — Wikipedia/Code/ReadingListsCollectionViewCell.swift:106-126 | Wikipedia/Code/SavedArticlesCollectionViewCell.swift:181-202 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:106` 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–21 lines × 4) · ×1
  • Duplicated block (11–21 lines × 4) 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 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementViewModel.swift:29-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:41 — WMFComponents/Sources/WMFComponents/Components/Settings/WMFSettingsViewController.swift:41-55 | 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:41` 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 (19 lines × 4) · ×1
  • Duplicated block (19 lines × 4) 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 | WMFComponents/Sources/WMFComponents/Components/Year in Review/WMFYearInReviewAnnouncementViewModel.swift:30-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `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.
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 (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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) WMF Framework/PermanentlyPersistableURLCache.swift:771 — WMF Framework/PermanentlyPersistableURLCache.swift:771-787 | WMF Framework/PermanentlyPersistableURLCache.swift:792-808 — both copies are in the same file, so extract the 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.
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:187 — Wikipedia/Code/SettingsTabViewController.swift:187-202 | 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:187` 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–15 lines × 3) · ×1
  • Duplicated block (9–15 lines × 3) WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:49 — WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:49-63 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift:50-58 | WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:69-77 — before extracting anything, compare `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift` as WHOLE FILES: this scan already matched 3 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 `WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.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. 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, `WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:48` calls `String` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift:68` 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 (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 (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 × 5) · ×1
  • Duplicated block (12–13 lines × 5) 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 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–13 lines × 4) · ×1
  • Duplicated block (11–13 lines × 4) Wikipedia/Code/ActivityTabViewController.swift:566 — Wikipedia/Code/ActivityTabViewController.swift:566-578 | Wikipedia/Code/DonationReminderSetupCoordinator.swift:150-160 | Wikipedia/Code/ExploreViewController.swift:1681-1691 | Wikipedia/Code/YearInReviewCoordinator.swift:386-397 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:1152 — Wikipedia/Code/WMFAppViewController.swift:1152-1164 | Wikipedia/Code/WMFAppViewController.swift:1166-1178 | Wikipedia/Code/WMFAppViewController.swift:1180-1192 | Wikipedia/Code/WMFAppViewController.swift:1193-1205 — 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:1152` 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:1152` calls `WMFLocalizedString` and `Wikipedia/Code/WMFAppViewController.swift:1193` 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/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/Components/Year in Review/WMFYearInReviewSlideViewModel.swift:85-96 | 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 (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:399 — Wikipedia/Code/ArticleViewController+Editing.swift:399-410 | 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:399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:131 — WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:131-142 | WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:164-175 | WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.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. Read the line range as the matched WINDOW rather than a finished unit: at `WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsView.swift:131` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `caption` to `"Resets \"maybe later\" / \"already donated\"` in one and `"Forgets the hidden state and the first use` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10–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:455-464 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 (10–11 lines × 3) · ×1
  • Duplicated block (10–11 lines × 3) Wikipedia/Code/AppOnboardingCoordinator.swift:184 — Wikipedia/Code/AppOnboardingCoordinator.swift:184-193 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:96-105 | Wikipedia/Code/HomeFeedSettingsCoordinator.swift:181-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:184` 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 (8–11 lines × 2) · ×1
  • Duplicated block (8–11 lines × 2) WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:289 — WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift:289-299 | WMFComponents/Sources/WMFComponents/Utility/UIImage+FaceCrop.swift:33-40 — 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/Search/Results/WMFSearchResultsViewModel.swift:289` 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 (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:1065-1075 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1090-1091 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1100-1103 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1122-1124 | Wikipedia/Code/WMFAppViewController+Extensions.swift:1132-1139 | 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:1065` 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 (6–10 lines × 4) · ×1
  • Duplicated block (6–10 lines × 4) Wikipedia/Code/ActivityTabViewController.swift:113 — Wikipedia/Code/ActivityTabViewController.swift:113-122 | Wikipedia/Code/ExploreViewController.swift:141-146 | Wikipedia/Code/PlacesViewController.swift:201-211 | Wikipedia/Code/SearchViewController.swift:385-394 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:113` 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. 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–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:154-163 | 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 (2–10 lines × 5) · ×1
  • Duplicated block (2–10 lines × 5) WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift:43 — WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift:43-44 | WMFComponents/Sources/WMFComponents/Components/Editors/Choose Editor/WMFChooseEditorHostingController.swift:24-25 | WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstViewController.swift:68-83 | WMFComponents/Sources/WMFComponents/Components/Search/Semantic Search Info/WMFSemanticSearchInfoHostingController.swift:33-42 | Wikipedia/Code/TalkPageTopicComposeViewController.swift:214-216 — 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 `WMFComponents/Sources/WMFComponents/Components/Developer Settings/WMFDeveloperSettingsViewController.swift:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–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:162 — Wikipedia/Code/ActivityTabViewController.swift:162-171 | Wikipedia/Code/HomeViewController.swift:407-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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: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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:644 — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:644-652 | WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift:36-44 | 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 — before extracting anything, compare `WMFData/Sources/WMFData/Data Controllers/Shared/WMFArticleSearchDataController.swift` and `WMFData/Sources/WMFData/Data Controllers/Shared/WMFRandomDataController.swift` as WHOLE FILES: this scan already matched 3 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 `WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:644` 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:642` 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:287-295 | 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 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 | Wikipedia/Code/WMFAccountCreationViewController.swift:135-139 | Wikipedia/Code/WMFLoginViewController.swift:115-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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:287-293 | 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:578 — Wikipedia/Code/ActivityTabViewController.swift:578-586 | Wikipedia/Code/ExploreViewController.swift:1693-1698 | Wikipedia/Code/HelpViewController.swift:139-139 | Wikipedia/Code/YearInReviewCoordinator.swift:399-407 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from 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:578` 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:115-119 | 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 (6 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) Wikipedia/Code/ArticleViewController+Editing.swift:364 — Wikipedia/Code/ArticleViewController+Editing.swift:364-370 | 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 · Duplicated block (14–15 lines × 4) · ×1
  • Duplicated block (14–15 lines × 4) WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:175 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:175-188 | WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:199-212 | 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:158 — WMFData/Sources/WMFDataMocks/WMFMockBasicService.swift:158-171 | 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:1 — .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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingViewModel.swift:237 — `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Minor — 187 finding(s)
D10 · Test Quality · No direct assertions · ×83
  • No direct assertions: testFirstLaunchShowsOnboardingSmoke WikipediaUITests/AppOnboardingUITests.swift:7 — No conventional assertion call was detected, and 83 of 84 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:13 — No conventional assertion call was detected, and 83 of 84 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: testAdvanceThroughAllStepsCompletesOnboarding WikipediaUITests/AppOnboardingUITests.swift:45 — No conventional assertion call was detected, and 83 of 84 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: testSkipFromPersonalizationCompletesOnboarding WikipediaUITests/AppOnboardingUITests.swift:53 — No conventional assertion call was detected, and 83 of 84 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:61 — No conventional assertion call was detected, and 83 of 84 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:70 — No conventional assertion call was detected, and 83 of 84 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:87 — No conventional assertion call was detected, and 83 of 84 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: testInterestsSearchAddsArticle WikipediaUITests/AppOnboardingUITests.swift:100 — No conventional assertion call was detected, and 83 of 84 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: testArticleBackButtonReturnsToHome WikipediaUITests/ArticleControlsUITests.swift:4 — No conventional assertion call was detected, and 83 of 84 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: testArticleHomeButtonReturnsToHome WikipediaUITests/ArticleControlsUITests.swift:9 — No conventional assertion call was detected, and 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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 83 of 84 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.
  • + 58 more in this group — see findings.md.
D34 · Knowledge Freshness · Orphaned file · ×50
  • Orphaned file Widgets/Widgets/OnThisDayWidget.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/PageHistoryCollectionViewCell.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/ColumnarCollectionViewLayout.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/QuadKey.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/NSLocale+WMFExtras.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/ColumnarCollectionViewLayoutInfo.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/UIView+SemanticContent.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/ArticleTableOfContentsDisplayController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/CollectionViewCellActionsView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/Event Platform/StorageManager.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/PlaceSearch.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Widgets/Views/Sparkline.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/ShareViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/WMFSparklineView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/SaveButtonsController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/WMFKeychainCredentials.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/NotificationsCenterDetailHeaderCell.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file WMF Framework/Event Platform/SamplingController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file scripts/generate_dice_roll_html.rb:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/MediaListGalleryViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/ReferenceBackLinksViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/ActionHandlerScript.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/BatchEditSelectView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Wikipedia/Code/PageHistoryComparisonSelectionViewController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 25 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×18
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:181 — `!selectionState.isBulletSingleList && !selectionState.isBulletMultipleList` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:178 — `!selectionState.isNumberSingleList && !selectionState.isNumberMultipleList` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift:70 — `UIDevice.current.userInterfaceIdiom != .pad && height <= 667` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Core/WMFWhichCameFirstView.swift, WMFComponents/Sources/WMFComponents/Components/Games/Which Came First/Results/WMFWhichCameFirstResultsView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift:429 — `UIDevice.current.userInterfaceIdiom == .pad && UITraitCollection.current.horizontalSizeClass == .regular` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Extensions/Navigation Bar/WMFNavigationBarConfiguring.swift, Wikipedia/Code/SearchBarIPadCustomizer.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Extensions/UIViewController+Extensions.swift:6 — `UIDevice.current.userInterfaceIdiom == .pad && traitCollection.horizontalSizeClass == .regular` appears character-identically in 4 files — WMFComponents/Sources/WMFComponents/Extensions/UIViewController+Extensions.swift, Wikipedia/Code/ArticleViewController.swift, Wikipedia/Code/SettingsTabViewController.swift, Wikipedia/Code/WMFSettingsViewController+Extensions.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/SettingsCoordinator.swift:117 — `WMFTempAccountDataController.shared.primaryWikiHasTempAccountsEnabled && dataStore.authenticationManager.authStateIsTemporary` appears character-identically in 3 files — Wikipedia/Code/SettingsCoordinator.swift, Wikipedia/Code/UIViewController+ProfileButton.swift, Wikipedia/Code/WMFAppViewController+Extensions.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMF Framework/ActionButton.swift:25 — `contentSizeCategory == nil || contentSizeCategory != traitCollection.preferredContentSizeCategory` appears character-identically in 3 files — WMF Framework/ActionButton.swift, Wikipedia/Code/CollectionViewCell.swift, Wikipedia/Code/SizeThatFitsReusableView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift:60 — `descriptionLabel.wmf_hasText || !isImageViewHidden` appears character-identically in 2 files — Wikipedia/Code/ArticleRightAlignedImageCollectionViewCell.swift, Wikipedia/Code/SavedArticlesCollectionViewCell.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/CollectionViewCell.swift:178 — `fitSize.height == CGFloat.greatestFiniteMagnitude || fitSize.height == UIView.noIntrinsicMetric` appears character-identically in 2 files — Wikipedia/Code/CollectionViewCell.swift, Wikipedia/Code/SizeThatFitsReusableView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/ColumnarCollectionViewController.swift:204 — `isCurrentlyEmpty != isEmpty || showingEmptyViewType != emptyViewType` appears character-identically in 2 files — Wikipedia/Code/ColumnarCollectionViewController.swift, Wikipedia/Code/InsertMediaSearchResultsCollectionViewController.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:681 — `page.pageprops?.disambiguation == nil && page.pageprops?.mainpage == nil` appears character-identically in 2 files — WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift, WMFData/Sources/WMFData/Data Controllers/Shared/WMFRelatedPagesDataController.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:184 — `selectionState.isBulletMultipleList || selectionState.isNumberMultipleList` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:177 — `selectionState.isBulletSingleList || selectionState.isBulletMultipleList` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:188 — `selectionState.isBulletSingleList || selectionState.isBulletMultipleList || selectionState.isNumberSingleList || selectionState.isNumberMult…` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift:180 — `selectionState.isNumberSingleList || selectionState.isNumberMultipleList` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Accessory Views/Expanding/WMFEditorToolbarExpandingView.swift, WMFComponents/Sources/WMFComponents/Components/Editors/Common Views/Input Views/WMFEditorInputView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/FundraisingAnnouncementPanel.swift:65 — `traitCollection.horizontalSizeClass == .regular && traitCollection.verticalSizeClass == .regular` appears character-identically in 2 files — Wikipedia/Code/FundraisingAnnouncementPanel.swift, Wikipedia/Code/PlacesViewController.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift:79 — `viewModel.isAnnouncementVisible && !viewModel.isEditing && viewModel.searchText.isEmpty` appears character-identically in 2 files — WMFComponents/Sources/WMFComponents/Components/Saved/All Articles/WMFSavedAllArticlesView.swift, WMFComponents/Sources/WMFComponents/Components/Saved/Reading Lists/WMFReadingListsView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Wikipedia/Code/TalkPageCell.swift:153 — `viewModel.leadComment == nil && viewModel.otherContentHtml != nil` appears character-identically in 2 files — Wikipedia/Code/TalkPageCell.swift, Wikipedia/Code/TalkPageCellTopicView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Silent fallback default in catch · ×13
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Activity Tab/WMFActivityTabDataController.swift:208 — `activityTabVisitCount` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Evergreen Account Creation/WMFEvergreenAccountCreationDataController.swift:265 — `readingDays` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Evergreen Account Creation/WMFEvergreenAccountCreationDataController.swift:277 — `savedArticleCount` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:236 — `storedSeenArticles` turns every thrown error into `[:]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Home/WMFHomeDataController.swift:251 — `hiddenCardKeys` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Local Notifications/WMFLocalNotificationDataController.swift:162 — `handledDays` turns every thrown error into `[:]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Local Notifications/WMFLocalNotificationDataController.swift:191 — `loadLog` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMFData/Sources/WMFData/Data Controllers/Year In Review/WMFYearInReviewDataController.swift:199 — `fullSlideCount` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMF Framework/CacheDBWriterHelper.swift:85 — `allDownloadedVariantItems` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMF Framework/CacheDBWriterHelper.swift:96 — `allVariantItems` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch WMF Framework/SharedContainerCache.swift:65 — `fileNames` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Wikipedia/Code/NotificationsCenterViewModel.swift:397 — `numberOfUnreadNotifications` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Wikipedia/Code/NSString+Range.swift:11 — `ranges` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×4
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 75 significant file(s) lose their only recent owner: Wikipedia/Code/YearInReviewSlideViewModelFactory.swift, Wikipedia/Code/WhichCameFirstCoordinator.swift, WMF Framework/ExploreCardCollectionViewCell.swift, Widgets/Widgets/OnThisDayView.swift, Wikipedia/Code/EvergreenAccountCreationCoordinator.swift, WMFComponents/Sources/WMFComponents/Components/Shared/Rive/WMFRiveAnimationViewModel.swift, WMFData/Sources/WMFData/Data Controllers/Shared/WMFPageTopicsDataController.swift, WMFComponents/Sources/WMFComponents/Components/App Onboarding/WMFAppOnboardingStepViews.swift (+67 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 25 significant file(s) lose their only recent owner: WMFData/Sources/WMFData/Data Controllers/Donor Experience/WMFDonationReminderDataController.swift, Wikipedia/Code/TableOfContentsAnimator.swift, WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultsViewModel.swift, WMFComponents/Sources/WMFComponents/Components/Search/Semantic Search Results/Card/WMFSemanticSearchResultViewModel.swift, WMFComponents/Sources/WMFComponents/Components/Donation Reminder/WMFDonationReminderSetupView.swift, Wikipedia/Code/NotificationsCenterCommonViewModel+LinkExtensions.swift, WMFComponents/Sources/WMFComponents/Components/Search/Results/WMFSearchResultRow.swift, WMFData/Sources/WMFData/Data Controllers/Semantic Search/WMFSemanticSearchDataController+Results.swift (+17 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 22 significant file(s) lose their only recent owner: WMFComponents/Sources/WMFComponents/Components/Suggested Edits/Image Recommendations/WMFImageRecommendationsViewController.swift, Wikipedia/Code/FindAndReplaceKeyboardBar.swift, WMF Framework/ImageCacheController.swift, Wikipedia/Code/InsertMediaViewController.swift, WMF Framework/LocationManager.swift, Wikipedia/Code/UIViewController+FeatureComponentFactory.swift, Wikipedia/Code/EditLinkViewController.swift, Wikipedia/Code/DetailTransition.swift (+14 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
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 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 (129 single-owned of 721 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 721 of the 1273 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: scripts/update-qqq.php.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 3 of 5 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (107949 LoC, 1462 module-visible types across 29 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 50 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: 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, Wikipedia/Code/ArticleTableOfContentsDisplayController.swift (and 42 more) (51 orphaned of 726 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 726 of the 1273 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 188583 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.)
X5 · Nullable reference types · PHP static analysis does not check null everywhere · ×1
  • PHP static analysis does not check null everywhere — This repository commits no PHPStan or Psalm configuration (`phpstan.neon[.dist]`, `phpstan.dist.neon`, `psalm.xml[.dist]`, or one a composer.json script names with `--configuration`), so nothing checks null: a `?Customer` reaches `->name()` silently and throws `Error: Call to a member function name() on null` the first time it is null. If the build passes a level on a command line instead, put it in a committed configuration — this check reads configuration, and configuration is all it can read.
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.28.0, but 6.28.1 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.16.2 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-5202b692de1a4b17a4d0fa5e5296989a/history.json --exit-code 0 --source .132artifacts/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-5202b692de1a4b17a4d0fa5e5296989a/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .38artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesosv-scanner—osv-scanner --format json --recursive --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .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 49 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`, … (+44 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 --experimental-disable-plugins transitivedependency/requirements --experimental-disable-plugins dotnet/csproj --experimental-disable-plugins dotnet/nugetcpm .0artifacts/raw/osv-scanner.json

Run 01a1849f-ced5-7a11-a8d7-9df1b9d43924 · 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