Public report of CHANG-JUI-LIN/Yuedu-reader, published 17 November 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 reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). 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, 17 November 2026, 18:02 UTC · Survey ID cd_552c1358a58048abbdc95ba39bea4cb3
CHANG-JUI-LIN/Yuedu-reader
Measured 17 November 2026, 18:01 UTC, at code version 5671a24
Code coverage is not measured: Swift suite (CouldNotMeasureRanButNoData).
CAI scoreAt risk
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: 383,003 lines of product code in 13 projects, tests not counted · Estimated rebuild effort: about 3.7 person-years · Weakest lens: Production Readiness, 36.5
Findings by how serious they are
67 critical2681 serious281 minor
19 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 18:01 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 the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work 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 ▸
66of 66 dimensions measured by tools.
2999of 3029 findings point to an exact file and line, so you can open each one in the code. The other 30 concern the repository as a whole, such as missing documentation.
66dimensions across 8 lenses, read from 383,003 lines of product code in 13 projects.
CHANG-JUI-LIN/Yuedu-reader is rated At risk because critical security findings are open, most of them in the packages it uses. Its score is held back in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 50.4 out of 100, which the At risk rating leaves unchanged.
Production Readiness, at 36.5, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 8.3 points. Adding automated security scanning would lift Production Readiness itself, worth about 5.2 points. Raising Production Readiness to 70 would lift the score to about 60.7.
Ten known security holes in the packages the code depends on can be used by attackers. Two passwords or keys in the code's history and one in the code are open to anyone who can read the repository, and two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Replacing each exposed password or key, updating the vulnerable packages and pinning each tool to an exact version would close these risks. Fixing the weaknesses the scanner points to would fix the security weakness in the code, and the two places where the code runs text as code or as a command need a direct call instead. Giving each kind of identifier a type of its own would take care of the 40 identifiers passed around as plain numbers or text.
The product code is 383,003 lines, about €540,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 forThe 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.
If Production Readiness rose from 36.5 to 70, the lowest score rated Strong, the score would rise from 50.4 to about 60.7.
Code composition: what the lines of code are
Product code 67%Tests 33%
Rebuild cost: about €540,000 · Estimate
Cost to rebuild
€180,000 to €900,000, for 2,995 to 9,501 hours of work, about 3.7 person-years for 2 to 8 engineers
Difficulty of the problem
Standard, 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 50. 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.
Size
Large: 383,003 lines of product code
What it is not
Not 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: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 8.3 points · Low effort · REDACTED Scanning
2
Resolve the 1 Assertions commented out finding(s) in Test Quality — start with yuedu_appUITests.swift.
Raises the score by about 7.0 points · Low effort · Test Quality
3
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.
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 €540,000 to build again, about 3.7 person-years of work. Its weakest lens is Production Readiness, at 36.5 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
One cause behind 44 Domain Modelling findings · Common cause
44 findings in the Domain Modelling lens come from the same cause. The code models the business as objects, such as an order or a customer, and each object should guard its own rules: an order, for example, should refuse to be shipped before it has been paid. Here the objects don't do that. Some objects only hold data, while the rules that should keep that data valid sit elsewhere in the code. Identifiers, such as order numbers and customer numbers, are passed around as plain numbers or text, so nothing stops the code from using one kind where another belongs. Because all of these findings have the same cause, fixing it once, in the business objects themselves, deals with them together.
Based on: Rich vs anemic domain model (4 findings) · Strongly-typed ids (40 findings)
What to do: Give each business object the methods that enforce its rules, such as a method for shipping an order that first checks it has been paid, and let only those methods change its data. Give each kind of identifier a type of its own, so an order number can't be used where a customer number belongs.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 8.3 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.7 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 7% on every change. The history of the code shows how much it changes: about 730,671 lines over the last 90 days, which is about 2,963,277 lines a year. At that pace, the extra work comes to an estimated 237 to 1421.9 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 our 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.
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.
56 modules, with 44 dependencies between them. One loop runs through 4 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 16 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
Uses a module listed above itPart of a loopThe module itself
27→38 Packages~SwiftSoup uses repositorypart of a loop✕
Connections
124 pairs of types, where a type in Packages~SwiftSoup uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Packages~SwiftSoup uses repository, so a change to repository can break Packages~SwiftSoup, while a change to Packages~SwiftSoup can't break repository.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
functions.src uses functions.src.appStoreConnect, so a change to functions.src.appStoreConnect can break functions.src, while a change to functions.src can't break functions.src.appStoreConnect.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.appleTriagePolicy, so a change to functions.src.appleTriagePolicy can break functions.src, while a change to functions.src can't break functions.src.appleTriagePolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.entitlementPolicy, so a change to functions.src.entitlementPolicy can break functions.src, while a change to functions.src can't break functions.src.entitlementPolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.feedbackPushPolicy, so a change to functions.src.feedbackPushPolicy can break functions.src, while a change to functions.src can't break functions.src.feedbackPushPolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.feedbackTriagePolicy, so a change to functions.src.feedbackTriagePolicy can break functions.src, while a change to functions.src can't break functions.src.feedbackTriagePolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.reviewBuildPolicy, so a change to functions.src.reviewBuildPolicy can break functions.src, while a change to functions.src can't break functions.src.reviewBuildPolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.testflightRequestPolicy, so a change to functions.src.testflightRequestPolicy can break functions.src, while a change to functions.src can't break functions.src.testflightRequestPolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.transactionUpdatePolicy, so a change to functions.src.transactionUpdatePolicy can break functions.src, while a change to functions.src can't break functions.src.transactionUpdatePolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src uses functions.src.triagePolicy, so a change to functions.src.triagePolicy can break functions.src, while a change to functions.src can't break functions.src.triagePolicy.
Position
Below the diagonal: functions.src uses a module listed above it, which is the healthy direction.
functions.src.apns uses functions.src.feedbackPushPolicy, so a change to functions.src.feedbackPushPolicy can break functions.src.apns, while a change to functions.src.apns can't break functions.src.feedbackPushPolicy.
Position
Below the diagonal: functions.src.apns uses a module listed above it, which is the healthy direction.
functions.src.appleTriage uses functions.src.appleTriagePolicy, so a change to functions.src.appleTriagePolicy can break functions.src.appleTriage, while a change to functions.src.appleTriage can't break functions.src.appleTriagePolicy.
Position
Below the diagonal: functions.src.appleTriage uses a module listed above it, which is the healthy direction.
functions.tools uses functions.src.feedbackTriagePolicy, so a change to functions.src.feedbackTriagePolicy can break functions.tools, while a change to functions.tools can't break functions.src.feedbackTriagePolicy.
Position
Below the diagonal: functions.tools uses a module listed above it, which is the healthy direction.
gateway.src.context uses gateway.src.callableProxy, so a change to gateway.src.callableProxy can break gateway.src.context, while a change to gateway.src.context can't break gateway.src.callableProxy.
Position
Below the diagonal: gateway.src.context uses a module listed above it, which is the healthy direction.
gateway.src.context uses gateway.src.config, so a change to gateway.src.config can break gateway.src.context, while a change to gateway.src.context can't break gateway.src.config.
Position
Below the diagonal: gateway.src.context uses a module listed above it, which is the healthy direction.
gateway.src.feedbackPolicy uses functions.src.feedbackTriagePolicy, so a change to functions.src.feedbackTriagePolicy can break gateway.src.feedbackPolicy, while a change to gateway.src.feedbackPolicy can't break functions.src.feedbackTriagePolicy.
Position
Below the diagonal: gateway.src.feedbackPolicy uses a module listed above it, which is the healthy direction.
gateway.src.reauth uses gateway.src.identityToolkit, so a change to gateway.src.identityToolkit can break gateway.src.reauth, while a change to gateway.src.reauth can't break gateway.src.identityToolkit.
Position
Below the diagonal: gateway.src.reauth uses a module listed above it, which is the healthy direction.
functions uses functions.src.appStoreConnect, so a change to functions.src.appStoreConnect can break functions, while a change to functions can't break functions.src.appStoreConnect.
Position
Below the diagonal: functions uses a module listed above it, which is the healthy direction.
gateway.src uses functions.src.feedbackTriage, so a change to functions.src.feedbackTriage can break gateway.src, while a change to gateway.src can't break functions.src.feedbackTriage.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.callableProxy, so a change to gateway.src.callableProxy can break gateway.src, while a change to gateway.src can't break gateway.src.callableProxy.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.config, so a change to gateway.src.config can break gateway.src, while a change to gateway.src can't break gateway.src.config.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.deletion, so a change to gateway.src.deletion can break gateway.src, while a change to gateway.src can't break gateway.src.deletion.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.errors, so a change to gateway.src.errors can break gateway.src, while a change to gateway.src can't break gateway.src.errors.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.firebase, so a change to gateway.src.firebase can break gateway.src, while a change to gateway.src can't break gateway.src.firebase.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.identityToolkit, so a change to gateway.src.identityToolkit can break gateway.src, while a change to gateway.src can't break gateway.src.identityToolkit.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.logger, so a change to gateway.src.logger can break gateway.src, while a change to gateway.src can't break gateway.src.logger.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.policy, so a change to gateway.src.policy can break gateway.src, while a change to gateway.src can't break gateway.src.policy.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.rateLimit, so a change to gateway.src.rateLimit can break gateway.src, while a change to gateway.src can't break gateway.src.rateLimit.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.sessionResponse, so a change to gateway.src.sessionResponse can break gateway.src, while a change to gateway.src can't break gateway.src.sessionResponse.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.context, so a change to gateway.src.context can break gateway.src, while a change to gateway.src can't break gateway.src.context.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.feedbackPolicy, so a change to gateway.src.feedbackPolicy can break gateway.src, while a change to gateway.src can't break gateway.src.feedbackPolicy.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src uses gateway.src.reauth, so a change to gateway.src.reauth can break gateway.src, while a change to gateway.src can't break gateway.src.reauth.
Position
Below the diagonal: gateway.src uses a module listed above it, which is the healthy direction.
gateway.src.routes uses gateway.src.auth, so a change to gateway.src.auth can break gateway.src.routes, while a change to gateway.src.routes can't break gateway.src.auth.
Position
Below the diagonal: gateway.src.routes uses a module listed above it, which is the healthy direction.
gateway.src.routes uses gateway.src.identityToolkit, so a change to gateway.src.identityToolkit can break gateway.src.routes, while a change to gateway.src.routes can't break gateway.src.identityToolkit.
Position
Below the diagonal: gateway.src.routes uses a module listed above it, which is the healthy direction.
gateway.src.routes uses gateway.src.policy, so a change to gateway.src.policy can break gateway.src.routes, while a change to gateway.src.routes can't break gateway.src.policy.
Position
Below the diagonal: gateway.src.routes uses a module listed above it, which is the healthy direction.
gateway.src.routes uses gateway.src.context, so a change to gateway.src.context can break gateway.src.routes, while a change to gateway.src.routes can't break gateway.src.context.
Position
Below the diagonal: gateway.src.routes uses a module listed above it, which is the healthy direction.
78 pairs of types, where a type in repository uses a type in Packages~SwiftSoup. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
repository uses Packages~SwiftSoup, so a change to Packages~SwiftSoup can break repository, while a change to repository can't break Packages~SwiftSoup.
Position
Below the diagonal: repository uses a module listed above it, which is the healthy direction.
38→39 repository uses Packages~LNSwiftUIUtils~LNSwiftUIUtilspart of a loop✕
Connections
10 pairs of types, where a type in repository uses a type in Packages~LNSwiftUIUtils~LNSwiftUIUtils.
repository uses Packages~LNSwiftUIUtils~LNSwiftUIUtils, so a change to Packages~LNSwiftUIUtils~LNSwiftUIUtils can break repository, while a change to repository can't break Packages~LNSwiftUIUtils~LNSwiftUIUtils.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
38→40 repository uses Packages~LNPopupUI~LNPopupUIpart of a loop✕
Connections
7 pairs of types, where a type in repository uses a type in Packages~LNPopupUI~LNPopupUI.
repository uses Packages~LNPopupUI~LNPopupUI, so a change to Packages~LNPopupUI~LNPopupUI can break repository, while a change to repository can't break Packages~LNPopupUI~LNPopupUI.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
Packages~LNSwiftUIUtils~LNSwiftUIUtils uses repository, so a change to repository can break Packages~LNSwiftUIUtils~LNSwiftUIUtils, while a change to Packages~LNSwiftUIUtils~LNSwiftUIUtils can't break repository.
Position
Below the diagonal: Packages~LNSwiftUIUtils~LNSwiftUIUtils uses a module listed above it, which is the healthy direction.
52 pairs of types, where a type in Packages~LNPopupUI~LNPopupUI uses a type in repository. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Packages~LNPopupUI~LNPopupUI uses repository, so a change to repository can break Packages~LNPopupUI~LNPopupUI, while a change to Packages~LNPopupUI~LNPopupUI can't break repository.
Position
Below the diagonal: Packages~LNPopupUI~LNPopupUI uses a module listed above it, which is the healthy direction.
Packages~LNPopupUI~LNPopupUI uses Packages~LNSwiftUIUtils~LNSwiftUIUtils, so a change to Packages~LNSwiftUIUtils~LNSwiftUIUtils can break Packages~LNPopupUI~LNPopupUI, while a change to Packages~LNPopupUI~LNPopupUI can't break Packages~LNSwiftUIUtils~LNSwiftUIUtils.
Position
Below the diagonal: Packages~LNPopupUI~LNPopupUI uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 46.5 · Weak · gated by D2, R2, R7 ·
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 category
Findings
Severity
A05:2025 — Injection
28
High / Critical
A03:2025 — Software Supply Chain Failures
26
High / Critical
A07:2025 — Authentication Failures
4
High / Critical
A02:2025 — Security Misconfiguration
3
Medium
Roadmap
Top priorities: Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Resolve the 1 Assertions commented out finding(s) in Test Quality — start with yuedu_appUITests.swift; 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.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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.
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
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 — 2681
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 — 281
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 19
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
This survey 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. All 66 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.
Every figure here is one of two 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. 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.
What we checked — 66 dimensions across the health lenses
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
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, 2999 of 3029 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. The 7,236 test(s) behind this row are the ones the code-model census could read, and this repository also carries at least 17 test source file(s) (.ts) that it cannot: it reads the test types the .swift frontend declared, so a suite in any other language is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.ts, .swift) and this repository declares a SwiftPM test suite (CLexbor), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we 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 package.json, but the licence verdict published here was taken over its SwiftPM package dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (3 contributor(s) across 2249 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 2 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We 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 per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): 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 — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D32 Data Compliance (PII/GDPR) — not measured this run — We 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. `Modules/Core/AI/AIAgenticAssistant+Question.swift`, `Modules/Core/AI/AIAnswerMarkdown.swift`, `Modules/Core/AI/AIDialogueAttribution.swift`, `Modules/Core/AI/AIReadingEvidence.swift`, `Modules/Core/Aozora/AozoraChapterPlanner.swift`, … (+385 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in REDACTED, whose lifetimes are not modelled 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.
AXR1 Runtime accessibility — not measured this run — We 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. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 14 — a file the compose project references is missing) — env file gateway/gateway.env not found: stat gateway/gateway.env: no such file or directory; runtime evidence skipped.
C1 Data Protection — not measured this run — We 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 — We 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 — We 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.
DM2 Strongly-typed ids — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 436 further occurrence(s) are not listed individually; the score already reflects all 476.
GD1 Unfinished & placeholder code — not measured this run — We 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, Scala, Rust and Java source only, and this repository's Swift, c, cpp, 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 — We 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, Scala and Rust source only, and this repository's Swift, c, cpp, 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 — We measured this, but not all of it. What we 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.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 10 further occurrence(s) are not listed individually; the score already reflects all 50.
X1 Async correctness — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X10 Duplicated predicate — not measured this run — We 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. 9 further occurrence(s) are not listed individually; the score already reflects all 49.
X12 Unreachable branch — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X2 Cancellation propagation — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X21 Side-effecting pattern guard — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X25 Inert configuration knob — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X27 Collection changed while being enumerated — not measured this run — We 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 Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala, Kotlin, PHP and Go source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala, Kotlin, PHP or Go was found, and this repository's C, C++, Objective-C, Swift (Foundation mutable collections) 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.
X29 Per-element action decided by a fixed element — not measured this run — We 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 most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we 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. 30 further occurrence(s) are not listed individually; the score already reflects all 70.
X4 Structured logging — not measured this run — We 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, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP log through no library that carries a message's values as fields (pino, winston, bunyan, tslog, LogTape, roarr; Python's logging, structlog; PHP's PSR-3 loggers), so its log calls cannot be judged, 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
We assess the repository exactly as committed, and only the repository. By design we do 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.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
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 REDACTED (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.
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.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
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.
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.
397 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ReaderView.buildBody at 127. A further 24 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 HTMLAttributedStringBuilder.userAgentDeclarations at 25 — they are counted neither in the figure above nor in this dimension's score. 12 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: Modules/Features/Library/Modules/RuleModuleMessages.swift (RuleModuleRejection.message at 23), Modules/Services/Works/HomeLayoutStyle.swift (HomeSectionLayout.style at 22), Modules/Services/Works/HomeSection.swift (HomeSectionBinding.encode at 22), Modules/Core/ReaderCore/ReaderSessionCoordinator.swift (ReaderSessionCoordinator.send at 21), Modules/Features/Explore/ExploreDestinations.swift (ExploreRouteDestinations.destination at 21), and 7 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.
+ 374 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ReaderView.buildBody (cyclomatic 127), _grabArticle (cyclomatic 118), HTMLAttributedStringBuilder.apply (cyclomatic 105). — 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 9 together lifts Cyclomatic Complexity from 5.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 593 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 4 bodies over 120 down to 120 or less in Cognitive Complexity — start with _grabArticle (cognitive 272), ReaderView.buildBody (cognitive 154), HTMLTableRasterizer.renderPages (cognitive 148). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 3.7 to about 4.9/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 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.
Resolve the 93 FileTooLong finding(s) in God Classes — start with CoreTextPaginator.swift, GlobalSettings.swift, BookStore.swift. — One of this dimension's main actionable groups (93 warning-level).
Resolve the 72 MethodTooLong finding(s) in God Classes — start with CoreTextPaginator.swift (4), NodeAttributedStringRenderer.swift (4), HTMLAttributedStringBuilder.swift (3). — One of this dimension's main actionable groups (72 warning-level).
Resolve the 69 ClassTooLong finding(s) in God Classes — start with CoreTextPaginator.swift, NodeAttributedStringRenderer.swift, BookStore.swift. — One of this dimension's main actionable groups (69 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
406 duplicated block group(s) detected. 5.1 % of the production lines (19,490 of 383,003) are in a reported copy. A further 515 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 8 of the 921 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.
+ 191 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 36 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with HomeView.swift (3), CoreTextPageEngine.swift (2), CoreTextPageView.swift (2). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 34 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with AudiobookDetailView.swift (3), RSSListView.swift (2), HTTPTTSEngine.swift (2). — One of this dimension's main actionable groups (34 warning-level).
Resolve the 33 Edited copy of a member (7 corresponding lines) finding(s) in Code Duplication — start with PublicationSession.swift (2), DiscoverViewModel.swift (2), FixedPageReaderView.swift (2). — One of this dimension's main actionable groups (33 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ 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.
13 production modules (npm+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; 0 module(s) off the main sequence, with abstractness counted on 4 of the 13 (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).
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.
Resolve the 19 Low cohesion finding(s) in Cohesion (LCOM4) — start with LegadoJSBridge.swift, AICharacterProfile.swift, GlobalSettings.swift. — One of this dimension's main actionable groups (19 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality9.7 / 10Adequategated by 1 critical finding✓ 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.
150 skipped (128 with a documented reason), 131 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 7236 tests. Measured on the .swift suite only — at least 17 test source file(s) (.ts) went unread, so its test quality is unmeasured and is not in these counts.
Resolve the 1 Assertions commented out finding(s) in Test Quality — start with yuedu_appUITests.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 130 No assertions finding(s) in Test Quality — start with DetailReaderBackSwipeUITests.swift (16), RSSToolbarVoiceOverTests.swift (9), LocalizedScreenshotUITests.swift (8). — One of this dimension's main actionable groups (130 warning-level).
Resolve the 22 Skipped test finding(s) in Test Quality — start with PublicLibraryLiveUITests.swift (7), PublicLibraryStorefrontUITests.swift (3), TrendsSeriesLiveUITests.swift (2). — One of this dimension's main actionable groups (22 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
17 outdated direct SwiftPM dependencies, 0 pinning defect(s). 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: abseil-cpp-binary · ×17
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 27 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 25 of them read from the licence file the repository carries at the revision REDACTED pins, and 2 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed REDACTED pins, direct and transitive, and every declared dependency none pins. 1 of them declare no licence that matches a known SPDX licence; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's SwiftPM package dependencies and nothing else. The repository also declares package.json, 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.
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.
Top hotspots: Modules/Features/Reader/ReaderView.swift (96×127=12192); Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift (42×54=2268); Modules/Services/LibraryStore/BookStore.swift (84×25=2100) Repeated repair below the complexity floor: Modules/Features/RSS/RSSListView.swift (12 of 21 changes were fixes); Modules/Features/Reader/ReaderTOCViews.swift (8 of 15 changes were fixes); Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.swift (8 of 15 changes were fixes)
Resolve the 104 Hotspot finding(s) in Churn × Complexity Hotspots — start with ReaderView.swift, ModernParserBridge.swift, BookStore.swift. — One of this dimension's main actionable groups (104 warning-level).
Resolve the 36 Repeated repair finding(s) in Churn × Complexity Hotspots — start with RSSListView.swift, ReaderTOCViews.swift, FixedPageWebtoonViewController.swift. — One of this dimension's main actionable groups (36 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
2 deducted task-comment markers across 383003 LoC (0.0/KLoC) → score 10.0. 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.
Resolve the 2 TodoComment finding(s) in Explicit Debt — start with LegadoAlignmentTests.swift, ReaderOrientationController.swift. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 89 document(s) read across 9 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
No ADRs foundYuedu-Reader.xcodeproj/project.pbxproj:1
What to do
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with project.pbxproj. — 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
8 naming inconsistencies among 278 declarations measured against a convention their peers follow.
`resolvedHREF` spells `HREF` where 89 names in the project spell it `Href`Modules/Core/EPUB/PublicationSession.swift:1122
`normalizedHREF` spells `HREF` where 89 names in the project spell it `Href`Modules/Core/EPUB/PublicationSession.swift:1942
`replaceEMLengths` spells `EM` where 39 names in the project spell it `Em`Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:506
`currentEpubPage` spells `Epub` where 22 names in the project spell it `EPUB`Modules/Core/ReaderCore/EPUBPageRenderer.swift:491
`isJsonArrayOrObject` spells `Json` where 95 names in the project spell it `JSON`Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2655
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 `resolvedHREF` spells `HREF` where 89 names in the project spell it… finding(s) in Naming Consistency — start with PublicationSession.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `normalizedHREF` spells `HREF` where 89 names in the project spell it… finding(s) in Naming Consistency — start with PublicationSession.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `replaceEMLengths` spells `EM` where 39 names in the project spell it… finding(s) in Naming Consistency — start with ChapterTitleHTMLCodec.swift. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
doc comments repeat the namesResources/Assets/Readability.js:25
What to do
Resolve the 2 redundant comment finding(s) in Comment Value — start with Readability.js (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
1 of 7 build units (SwiftPM, Xcode, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesionYuedu-Reader.xcodeproj/project.pbxproj:1
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with project.pbxproj. — 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.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
0 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.
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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
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.
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).
30 finding(s): 0 critical, 6 high, 20 medium, 4 low. 2 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 49 file(s) — `Modules/Core/ReaderCore/VolumeKeyHandler.swift` (line 38), `Modules/Core/RuleEngine/ModernParser/JS/LegadoCacheBridge.swift` (line 13, line 22, line 58, …), `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift` (line 674, line 712, line 730, …), `Modules/Core/TTS/TTSCoordinator.swift` (line 1495), `Modules/Features/Feedback/FeedbackScreenshotPrompt.swift` (line 222), … (+44 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 2 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (2 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
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 Gemfile.lock 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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7), REDACTED. — One of this dimension's main actionable groups (8 issue-level).
Resolve the 8 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (8). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 3 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 1135 of the 1335 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with ReaderView.swift (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 12 Change coupling finding(s) in Change Coupling — start with BookSourceFetcher+Chapter.swift (2), AudiobookDetailView.swift, BookSourceParsingPipeline.swift. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with ReaderView.swift, ReaderViewModifiers.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.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 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.
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.
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.
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.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`LegadoJSBridgeExport` declares 105 requirements: `ajax`, `axja`, `ajaxAll`, `ajaxTestAll`, `connect`, `connectWithOptions`, `head`, `headWithOptions`, `post`, `postWithOptions`, `httpExecute`, `httpGet`, `importScript`, `readFile`, `readTxtFile`, `deleteFile`, `downloadFile`, `cacheFile`, `webView`, `webViewGetSource`, `webViewGetOverrideUrl`, `getCookie`, `getCookieValue`, `removeCookie`, `getWebViewUA`, `put`, `get`, `getString`, `getStringList`, `setContent`, `getElements`, `getElementValue`, `newAnalyzeRule`, `digestBytes`, `sleepMillis`, `makeStrResponse`, `getUserAgent`, `getVerificationCode`, `startBrowser`, `startBrowserAwait`, and 65 more. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:394
`LegadoStrResponseExport` declares 21 requirements: `raw`, `callTime`, `request`, `header`, `hasHeader`, `cookie`, `contentType`, `isRedirect`, `priorResponse`, `body`, `bodyBytes`, `cookies`, `jsHeaders`, `code`, `message`, `statusCode`, `statusMessage`, `url`, `urlString`, `isSuccessful`, `toString`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3591
`LegadoJsoupElementExport` declares 40 requirements: `isJsoupNode`, `select`, `children`, `parent`, `body`, `html`, `outerHtml`, `text`, `ownText`, `wholeText`, `data`, `attr`, `absUrl`, `hasAttr`, `attributeList`, `tagName`, `id`, `className`, `title`, `matches`, `nextElementSibling`, `previousElementSibling`, `firstElementSibling`, `lastElementSibling`, `siblingElements`, `elementSiblingIndex`, `parents`, `closest`, `isSameNode`, `cloneElement`, `remove`, `setAttr`, `removeAttr`, `setText`, `setHtml`, `appendHtml`, `prependHtml`, `beforeHtml`, `afterHtml`, `empty`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:17
`LegadoSourceBridgeExport` declares 22 requirements: `getVariable`, `setVariable`, `putVariable`, `jsGetLoginInfo`, `putLoginInfo`, `getLoginInfoMap`, `removeLoginInfo`, `putLoginHeader`, `jsGetLoginHeader`, `getLoginHeaderMap`, `removeLoginHeader`, `getHeaderMap`, `login`, `put`, `get`, `evalJS`, `getKey`, `getTag`, `getSource`, `refreshExplore`, `refreshJSLib`, `putConcurrent`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:16
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
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.
`BookStore.loadMeta` is a read-named query yet it performs a durable write on the read path (a persist to a store/client). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — Modules/Services/LibraryStore/BookStore.swift:3613
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a typed-id struct) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
`DownloadActivityAttributes.appGroupID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Widget/DownloadActivityAttributes.swift:53
`Book.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. (×2) — Widget/DownloadActivityAttributes.swift:21, Modules/Core/AI/AIBookshelfOrganizer.swift:28
`AIBookRetrievalIndex.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookRetrievalIndex.swift:14
`AIBookVolume.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookSummary.swift:8
`AIBookSummaryPlan.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookSummary.swift:104
`Part.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookSummary.swift:97
`Batch.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookSummary.swift:101
`Move.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookshelfOrganizer.swift:141
`Group.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIBookshelfOrganizer.swift:150
`AIMemorySpan.sectionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:13
`AIMemoryUnit.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:47
`AIMemoryUnit.parentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:52
`AIMemoryJob.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:60
`AIMemoryJob.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:61
`AIMemoryJob.inFlightUnitID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:78
`AIMemoryEvidence.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:88
`AIMemoryEvidence.segmentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:89
`AIMemoryEvidence.unitID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:90
`AIMemoryMention.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:103
`AIMemoryMention.entityID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:104
`AIMemoryFact.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:113
`AIMemoryAlias.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:124
`AIMemoryAliasDecision.aliasID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:131
`AIMemoryCard.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemory.swift:150
`Segment.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemoryExtraction.swift:4
`Background.recordID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemoryExtraction.swift:5
`Quote.segmentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemoryExtraction.swift:13
`Mention.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AICharacterMemoryExtraction.swift:14
`AIChatMessage.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChatMessage.swift:10
`AIChatSession.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChatMessage.swift:81
`AIChatSession.serviceID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChatMessage.swift:84
`AIChatSuggestion.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChatMessage.swift:119
`AIContentChunk.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChunking.swift:26
`AIContentChunk.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChunking.swift:28
`AIContentChunk.sectionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChunking.swift:29
`AIChunkableSection.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIChunking.swift:60
`Quote.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIDialogueAttribution.swift:18
`AIProviderPreset.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIProviderPreset.swift:12
`AIQuestionEvidence.parentChunkID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value. — Modules/Core/AI/AIQuestionContext.swift:17
What to do
Adopt the repo's typed-id idiom consistently — wrap every entity identity in its own typed id.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model7.8 / 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.
`Entry` 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. — Modules/Features/Reader/ReaderViewportFragmentHost.swift:66
`UIColor` 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. — Modules/Features/BookDetail/BookIntroRichView.swift:258
`URL` 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. — Modules/Features/RSS/RSSFeedView.swift:735
`Data` 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. — Modules/Services/RSS/RSSFetcher.swift:8
What to do
Move delegated behaviour onto the domain entity (or make it a value object); keep invariants inside the type.
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.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
`ShelfWorkMerger.absorb` performs two independent DURABLE writes — `positionStore` (a persistence store) via `save` and `store` (a persistence store) via `delete` — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — Modules/Services/LibraryStore/ShelfWorkService.swift:271
What to do
Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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.
Do you agree with this assessment?
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's code 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.
Do you agree with this assessment?
P2 · Observability7.2 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 3/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `gateway`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
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 2 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. — REDACTED:5
`functions/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — functions/package.json:12
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.
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.
Do you agree with this assessment?
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — gateway/scripts/integration-auth.mjs:43
What to do
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
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 each language's code 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.
Do you agree with this assessment?
R1 · Type Safety9.4 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
gateway/src/identityToolkit.ts:68 · gateway/src/identityToolkit.ts:259 — the two spans are one implementation copied and then locally edited — 248 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — gateway/src/identityToolkit.ts:68
REDACTED:818 · REDACTED:974 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:818
gateway/src/routes/account.ts:10 · REDACTED:103 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/routes/account.ts:10
gateway/src/callableProxy.ts:61 · gateway/src/identityToolkit.ts:72 · gateway/src/identityToolkit.ts:263 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/callableProxy.ts:61
REDACTED:126 · REDACTED:153 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:126
gateway/src/identityToolkit.ts:128 · gateway/src/identityToolkit.ts:142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — gateway/src/identityToolkit.ts:128
gateway/src/policy.ts:180 · gateway/src/policy.ts:198 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/policy.ts:180
gateway/src/routes/account.ts:51 · REDACTED:209 · gateway/src/routes/avatar.ts:95 · REDACTED:250 · +3 more site(s) not listed — the 7 copies are spread across 6 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/routes/account.ts:51
REDACTED:35 · REDACTED:47 · REDACTED:59 · REDACTED:70 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:35
REDACTED:101 · REDACTED:134 · REDACTED:147 · REDACTED:224 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:101
Resources/Assets/Readability.js:2156 · Resources/Assets/Readability.js:2167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — Resources/Assets/Readability.js:2156
REDACTED:1098 · REDACTED:1218 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:1098
gateway/src/feedbackPolicy.ts:214 · gateway/src/feedbackPolicy.ts:370 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — gateway/src/feedbackPolicy.ts:214
REDACTED:81 · REDACTED:126 · REDACTED:153 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:81
REDACTED:99 · REDACTED:181 · gateway/src/routes/subscription.ts:63 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:99
gateway/src/routes/avatar.ts:72 · gateway/src/routes/subscription.ts:53 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/routes/avatar.ts:72
gateway/src/routes/profile.ts:22 · gateway/src/routes/subscription.ts:43 · gateway/src/routes/subscription.ts:76 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/routes/profile.ts:22
Resources/Assets/Readability.js:2249 · Resources/Assets/Readability.js:2259 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — Resources/Assets/Readability.js:2249
REDACTED:602 · REDACTED:618 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:602
functions/src/appStoreConnect.ts:92 · functions/src/appStoreConnect.ts:125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — functions/src/appStoreConnect.ts:92
REDACTED:282 · gateway/src/routes/subscription.ts:95 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:282
REDACTED:313 · REDACTED:325 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:313
gateway/src/routes/subscription.ts:29 · gateway/src/routes/subscription.ts:65 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/routes/subscription.ts:29
REDACTED:304 · REDACTED:391 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:304
REDACTED:168 · REDACTED:206 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:168
gateway/src/reauth.ts:114 · REDACTED:221 · gateway/src/routes/subscription.ts:109 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — gateway/src/reauth.ts:114
REDACTED:221 · gateway/src/routes/subscription.ts:109 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — REDACTED:221
functions/src/triage.ts:101 · functions/src/triage.ts: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. — functions/src/triage.ts:101
gateway/src/feedbackPolicy.ts:312 · gateway/src/routes/profile.ts:69 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — gateway/src/feedbackPolicy.ts:312
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
_grabArticle has cyclomatic complexity 106 and cognitive complexity 250; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:1021
routeExtractValue has cyclomatic complexity 47 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:970
parseSearchResultsJSON has cyclomatic complexity 37 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1101
mapIdentityToolkitError has cyclomatic complexity 36 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/errors.ts:96
extractValueFromObject has cyclomatic complexity 33 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:811
(anonymous) has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:1643
routeExtractList has cyclomatic complexity 29 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:911
applyJsonToken has cyclomatic complexity 26 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:728
(anonymous) has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — functions/src/feedbackTriage.ts:65
shouldRemoveNode has cyclomatic complexity 25 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:2561
(anonymous) has cyclomatic complexity 24 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:2341
queryElements has cyclomatic complexity 23 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:90
(anonymous) has cyclomatic complexity 22 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:2450
evaluateRuleLike has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:394
evaluateTemplateExpression has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:307
getList has cyclomatic complexity 19 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:127
splitTopLevel has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:170
(anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1227
sanitizePreferences has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/policy.ts:146
getAttr has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:55
getAttr has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:508
safeQuerySelectorAll has cyclomatic complexity 16 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:74
signInWithIdp has cyclomatic complexity 16 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/identityToolkit.ts:170
extractValueByJsoupDefaultFromElements has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:623
Readability has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:27
splitTrailingPutDirective has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:220
_getArticleTitle has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:553
verifyReauthentication has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/reauth.ts:24
parseChapterPayload has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1251
getElementsBySegment has cyclomatic complexity 14 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:566
parseJsoupSegment has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:540
parseSearchResults has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1076
refreshSession has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/identityToolkit.ts:247
getString has cyclomatic complexity 14 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:358
_markDataTables has cyclomatic complexity 13 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — Resources/Assets/Readability.js:2277
extractValueByCss has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:659
applyTocFormat has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:439
buildsUnderReview has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — functions/src/reviewBuildPolicy.ts:49
(anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — gateway/src/routes/profile.ts:26
shouldApplyTransaction has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — functions/src/transactionUpdatePolicy.ts:8
Do you agree with this assessment?
R3 · Large Files7.5 / 10Strong✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
Resources/Assets/Readability.js has 2500 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — Resources/Assets/Readability.js:1
REDACTED has 1220 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
functions/src/index.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — functions/src/index.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage7.0 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×14) — Resources/Assets/Readability.js:1, REDACTED:1, functions/src/index.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
What to do
Add eslint as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code0.8 / 10Critical✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 11 application, 1 tooling and 17 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (11 application, 1 tooling, 17 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — Resources/Assets/Readability.js, REDACTED
Nothing imports this binding — it is safe to review for removal. (×3) — gateway/src/config.ts:106, gateway/src/deletion.ts:9, gateway/src/policy.ts:92
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
Set: Referrer-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−0.5 on this card.) — scripts/trends/deploy/Caddyfile:12
What to do
Add Content-Security-Policy beside the headers already set; Content-Security-Policy is the one that pays for itself first, then Strict-Transport-Security, then nosniff and a frame policy.
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.
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.
Do you agree with this assessment?
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.
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.
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. (×32) — Resources/Assets/Readability.js:449, Resources/Assets/Readability.js:567, REDACTED:83, …
`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. (×8) — Packages/SwiftSoup/Sources/DocumentType.swift:137, Packages/SwiftSoup/Sources/Node.swift:304, Packages/SwiftSoup/Sources/String.swift:519, …
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.2 `!` null assertions per 1k TypeScript source lines — 1 assertion(s) across the 6404 source line(s) of the 43 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: functions/src/index.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
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.
Unscored — 5 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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 37 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.
Not included — 64 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (11 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this Java code is a Spring, JSR-330 or CDI singleton bean. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 14 — a file the compose project references is missing) — env file gateway/gateway.env not found: stat gateway/gateway.env: no such file or directory; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .swift suite was found but not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
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.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go 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+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 390 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the Swift half could not be measured — llvm-cov's export for Packages/CLexbor carried no production source rows. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
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
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
DM6 Domain ↔ infrastructure boundary — this Swift package maps no type to a persistence framework and declares no domain-model type carrying a method of its own, so DM6's domain↔infrastructure boundary read has no population to be taken over
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, Scala, Rust and Java, 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
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 not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — X1 reached only 5% of this repository's production lines — swift (332,009 lines), java (181 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X12 Unreachable branch — X12 reached only 5% of this repository's production lines — swift (332,009 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 3% of this repository's production lines — swift (332,009 lines), python (5,819 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — X2 reached only 5% of this repository's production lines — swift (332,009 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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.
X21 Side-effecting pattern guard — X21 reached only 5% of this repository's production lines — swift (332,009 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 5% of this repository's production lines — swift (332,009 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — X25 reached only 5% of this repository's production lines — swift (332,009 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X27 Collection changed while being enumerated — 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
X29 Per-element action decided by a fixed element — X29 reached only 3% of this repository's production lines — swift (332,009 lines), python (5,819 lines), c (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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)
DM2 · Strongly-typed ids· Raw-primitive id despite a typed-id idiom · ×40
Raw-primitive id despite a typed-id idiom: DownloadActivityAttributes.appGroupID Widget/DownloadActivityAttributes.swift:53— `DownloadActivityAttributes.appGroupID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Book.id Widget/DownloadActivityAttributes.swift:21— `Book.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIBookRetrievalIndex.bookID Modules/Core/AI/AIBookRetrievalIndex.swift:14— `AIBookRetrievalIndex.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIBookVolume.id Modules/Core/AI/AIBookSummary.swift:8— `AIBookVolume.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIBookSummaryPlan.bookID Modules/Core/AI/AIBookSummary.swift:104— `AIBookSummaryPlan.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Part.id Modules/Core/AI/AIBookSummary.swift:97— `Part.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Batch.id Modules/Core/AI/AIBookSummary.swift:101— `Batch.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Book.id Modules/Core/AI/AIBookshelfOrganizer.swift:28— `Book.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Move.id Modules/Core/AI/AIBookshelfOrganizer.swift:141— `Move.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: Group.id Modules/Core/AI/AIBookshelfOrganizer.swift:150— `Group.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemorySpan.sectionID Modules/Core/AI/AICharacterMemory.swift:13— `AIMemorySpan.sectionID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryUnit.id Modules/Core/AI/AICharacterMemory.swift:47— `AIMemoryUnit.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryUnit.parentID Modules/Core/AI/AICharacterMemory.swift:52— `AIMemoryUnit.parentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryJob.id Modules/Core/AI/AICharacterMemory.swift:60— `AIMemoryJob.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryJob.bookID Modules/Core/AI/AICharacterMemory.swift:61— `AIMemoryJob.bookID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryJob.inFlightUnitID Modules/Core/AI/AICharacterMemory.swift:78— `AIMemoryJob.inFlightUnitID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryEvidence.id Modules/Core/AI/AICharacterMemory.swift:88— `AIMemoryEvidence.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryEvidence.segmentID Modules/Core/AI/AICharacterMemory.swift:89— `AIMemoryEvidence.segmentID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryEvidence.unitID Modules/Core/AI/AICharacterMemory.swift:90— `AIMemoryEvidence.unitID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryMention.id Modules/Core/AI/AICharacterMemory.swift:103— `AIMemoryMention.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryMention.entityID Modules/Core/AI/AICharacterMemory.swift:104— `AIMemoryMention.entityID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryFact.id Modules/Core/AI/AICharacterMemory.swift:113— `AIMemoryFact.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryAlias.id Modules/Core/AI/AICharacterMemory.swift:124— `AIMemoryAlias.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryAliasDecision.aliasID Modules/Core/AI/AICharacterMemory.swift:131— `AIMemoryAliasDecision.aliasID` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
Raw-primitive id despite a typed-id idiom: AIMemoryCard.id Modules/Core/AI/AICharacterMemory.swift:150— `AIMemoryCard.id` is a raw primitive id while the repo already defines typed-id wrappers — an inconsistently-adopted typed-id idiom. Give this identity its own typed id so it can't be confused with another entity's id or a plain value.
DM4 · Rich vs anemic domain model· Anemic domain model · ×4
Anemic domain model: Entry Modules/Features/Reader/ReaderViewportFragmentHost.swift:66— `Entry` 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: UIColor Modules/Features/BookDetail/BookIntroRichView.swift:258— `UIColor` 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: URL Modules/Features/RSS/RSSFeedView.swift:735— `URL` 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: Data Modules/Services/RSS/RSSFetcher.swift:8— `Data` 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.
Boundary-crossing change coupling: ReaderView.swift ↔ BookContentProviderAdapters.swift Modules/Features/Reader/ReaderView.swift:1— `Modules/Features/Reader/ReaderView.swift` (context Features) and `Modules/Services/Online/BookContentProviderAdapters.swift` (context Services) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 7 shared commits counted here, the most recent 3 are `a4d77f62` refactor: unify online reader rendering pipeline; `cae3405f` Render online 段評 chapters via node layout; resolve EPUB TOC anchors t… (at that commit the files were still `iOS/Views/Reader/ReaderView.swift` and `iOS/Models/Online/BookContentProviderAdapters.swift`); `bb8476c2` refactor: 刪除 LegacyParser,移除 DefaultWebNovelParserService 依賴 (at that commit the files were still `yuedu app/Views/Reader/ReaderView.swift` and `yuedu app/Models/Online/BookContentProviderAdapters.swift`) — run `git show` on any of them.
Boundary-crossing change coupling: ReaderView.swift ↔ ChapterCacheRepository.swift Modules/Features/Reader/ReaderView.swift:1— `Modules/Features/Reader/ReaderView.swift` (context Features) and `Modules/Services/Online/ChapterCacheRepository.swift` (context Services) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 7 shared commits counted here, the most recent 3 are `ef165c3a` feat(reader): the table of contents marks the chapters that are not c…; `14f37c72` Show imported books in the Files app, move internal data out of Docum…; `136a7428` Fix book source runtime compatibility and reviews — run `git show` on any of them.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: BookStore.loadMeta Modules/Services/LibraryStore/BookStore.swift:3613— `BookStore.loadMeta` is a read-named query yet it performs a durable write on the read path (a persist to a store/client). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
Assertions commented out: testExample Tests/iOS-UI/yuedu_appUITests.swift:25— The test body contains commented-out assertion calls and no live one — it runs, verifies nothing, and still passes. Restore the assertions or delete the test; a green test that checks nothing is worse than an absent one.
Dual write (no outbox): ShelfWorkMerger.absorb Modules/Services/LibraryStore/ShelfWorkService.swift:271— `ShelfWorkMerger.absorb` performs two independent DURABLE writes — `positionStore` (a persistence store) via `save` and `store` (a persistence store) via `delete` — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
No assertions: testTraditionalChinese Tests/iOS-UI/ASOScreenshotUITests.swift:35— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSimplifiedChinese Tests/iOS-UI/ASOScreenshotUITests.swift:40— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testEnglish Tests/iOS-UI/ASOScreenshotUITests.swift:45— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testJapanese Tests/iOS-UI/ASOScreenshotUITests.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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testKorean Tests/iOS-UI/ASOScreenshotUITests.swift:55— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testFolderMenuRenamesAndUngroupsOnlyWhenConfirmed Tests/iOS-UI/BookshelfGroupsUITests.swift:103— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testRowSwipeOpensActionsWithoutGroups Tests/iOS-UI/BookshelfRowSwipeUITests.swift:146— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testReverseFlickKeepsMomentumAcrossGeometryAndChapterInsertion Tests/iOS-UI/ContinuousScrollMomentumUITests.swift:4— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testTXTReverseFlickKeepsMomentumWhenPreviousChapterArrives Tests/iOS-UI/ContinuousScrollMomentumUITests.swift:9— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDetailReaderLoadsAndReturns Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:115— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSearchDetailReaderLoadsAndReturns Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:120— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testBareBookDetailLooksFinished Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:241— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testBareBookDetailLooksFinishedWithPro Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:246— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testDetailMangaReaderLoadsAndReturns Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:440— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSearchDetailMangaReaderLoadsAndReturns Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:445— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSlideTurnHidesMenu Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1067— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testCoverTurnHidesMenu Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1068— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testCurlTurnHidesMenu Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1069— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testInstantTurnHidesMenu Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1070— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testScrollHidesMenu Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1071— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testSlideEdgeBack Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1519— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testCoverEdgeBack Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1520— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testCurlEdgeBack Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1521— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testInstantEdgeBack Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1522— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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: testScrollEdgeBack Tests/iOS-UI/DetailReaderBackSwipeUITests.swift:1523— 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
Hotspot: Modules/Features/Reader/ReaderView.swift Modules/Features/Reader/ReaderView.swift:1885— Modules/Features/Reader/ReaderView.swift changed 96 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 127 in ReaderView.buildBody at line 1885. 41 of those changes were fix/bug commits, and the other 55 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderView.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: Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:420— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in ModernParserBridge.wireJSEngine at line 420. 24 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/RuleEngine/ModernParser/ModernParserBridge.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: Modules/Services/LibraryStore/BookStore.swift Modules/Services/LibraryStore/BookStore.swift:2578— Modules/Services/LibraryStore/BookStore.swift changed 84 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in BookStore.commitRefreshedList at line 2578. 36 of those changes were fix/bug commits, and the other 48 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/LibraryStore/BookStore.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: Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:417— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in NodeAttributedStringRenderer.render at line 417. 16 of those changes were fix/bug commits, and the other 18 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.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: Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1761— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 105 in HTMLAttributedStringBuilder.apply at line 1761. 3 of those changes were fix/bug commits, and the other 12 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.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: Targets/Yuedu/SharedApp/yuedu_appApp.swift Targets/Yuedu/SharedApp/yuedu_appApp.swift:78— Targets/Yuedu/SharedApp/yuedu_appApp.swift changed 75 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in yuedu_appApp.init at line 78. 22 of those changes were fix/bug commits, and the other 53 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Targets/Yuedu/SharedApp/yuedu_appApp.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: Targets/Yuedu/SharedApp/GlobalSettings.swift Targets/Yuedu/SharedApp/GlobalSettings.swift:2121— Targets/Yuedu/SharedApp/GlobalSettings.swift changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in GlobalSettings.init at line 2121. 11 of those changes were fix/bug commits, and the other 39 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Targets/Yuedu/SharedApp/GlobalSettings.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: Modules/Features/BookDetail/OnlineBookView.swift Modules/Features/BookDetail/OnlineBookView.swift:761— Modules/Features/BookDetail/OnlineBookView.swift changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in OnlineBookView.loadTOC at line 761. 12 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/BookDetail/OnlineBookView.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: Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1055— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in CoreTextPaginator.computeLayout at line 1055. 11 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/CoreTextPaginator.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: Modules/Features/Bookshelf/HomeView.swift Modules/Features/Bookshelf/HomeView.swift:598— Modules/Features/Bookshelf/HomeView.swift changed 62 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in HomeView.body at line 598. 14 of those changes were fix/bug commits, and the other 48 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Bookshelf/HomeView.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: Modules/Features/Reader/CoreTextPagedView.swift Modules/Features/Reader/CoreTextPagedView.swift:201— Modules/Features/Reader/CoreTextPagedView.swift changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in CoreTextPageEngineView.updateUIViewController at line 201. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/CoreTextPagedView.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: Modules/Features/BookDetail/WorkDetailView.swift Modules/Features/BookDetail/WorkDetailView.swift:292— Modules/Features/BookDetail/WorkDetailView.swift changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in WorkDetailView.workPage at line 292. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/BookDetail/WorkDetailView.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: Modules/Features/Explore/Home/ExploreHome.swift Modules/Features/Explore/Home/ExploreHome.swift:230— Modules/Features/Explore/Home/ExploreHome.swift changed 63 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in ExploreHomeRoot.home at line 230. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Explore/Home/ExploreHome.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: Modules/Features/BookDetail/AudiobookDetailView.swift Modules/Features/BookDetail/AudiobookDetailView.swift:233— Modules/Features/BookDetail/AudiobookDetailView.swift changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in AudiobookDetailView.body at line 233. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/BookDetail/AudiobookDetailView.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: Modules/Services/iCloud/ICloudSyncManager.swift Modules/Services/iCloud/ICloudSyncManager.swift:414— Modules/Services/iCloud/ICloudSyncManager.swift changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in ICloudSyncManager.performSyncPass at line 414. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/iCloud/ICloudSyncManager.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: Modules/Services/RuleModules/RuleModuleValidator.swift Modules/Services/RuleModules/RuleModuleValidator.swift:69— Modules/Services/RuleModules/RuleModuleValidator.swift changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in RuleModuleValidator.validateFields at line 69. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/RuleModules/RuleModuleValidator.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: Modules/Services/Online/OnlineReadingPipeline.swift Modules/Services/Online/OnlineReadingPipeline.swift:319— Modules/Services/Online/OnlineReadingPipeline.swift changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in ChapterFetchManager.fetchChapter at line 319. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/Online/OnlineReadingPipeline.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: Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:602— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in BrowserLayoutPageEngine.preloadChapter at line 602. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.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: Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1474— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in CoreTextPageView.handleTap at line 1474. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/CoreTextPageView.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: Modules/Features/Reader/ReaderView+SourceChange.swift Modules/Features/Reader/ReaderView+SourceChange.swift:798— Modules/Features/Reader/ReaderView+SourceChange.swift changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in ReaderView.followTTSPlaybackHighlight at line 798. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderView+SourceChange.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: Modules/Features/Explore/Home/HomeRowView.swift Modules/Features/Explore/Home/HomeRowView.swift:12— Modules/Features/Explore/Home/HomeRowView.swift changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in HomeSection.displayTitle at line 12. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Explore/Home/HomeRowView.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: Modules/Features/Reader/ReaderView+PageBuilding.swift Modules/Features/Reader/ReaderView+PageBuilding.swift:362— Modules/Features/Reader/ReaderView+PageBuilding.swift changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ReaderView.loadContent at line 362. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderView+PageBuilding.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: Modules/Features/Reader/CoreTextCollectionScrollViewController.swift Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1924— Modules/Features/Reader/CoreTextCollectionScrollViewController.swift changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in CoreTextCollectionScrollViewController.commitViewportGeometry at line 1924. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/CoreTextCollectionScrollViewController.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: Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:69— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in CoreTextFontRegistrationService.registerUncached at line 69. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.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: Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:551— Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in CoreTextScrollEngine.loadChapter at line 551. 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-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.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.
FileTooLong: CoreText/CoreTextPaginator.swift Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift— FileTooLong — 2774 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: CoreTextPaginator (7-3766). The bar is 500 significant lines; this is 2274 over it, 5.55× 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: SharedApp/GlobalSettings.swift Targets/Yuedu/SharedApp/GlobalSettings.swift— FileTooLong — 2651 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: GlobalSettings (535-4084). The bar is 500 significant lines; this is 2151 over it, 5.30× 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: LibraryStore/BookStore.swift Modules/Services/LibraryStore/BookStore.swift— FileTooLong — 2425 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: BookStore (59-3863). The bar is 500 significant lines; this is 1925 over it, 4.85× 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: CoreText/NodeAttributedStringRenderer.swift Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift— FileTooLong — 2370 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: NodeAttributedStringRenderer (18-3401). The bar is 500 significant lines; this is 1870 over it, 4.74× 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: ModernParser/ModernParserBridge.swift Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift— FileTooLong — 2290 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1790 over it, 4.58× 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: Reader/ReaderView.swift Modules/Features/Reader/ReaderView.swift— FileTooLong — 2245 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ReaderView (16-3611). The bar is 500 significant lines; this is 1745 over it, 4.49× 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: JS/LegadoJSBridge.swift Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift— FileTooLong — 2129 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1629 over it, 4.26× 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: CoreText/CoreTextPageView.swift Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift— FileTooLong — 2107 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: CoreTextPageView (18-2551). The bar is 500 significant lines; this is 1607 over it, 4.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: Reader/CoreTextPagedView.swift Modules/Features/Reader/CoreTextPagedView.swift— FileTooLong — 1951 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: CoreTextPageEngineView (4-3242). The bar is 500 significant lines; this is 1451 over it, 3.90× 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: CoreText/HTMLAttributedStringBuilder.swift Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift— FileTooLong — 1938 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: HTMLAttributedStringBuilder (10-2716). The bar is 500 significant lines; this is 1438 over it, 3.88× 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: Bookshelf/HomeView.swift Modules/Features/Bookshelf/HomeView.swift— FileTooLong — 1871 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1371 over it, 3.74× 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: Reader/CoreTextCollectionScrollViewController.swift Modules/Features/Reader/CoreTextCollectionScrollViewController.swift— FileTooLong — 1607 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: CoreTextCollectionScrollViewController (10-2166). The bar is 500 significant lines; this is 1107 over it, 3.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: ReaderCore/ReaderHTMLUtilities.swift Modules/Core/ReaderCore/ReaderHTMLUtilities.swift— FileTooLong — 1602 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ReaderHTMLUtilities (4-2474). The bar is 500 significant lines; this is 1102 over it, 3.20× 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: Assets/Readability.js Resources/Assets/Readability.js— FileTooLong — 1486 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 986 over it, 2.97× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: EPUB/PublicationSession.swift Modules/Core/EPUB/PublicationSession.swift— FileTooLong — 1451 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 951 over it, 2.90× 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: BrowserLayout/BrowserLayoutPageEngine.swift Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift— FileTooLong — 1407 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: BrowserLayoutPageEngine (350-2063). The bar is 500 significant lines; this is 907 over it, 2.81× 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: JS/JSCoreEngine.swift Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift— FileTooLong — 1348 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: JSCoreEngine (16-2379). The bar is 500 significant lines; this is 848 over it, 2.70× 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: BookDetail/BookDetailComponents.swift Modules/Features/BookDetail/BookDetailComponents.swift— FileTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 772 over it, 2.54× 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: RSS/RSSListView.swift Modules/Features/RSS/RSSListView.swift— FileTooLong — 1249 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 749 over it, 2.50× 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: CoreText/CoreTextPageEngine.swift Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift— FileTooLong — 1245 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: CoreTextPageEngine (263-1975). The bar is 500 significant lines; this is 745 over it, 2.49× 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: CoreText/CommentBubbleSVGRecognizer.swift Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift— FileTooLong — 1216 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: CommentBubbleSVGRecognizer (95-1249). The bar is 500 significant lines; this is 716 over it, 2.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: iCloud/ICloudSyncManager.swift Modules/Services/iCloud/ICloudSyncManager.swift— FileTooLong — 1208 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: ICloudSyncManager (118-1997). The bar is 500 significant lines; this is 708 over it, 2.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: TTS/AudiobookPlayer.swift Modules/Core/TTS/AudiobookPlayer.swift— FileTooLong — 1097 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: AudiobookPlayer (122-1741). The bar is 500 significant lines; this is 597 over it, 2.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: RSS/RSSFetcher.swift Modules/Services/RSS/RSSFetcher.swift— FileTooLong — 1086 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 586 over it, 2.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: RuleEngine/RuleEngine.swift Modules/Core/RuleEngine/RuleEngine.swift— FileTooLong — 1055 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: RuleEngine (19-1629). The bar is 500 significant lines; this is 555 over it, 2.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
MethodTooLong: ReaderView.buildBody Modules/Features/Reader/ReaderView.swift:1885— MethodTooLong — buildBody runs 910 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 810 over it, 9.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: JSCoreEngine.configureContext Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:947— MethodTooLong — configureContext runs 629 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 529 over it, 6.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: GlobalSettings.init Targets/Yuedu/SharedApp/GlobalSettings.swift:2121— MethodTooLong — init runs 474 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 374 over it, 4.74× 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: HTMLTableRasterizer.renderPages Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:461— MethodTooLong — renderPages runs 439 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 339 over it, 4.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CoreTextPaginator.computeLayout Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1055— MethodTooLong — computeLayout runs 318 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 218 over it, 3.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HTMLAttributedStringBuilder.apply Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1761— MethodTooLong — apply runs 299 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 199 over it, 2.99× 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: UserDetailView.body Modules/Features/Settings/UserDetailView.swift:40— MethodTooLong — body runs 260 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 160 over it, 2.60× 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: ICloudSyncManager.performSyncPass Modules/Services/iCloud/ICloudSyncManager.swift:414— MethodTooLong — performSyncPass runs 234 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CoreTextPaginator.extractFrameBlockRenderables Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2879— MethodTooLong — extractFrameBlockRenderables runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× 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: ChapterFetchManager.fetchChapter Modules/Services/Online/OnlineReadingPipeline.swift:319— MethodTooLong — fetchChapter runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BookSourceListView.body Modules/Features/BookSource/BookSourceListView.swift:133— MethodTooLong — body runs 209 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× 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: ReaderCardTransitionAnimator.runDeclarativeAnimation Modules/Features/Reader/ReaderCardTransitionAnimator.swift:971— MethodTooLong — runDeclarativeAnimation runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.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.
MethodTooLong: AIAgenticAssistant.answerQuestion Modules/Core/AI/AIAgenticAssistant+Question.swift:30— MethodTooLong — answerQuestion runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× 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: CoreTextPaginator.extractImages Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2554— MethodTooLong — extractImages 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: SettingsView.body Modules/Features/Settings/ProfileView.swift:65— MethodTooLong — body 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: ChapterFetcher.buildRenderableNormalizedHTML Modules/Services/Online/ChapterFetcher.swift:67— MethodTooLong — buildRenderableNormalizedHTML runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× 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: ReaderViewportFragmentHost.update Modules/Features/Reader/ReaderViewportFragmentHost.swift:160— MethodTooLong — update 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: CoreTextScrollEngine.loadChapter Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:551— MethodTooLong — loadChapter runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: BookSourceFetcher.fetchChapterPackageInner Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:52— MethodTooLong — fetchChapterPackageInner runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: RSSListView.body Modules/Features/RSS/RSSListView.swift:80— MethodTooLong — body runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: ChapterLayout.appearanceUpdated Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:374— MethodTooLong — appearanceUpdated runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: NodeAttributedStringRenderer.render Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:417— MethodTooLong — render runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CoreTextChunkSlicer.slice Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:54— MethodTooLong — slice runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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: ReaderDialogueBubbleSettingsView.sideSection Modules/Features/Reader/ReaderDialogueBubbleSettingsView.swift:141— MethodTooLong — sideSection runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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: OnlineBookView.body Modules/Features/BookDetail/OnlineBookView.swift:261— MethodTooLong — body runs 162 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 62 over it, 1.62× 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.
ClassTooLong: CoreTextPaginator Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:7— ClassTooLong — 2757 significant lines (blank, comment-only and punctuation-only lines excluded), 59 methods. The bar is 400 significant lines; this is 2357 over it, 6.89× 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: NodeAttributedStringRenderer Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:18— ClassTooLong — 2356 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 1956 over it, 5.89× 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: BookStore Modules/Services/LibraryStore/BookStore.swift:58— ClassTooLong — 2354 significant lines (blank, comment-only and punctuation-only lines excluded), 153 methods. The bar is 400 significant lines; this is 1954 over it, 5.89× 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: ReaderView Modules/Features/Reader/ReaderView.swift:16— ClassTooLong — 2232 significant lines (blank, comment-only and punctuation-only lines excluded), 257 methods. The bar is 400 significant lines; this is 1832 over it, 5.58× 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: GlobalSettings Targets/Yuedu/SharedApp/GlobalSettings.swift:533— ClassTooLong — 2170 significant lines (blank, comment-only and punctuation-only lines excluded), 237 methods. The bar is 400 significant lines; this is 1770 over it, 5.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.
ClassTooLong: CoreTextPageEngineView Modules/Features/Reader/CoreTextPagedView.swift:4— ClassTooLong — 1949 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 1549 over it, 4.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.
ClassTooLong: HTMLAttributedStringBuilder Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:10— ClassTooLong — 1928 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 400 significant lines; this is 1528 over it, 4.82× 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: CoreTextPageView Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:18— ClassTooLong — 1710 significant lines (blank, comment-only and punctuation-only lines excluded), 95 methods. The bar is 400 significant lines; this is 1310 over it, 4.28× 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: ReaderHTMLUtilities Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:4— ClassTooLong — 1600 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 400 significant lines; this is 1200 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.
ClassTooLong: CoreTextCollectionScrollViewController Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:10— ClassTooLong — 1377 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 977 over it, 3.44× 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: JSCoreEngine Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:16— ClassTooLong — 1345 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 945 over it, 3.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: ICloudSyncManager Modules/Services/iCloud/ICloudSyncManager.swift:117— ClassTooLong — 1116 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 716 over it, 2.79× 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: CoreTextPageEngine Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:262— ClassTooLong — 1072 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods. The bar is 400 significant lines; this is 672 over it, 2.68× 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: AudiobookPlayer Modules/Core/TTS/AudiobookPlayer.swift:121— ClassTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 653 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RuleEngine Modules/Core/RuleEngine/RuleEngine.swift:19— ClassTooLong — 1053 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 653 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BrowserLayoutPageEngine Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:349— ClassTooLong — 1041 significant lines (blank, comment-only and punctuation-only lines excluded), 82 methods. The bar is 400 significant lines; this is 641 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ReaderCardTransitionAnimator Modules/Features/Reader/ReaderCardTransitionAnimator.swift:11— ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 468 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HomeView Modules/Features/Bookshelf/HomeView.swift:232— ClassTooLong — 757 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 357 over it, 1.89× 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: WorkDetailView Modules/Features/BookDetail/WorkDetailView.swift:84— ClassTooLong — 741 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 341 over it, 1.85× 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: TXTChapterParser Modules/Core/TXT/TXTChapterParser.swift:20— ClassTooLong — 740 significant lines (blank, comment-only and punctuation-only lines excluded), 36 methods. The bar is 400 significant lines; this is 340 over it, 1.85× 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: OnlineBookView Modules/Features/BookDetail/OnlineBookView.swift:25— ClassTooLong — 739 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 339 over it, 1.85× 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: CommentBubbleSVGRecognizer Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:95— ClassTooLong — 731 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 331 over it, 1.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: EPUBPageRenderer Modules/Core/ReaderCore/EPUBPageRenderer.swift:8— ClassTooLong — 724 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 324 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: ModernRuleEngine Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:26— ClassTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded), 53 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: QiThemeImporter Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:141— ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 300 over it, 1.75× 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: ReaderView Modules/Features/Reader/ReaderView.swift:16— TooManyMethods — 257 methods, declared across 16 files: Reader/ReaderView.swift (70), Reader/ReaderView+SourceChange.swift (61), Reader/ReaderView+Logic.swift (31), Reader/ReaderView+OnlineChapterLoading.swift (17), +12 more file(s). The bar is 30 methods; this is 227 over it, 8.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GlobalSettings Targets/Yuedu/SharedApp/GlobalSettings.swift:533— TooManyMethods — 237 methods, declared across 12 files: SharedApp/GlobalSettings.swift (128), SharedApp/ReaderCustomBackgroundStore.swift (23), Reader/ReaderChromeCustomization.swift (22), SharedApp/RootTabCustomization.swift (20), +8 more file(s). The bar is 30 methods; this is 207 over it, 7.90× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LegadoJSBridge Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:639— TooManyMethods — 170 methods. The bar is 30 methods; this is 140 over it, 5.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BookStore Modules/Services/LibraryStore/BookStore.swift:58— TooManyMethods — 153 methods, declared across 7 files: LibraryStore/BookStore.swift (142), Works/CopyMetadata.swift (3), Works/FilledMetadata.swift (3), LibraryStore/BookReaderSettingsStore.swift (2), +3 more file(s). The bar is 30 methods; this is 123 over it, 5.10× 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: View Modules/Features/AI/AIAssistantPanelView.swift:382— TooManyMethods — 151 methods, declared across 53 files: LNPopupUI/LNPopupUI.swift (41), LNPopupUI/PopupItem.swift (16), Home/HomeEditor.swift (6), DesignSystem/InterfaceEffects.swift (6), +49 more file(s). The bar is 30 methods; this is 121 over it, 5.03× 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: Coordinator Modules/Features/Reader/CoreTextPagedView.swift:463— TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CoreTextCollectionScrollViewController Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:10— TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CoreTextPageView Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:18— TooManyMethods — 95 methods. The bar is 30 methods; this is 65 over it, 3.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ModernParserBridge Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:32— TooManyMethods — 88 methods. The bar is 30 methods; this is 58 over it, 2.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.
TooManyMethods: AudiobookPlayer Modules/Core/TTS/AudiobookPlayer.swift:121— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 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.
TooManyMethods: BrowserLayoutPageEngine Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:349— TooManyMethods — 82 methods. The bar is 30 methods; this is 52 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CoreTextPageEngine Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:262— TooManyMethods — 77 methods. The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ICloudSyncManager Modules/Services/iCloud/ICloudSyncManager.swift:117— TooManyMethods — 76 methods. The bar is 30 methods; this is 46 over it, 2.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: HTMLAttributedStringBuilder Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:10— TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NodeAttributedStringRenderer Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:18— TooManyMethods — 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BookSourceStore Modules/Core/BookSource/BookSourceStore.swift:44— TooManyMethods — 69 methods, declared across 2 files: BookSource/BookSourceStore.swift (64), BookDetail/AudiobookDetailView.swift (5). The bar is 30 methods; this is 39 over it, 2.30× 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: BookSourceFetcher Modules/Core/BookSource/BookSourceFetcher.swift:108— TooManyMethods — 68 methods, declared across 9 files: BookSource/BookSourceFetcher+Cache.swift (20), BookSource/BookSourceFetcher+TOC.swift (11), BookSource/BookSourceFetcher+ChapterCache.swift (9), BookSource/BookSourceFetcher+Chapter.swift (7), +5 more file(s). The bar is 30 methods; this is 38 over it, 2.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: PublicationSession Modules/Core/EPUB/PublicationSession.swift:439— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RSSStore Modules/Services/RSS/RSSStore.swift:5— TooManyMethods — 62 methods, declared across 2 files: RSS/RSSStore.swift (60), RSS/RSSStore+TestSeed.swift (2). The bar is 30 methods; this is 32 over it, 2.07× 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: DiscoverViewModel Modules/Services/Online/DiscoverViewModel.swift:129— 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: CoreTextPaginator Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:7— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× 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: JSCoreEngine Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:16— 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: ModernRuleEngine Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:26— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.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: TTSCoordinator Modules/Core/TTS/TTSCoordinator.swift:541— 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: CoreTextScrollEngine Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:18— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Repeated repair: Modules/Features/RSS/RSSListView.swift Modules/Features/RSS/RSSListView.swift:1592— Modules/Features/RSS/RSSListView.swift changed 21 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is AddRSSSourceSheet.addSource at line 1592), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(rss): VoiceOver names the sheets' toolbar buttons”; “fix(rss): RSS 訂閱 stays responsive on iOS 17 once a feed has been opened”; “fix(rss): RSS home rows' swipe actions open, and VoiceOver reaches them on every iOS”; “fix(theme): swipe actions fill with the system blue, not the accent”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/RSS/RSSListView.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.
Repeated repair: Modules/Features/Reader/ReaderTOCViews.swift Modules/Features/Reader/ReaderTOCViews.swift:476— Modules/Features/Reader/ReaderTOCViews.swift changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is ReaderTOCView.chapterRow at line 476), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): filter the 目錄 once per body, not once per row”; “revert(reader): remove the 目錄 section index (FB-160)”; “fix(reader): 目錄 scrolls to the current chapter as it appears, without a 0.1 s wait”; “fix(reader): the table of contents keeps its search field on screen (FB-46)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderTOCViews.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.
Repeated repair: Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.swift Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.swift:555— Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.swift changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is FixedPageWebtoonViewController.scrollViewDidScroll at line 555), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): a status bar tap no longer scrolls a webtoon or a scrolling book back to its start (FB-178)”; “fix(comic): a strip closed mid-fling stops its frame-gap probe (FB-133)”; “fix(reader): put webtoon page edges on the pixel grid (FB-127)”; “fix(comic): webtoon pages keep their images across chapter loads (FB-114)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.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.
Repeated repair: Modules/Core/BookSource/BookSourceFetcher+TOC.swift Modules/Core/BookSource/BookSourceFetcher+TOC.swift:113— Modules/Core/BookSource/BookSourceFetcher+TOC.swift changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is BookSourceFetcher.fetchTOCPackage at line 113), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(source-check): audio sources read their chapter URL, and ~ selectors stop being cubic”; “fix(sources): a book's requests are built with its own variables”; “fix(toc): a following page's HTTP error adds no chapters, as in Legado”; “fix(toc): read nextTocUrl as a URL list, as Legado does”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/BookSource/BookSourceFetcher+TOC.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.
Repeated repair: Modules/Features/Reader/ReaderBatterySVGImportView.swift Modules/Features/Reader/ReaderBatterySVGImportView.swift:554— Modules/Features/Reader/ReaderBatterySVGImportView.swift changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ReaderBatterySVGStatePreviewStrip.loadPreviews at line 554), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(theme): swipe actions fill with the system blue, not the accent”; “fix(theme): UIKit draws DSColor's dark colours on iOS 17”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderBatterySVGImportView.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.
Repeated repair: Modules/Features/Settings/DownloadManagementView.swift Modules/Features/Settings/DownloadManagementView.swift:121— Modules/Features/Settings/DownloadManagementView.swift changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is DownloadManagementView.activeDownloadsSection at line 121), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(source): the charset URL option decodes every response, as in Legado”; “fix(l10n): format counts as whole sentences, not fragments”; “fix(library): keep each book's table of contents in its own file, as legado does”; “fix(reader): fetch online chapter illustrations with the book source's headers”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Settings/DownloadManagementView.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.
Repeated repair: Modules/Features/RSS/RSSArticleReaderView.swift Modules/Features/RSS/RSSArticleReaderView.swift:220— Modules/Features/RSS/RSSArticleReaderView.swift changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is RSSArticleReaderView.loadFullTextIfNeeded at line 220), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(rss): VoiceOver names the feeds' filter menu and the article's ⋯”; “fix(rss): route every RSS link before it can reach SFSafariViewController”; “revert(navigation): each tab owns its stack again; pages hide the tab bar themselves”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/RSS/RSSArticleReaderView.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.
Repeated repair: Modules/SharedUI/Adaptive/RootTabBarVisibility.swift Modules/SharedUI/Adaptive/RootTabBarVisibility.swift:21— Modules/SharedUI/Adaptive/RootTabBarVisibility.swift changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is RootTabBarVisibility.setRequest at line 21), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(explore): 探索's readers are immersive on iOS 17, as 書架's are (FB-100)”; “fix(tabbar): keep the tab bar on pushed pages and sheets; stop minimizing it”; “fix(tabs): leave the bottom tab bar up under a sheet floating clear of it”; “revert(tabs): hide the bottom tab bar under a popover again”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/SharedUI/Adaptive/RootTabBarVisibility.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.
Repeated repair: Modules/Core/ReaderCore/CoreText/PageRenderingProvider.swift Modules/Core/ReaderCore/CoreText/PageRenderingProvider.swift:182— Modules/Core/ReaderCore/CoreText/PageRenderingProvider.swift changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is StablePositionResolving.chapterPagination at line 182), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): closing a reader stops laying out its chapters”; “fix(reader): turn pages without dropping frames when tapping or swiping”; “fix(reader): optimize chapter rendering and restore legacy EPUB routing”; “fix(reader): make a chapter that never arrives say why”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Core/ReaderCore/CoreText/PageRenderingProvider.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.
Repeated repair: Modules/Features/Reader/ReaderBookmarkListView.swift Modules/Features/Reader/ReaderBookmarkListView.swift:179— Modules/Features/Reader/ReaderBookmarkListView.swift changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is BookmarkListSection.body at line 179), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): YueduCoreText 0.11, an illustration page has a place of its own”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(l10n): format counts as whole sentences, not fragments”; “fix(motion): pace tapped page turns, settle drags, honour Reduce Motion”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderBookmarkListView.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.
Repeated repair: Modules/Features/Feedback/FeedbackListView.swift Modules/Features/Feedback/FeedbackListView.swift:142— Modules/Features/Feedback/FeedbackListView.swift changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is FeedbackListView.observe at line 142), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): confirmation dialogs hang off the control that opens them (FB-19)”; “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(feedback): 我的回饋's groups are a bottom tab bar with icons on iPad too”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Feedback/FeedbackListView.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.
Repeated repair: Modules/Features/BookSource/SourceBrowserPresenter.swift Modules/Features/BookSource/SourceBrowserPresenter.swift:128— Modules/Features/BookSource/SourceBrowserPresenter.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is SourceBrowserPresenter.presentNextIfIdle at line 128), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): cover full screen without taking the content out of the window”; “fix(reader): keep the reader hearing its scene under an image preview”; “fix(video): 大灰狼, 七猫-OE and 书山 短剧 open as videos”; “fix(video): aggregate-source videos play in the app's player, never a page”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/BookSource/SourceBrowserPresenter.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.
Repeated repair: Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift:150— Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is FixedPageWebtoonCell.analyzeLiveText at line 150), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(comic): webtoon pages keep their images across chapter loads (FB-114)”; “fix(comic): decode source images and keep webtoon panels in place”; “fix: improve reader controls, TXT decoding and page rendering”; “fix(manga): pinch zoom in paged and webtoon modes; fit whole pages; no repeated webtoon chapters”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.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.
Repeated repair: Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonLayout.swift Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonLayout.swift:100— Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonLayout.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is FixedPageWebtoonLayout.scrollAnchor at line 100), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): put webtoon page edges on the pixel grid (FB-127)”; “fix(comic): webtoon pages keep their images across chapter loads (FB-114)”; “fix(comic): decode source images and keep webtoon panels in place”; “fix(manga): pinch zoom in paged and webtoon modes; fit whole pages; no repeated webtoon chapters”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonLayout.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.
Repeated repair: Modules/Features/AI/AIBookshelfOrganizerView.swift Modules/Features/AI/AIBookshelfOrganizerView.swift:23— Modules/Features/AI/AIBookshelfOrganizerView.swift changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AIBookshelfOrganizerView.body at line 23), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(theme): prominent buttons stay legible on a near-white accent”; “fix: stabilize reader navigation, parsing, and background refresh”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/AI/AIBookshelfOrganizerView.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.
Repeated repair: Modules/Services/Diagnostics/DiagnosticReportBundle.swift Modules/Services/Diagnostics/DiagnosticReportBundle.swift:136— Modules/Services/Diagnostics/DiagnosticReportBundle.swift changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is DiagnosticReportBundle.render at line 136), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): optimize chapter rendering and restore legacy EPUB routing”; “fix(reader): make source review cards a full-width banner at reading size”; “fix(reader): lock the stylesheet cache, and stop exports arriving as pasted text”; “fix(diagnostics): catch the no-op page turn, stop the false positives, quiet the log”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/Diagnostics/DiagnosticReportBundle.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.
Repeated repair: Modules/Services/LibraryStore/BookChapterStore.swift Modules/Services/LibraryStore/BookChapterStore.swift:136— Modules/Services/LibraryStore/BookChapterStore.swift changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is BookChapterStore.flush at line 136), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(library): tally every refresh-path disk writer and check for new chapters every 30 min”; “fix(library): an unchanged table of contents is not written again”; “fix: clear the Swift 6 concurrency warnings”; “fix(library): never wait for the shelf write queue on the main thread”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Services/LibraryStore/BookChapterStore.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.
Repeated repair: Modules/Features/Library/Modules/AIRecommendationModuleView.swift Modules/Features/Library/Modules/AIRecommendationModuleView.swift:76— Modules/Features/Library/Modules/AIRecommendationModuleView.swift changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is AIRecommendationModuleView.lastRunSection at line 76), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(library): let AI 推薦, Gutenberg and 青空文庫 leave 資源庫's 模組”; “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(theme): prominent buttons stay legible on a near-white accent”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Library/Modules/AIRecommendationModuleView.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.
Repeated repair: Modules/SharedUI/Navigation/NavigationBackSwipeReservation.swift Modules/SharedUI/Navigation/NavigationBackSwipeReservation.swift:131— Modules/SharedUI/Navigation/NavigationBackSwipeReservation.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is NavigationBackSwipeReservationController.attach at line 131), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(nav): only iOS 17.0 pops a reader's swipe without the interactive transition (FB-204)”; “fix(nav): a swipe out of a reader no longer freezes every later transition on iOS 17.0 (FB-204)”; “fix(a11y): VoiceOver reaches the bottom bar of a reader opened from a detail page”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/SharedUI/Navigation/NavigationBackSwipeReservation.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.
Repeated repair: Modules/Features/Library/Modules/RuleModuleRepositoryView.swift Modules/Features/Library/Modules/RuleModuleRepositoryView.swift:205— Modules/Features/Library/Modules/RuleModuleRepositoryView.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is RuleModuleRepositoryView.toolbar at line 205), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): confirmation dialogs hang off the control that opens them (FB-19)”; “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Library/Modules/RuleModuleRepositoryView.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.
Repeated repair: Modules/Features/Reader/ReaderViewportReporting.swift Modules/Features/Reader/ReaderViewportReporting.swift:172— Modules/Features/Reader/ReaderViewportReporting.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ReaderWindowObstructions.inset at line 172), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(reader): opening the menu on a folded iPhone Duo no longer relays out the book”; “fix(reader): read reserved regions over the whole window, not the safe-area rect”; “fix(reader): side margins follow the reader's window, not the tab that pushed it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderViewportReporting.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.
Repeated repair: Modules/Features/Explore/Home/HomeConfigurationPrompts.swift Modules/Features/Explore/Home/HomeConfigurationPrompts.swift:60— Modules/Features/Explore/Home/HomeConfigurationPrompts.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is HomeConfigurationPrompts.body at line 60), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ui): confirmation dialogs hang off the control that opens them (FB-19)”; “fix(explore): 預設配置 makes the app's defaults; 空白模板 is back”; “fix(explore): a 首頁配置 picked opens at the home's top; no built-in 空白”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Explore/Home/HomeConfigurationPrompts.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.
Repeated repair: Modules/Features/AI/AIRelationshipMapView.swift Modules/Features/AI/AIRelationshipMapView.swift:35— Modules/Features/AI/AIRelationshipMapView.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is AIRelationshipMapView.body at line 35), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(theme): text on the accent turns black where the accent is too light for white (feedback #77)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/AI/AIRelationshipMapView.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.
Repeated repair: Modules/SharedUI/Components/SettingsRows.swift Modules/SharedUI/Components/SettingsRows.swift:35— Modules/SharedUI/Components/SettingsRows.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is SettingsRowLabel.foreground at line 35), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(typography): empty-state actions and search results follow the global font (#41)”; “fix(typography): empty-state descriptions follow the global font; titles match per OS (#41)”; “fix(typography): TOC titles and empty-state titles follow the global font (#41)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/SharedUI/Components/SettingsRows.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.
Repeated repair: Modules/Features/Reader/ReaderHostingController.swift Modules/Features/Reader/ReaderHostingController.swift:75— Modules/Features/Reader/ReaderHostingController.swift changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ReaderHostingController.viewWillDisappear at line 75), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “revert(navigation): each tab owns its stack again; pages hide the tab bar themselves”; “fix(tabs): leave the bottom tab bar up under a sheet floating clear of it”; “fix: stabilize reader navigation, parsing, and background refresh”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 09:02:28 +08:00' --until='2026-11-16 09:02:28 +08:00' --full-history --no-merges -- Modules/Features/Reader/ReaderHostingController.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.
Duplicated block (7 lines × 2) Modules/Core/AI/AIBookSummary.swift:313— Modules/Core/AI/AIBookSummary.swift:313-319 | Modules/Core/AI/AIChapterTranslation.swift:81-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/EPUB/EPUBPackageArchive.swift:36— Modules/Core/EPUB/EPUBPackageArchive.swift:36-42 | Modules/Features/Reader/ReaderSettingsImportService.swift:321-327 — 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 `Modules/Core/EPUB/EPUBPackageArchive.swift:36` it does not close everything it opens, so those 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) Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20— Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20-26 | Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift:162-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:45— Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:45-51 | Modules/Core/ReaderCore/EPUBProgress.swift:239-245 — 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 `Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:45` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1795— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1795-1801 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:373-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. 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) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2772— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2772-2778 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1558-1564 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2772` 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 (7 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2604— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2604-2610 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3393-3399 — both copies are in the same file, so extract the 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, `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2603` calls `CTRunGetTypographicBounds`, `CFRangeMake` and `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3392` 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 (7 lines × 2) Modules/Core/ReaderCore/Customization/ReaderOverlayGeometry.swift:89— Modules/Core/ReaderCore/Customization/ReaderOverlayGeometry.swift:89-95 | Modules/Core/ReaderCore/Customization/ReaderOverlayGeometry.swift:101-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.
Duplicated block (7 lines × 2) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1961— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1961-1967 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1982-1988 — both copies are in the same file, so extract the 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) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:131— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:131-138 | Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:121-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/TTS/TTSAudioProvider.swift:357— Modules/Core/TTS/TTSAudioProvider.swift:357-363 | Modules/Core/TTS/TTSAudioProvider.swift:370-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/TTS/TTSAudioProvider.swift:357` 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 (7 lines × 2) Modules/Features/AI/AIBookshelfOrganizerView.swift:144— Modules/Features/AI/AIBookshelfOrganizerView.swift:144-150 | Modules/Features/Reader/ReaderTranslationSheet.swift:82-88 — 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) Modules/Features/AI/AICharacterMemoryView.swift:269— Modules/Features/AI/AICharacterMemoryView.swift:269-275 | Modules/Features/AI/AIStatusView.swift:94-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (7 lines × 2) Modules/Features/Bookshelf/HomeView.swift:713— Modules/Features/Bookshelf/HomeView.swift:713-719 | Modules/Features/Bookshelf/HomeView.swift:723-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Bookshelf/HomeView.swift:713` 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 (7 lines × 2) Modules/Features/Bookshelf/HomeView.swift:2064— Modules/Features/Bookshelf/HomeView.swift:2064-2070 | Modules/Features/Bookshelf/HomeView.swift:2196-2202 — both copies are in the same file, so extract the 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, `Modules/Features/Bookshelf/HomeView.swift:2203` calls `padding` and `Modules/Features/Bookshelf/HomeView.swift:2071` 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 (7 lines × 2) Modules/Features/Bookshelf/HomeView.swift:2225— Modules/Features/Bookshelf/HomeView.swift:2225-2231 | Modules/Features/Bookshelf/HomeView.swift:2476-2482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Bookshelf/HomeView.swift:2225` 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) Modules/Features/Explore/Home/HomeCollectionCards.swift:495— Modules/Features/Explore/Home/HomeCollectionCards.swift:495-501 | Modules/Features/Explore/Home/HomeCollectionCards.swift:524-530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Explore/Home/HomeCollectionCards.swift:495` 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) Modules/Features/RSS/RSSListView.swift:683— Modules/Features/RSS/RSSListView.swift:683-689 | Modules/Features/RSS/RSSListView.swift:1637-1643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSListView.swift:683` 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) Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:25— Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:25-31 | Modules/Features/Reader/ReaderBookmarkToast.swift:55-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:25` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) Modules/Features/Reader/ReaderBookmarkToast.swift:37— Modules/Features/Reader/ReaderBookmarkToast.swift:37-44 | Modules/Features/Reader/ReaderBookmarkToast.swift:60-66 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderBookmarkToast.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.
Duplicated block (7 lines × 2) Modules/Services/Offline/DownloadActivityIntent.swift:71— Modules/Services/Offline/DownloadActivityIntent.swift:71-77 | Widget/DownloadActivityIntent.swift:71-77 — before extracting anything, compare `Modules/Services/Offline/DownloadActivityIntent.swift` and `Widget/DownloadActivityIntent.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
Duplicated block (7 lines × 2) Targets/Yuedu/SharedApp/GlobalSettings.swift:4146— Targets/Yuedu/SharedApp/GlobalSettings.swift:4146-4152 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4275-4281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Targets/Yuedu/SharedApp/GlobalSettings.swift:4146` 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) Modules/Core/BookSource/SharedImportQueueDrainer.swift:671— Modules/Core/BookSource/SharedImportQueueDrainer.swift:671-677 | Modules/Core/BookSource/SharedImportQueueDrainer.swift:716-722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/BookSource/SharedImportQueueDrainer.swift:671` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Modules/Core/BookSource/SharedImportQueueDrainer.swift:679` calls `contains`, `localBook` and `Modules/Core/BookSource/SharedImportQueueDrainer.swift:724` 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 (7 lines × 2) Modules/Core/TTS/TTSAudioProvider.swift:764— Modules/Core/TTS/TTSAudioProvider.swift:764-770 | Modules/Core/TTS/TTSLoginScript.swift:92-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/TTS/TTSAudioProvider.swift:764` it does not close everything it opens, so those 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, `Modules/Core/TTS/TTSLoginScript.swift:99` calls `onLoginInfo` and `Modules/Core/TTS/TTSAudioProvider.swift:771` 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 (7 lines × 2) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:877— Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:877-883 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:1040-1046 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Modules/Core/BookSource/ReviewSummaryResponseCache.swift:62— Modules/Core/BookSource/ReviewSummaryResponseCache.swift:62-70 | Modules/Core/BookSource/ReviewSummaryResponseCache.swift:126-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/BookSource/ReviewSummaryResponseCache.swift:62` 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) Modules/Core/EPUB/EPUBMediaOverlay.swift:129— Modules/Core/EPUB/EPUBMediaOverlay.swift:129-137 | Modules/Core/EPUB/PublicationSession.swift:1710-1718 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/EPUB/EPUBMediaOverlay.swift:129` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:300— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:300-308 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:256-264 — 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 `Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:300` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:684— Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:684-692 | Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:600-608 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:684` 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 × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:591— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:591-599 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:572-580 — 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) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2568— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2568-2576 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2811-2819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2568` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/CoreTextReadingPosition.swift:65— Modules/Core/ReaderCore/CoreText/CoreTextReadingPosition.swift:65-73 | Modules/Core/ReaderCore/CoreText/CoreTextReadingPosition.swift:115-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. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextReadingPosition.swift:65` 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) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1961— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1961-1969 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2017-2025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1961` 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 (9 lines × 2) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:457— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:457-465 | Targets/Yuedu/SharedApp/AppearanceCustomizationBundle.swift:218-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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) Modules/Core/ReaderCore/Customization/ReaderOverlayGeometry.swift:182— Modules/Core/ReaderCore/Customization/ReaderOverlayGeometry.swift:182-190 | Modules/Core/ReaderCore/Customization/ReaderOverlaySnapEngine.swift:198-206 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Modules/Core/ReaderCore/OnlineImageRequestOptions.swift:91— Modules/Core/ReaderCore/OnlineImageRequestOptions.swift:91-99 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2296-2304 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:938— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:938-946 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1177-1185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:938` 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) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:519— Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:519-527 | Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:597-605 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:519` it does not close everything it opens, so those 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) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2009— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2009-2017 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2038-2046 — both copies are in the same file, so extract the 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) Modules/Core/RuleEngine/WebNovelParser.swift:463— Modules/Core/RuleEngine/WebNovelParser.swift:463-471 | Modules/Core/RuleEngine/WebNovelParser.swift:473-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:652— Modules/Features/BookDetail/AudiobookDetailView.swift:652-660 | Modules/Features/BookDetail/OnlineBookView.swift:716-724 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:652` it does not close everything it opens, so those exact lines 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) Modules/Features/BookSource/BookSourceExportFile.swift:44— Modules/Features/BookSource/BookSourceExportFile.swift:44-52 | Modules/Features/Settings/AppearanceCustomizationExportPayload.swift:39-47 — 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) Modules/Features/Bookshelf/OPDSImportView.swift:294— Modules/Features/Bookshelf/OPDSImportView.swift:294-302 | Modules/Features/Bookshelf/RemoteImportViews.swift:79-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Bookshelf/OPDSImportView.swift:294` 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) Modules/Features/Explore/Home/HomeChartCards.swift:73— Modules/Features/Explore/Home/HomeChartCards.swift:73-81 | Modules/Features/Explore/Home/HomeGroupedShelves.swift:83-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 `Modules/Features/Explore/Home/HomeChartCards.swift:73` 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, `Modules/Features/Explore/Home/HomeGroupedShelves.swift:81` calls `padding` and `Modules/Features/Explore/Home/HomeChartCards.swift:71` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) Modules/Features/Explore/Home/HomeCollectionCards.swift:383— Modules/Features/Explore/Home/HomeCollectionCards.swift:383-391 | Modules/Features/Explore/Home/HomeSectionCards.swift:160-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. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Explore/Home/HomeCollectionCards.swift:383` 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) Modules/Features/RSS/RSSListView.swift:628— Modules/Features/RSS/RSSListView.swift:628-636 | Modules/Features/RSS/RSSListView.swift:665-673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSListView.swift:628` 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) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:81— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:81-89 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:85-93 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Reader/ReaderCommentCardSettingsView.swift:81` 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) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:449— Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:449-457 | Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:468-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:449` 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) Modules/Features/Reader/ReaderTranslationSheet.swift:67— Modules/Features/Reader/ReaderTranslationSheet.swift:67-75 | Modules/Features/Subscription/PaywallView.swift:149-161 — 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 `Modules/Features/Reader/ReaderTranslationSheet.swift:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Modules/Features/WebBrowser/BrowserBookmarkViews.swift:101— Modules/Features/WebBrowser/BrowserBookmarkViews.swift:101-109 | Modules/Features/WebBrowser/BrowserBookmarkViews.swift:418-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/WebBrowser/BrowserBookmarkViews.swift:101` 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.
+ 9 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×33
Edited copy of a member (7 corresponding lines) Targets/Yuedu/SharedApp/GlobalSettings.swift:200— Targets/Yuedu/SharedApp/GlobalSettings.swift:200-207 | Targets/Yuedu/SharedApp/GlobalSettings.swift:217-223 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/RuleModules/ModuleAuthorWorks.swift:51— Modules/Services/RuleModules/ModuleAuthorWorks.swift:51-57 | Modules/Services/Works/WorkReviews.swift:110-117 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:125— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:125-131 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:133-141 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/ModernParser/Cache/RegexCache.swift:19— Modules/Core/RuleEngine/ModernParser/Cache/RegexCache.swift:19-30 | Modules/Core/RuleEngine/RuleEngine.swift:31-37 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:380— Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:380-387 | Modules/Core/ReaderCore/CoreText/ReviewCardTemplate.swift:329-335 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:367— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:367-373 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:375-385 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:41— Modules/Core/EPUB/PublicationSession.swift:41-49 | Modules/Core/EPUB/PublicationSession.swift:57-63 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/ModernParser/BookSourceRuntimeStateStore.swift:99— Modules/Core/RuleEngine/ModernParser/BookSourceRuntimeStateStore.swift:99-105 | Modules/Services/Online/DiscoverViewModel.swift:1079-1085 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/Online/DiscoverViewModel.swift:383— Modules/Services/Online/DiscoverViewModel.swift:383-392 | Modules/Services/Online/DiscoverViewModel.swift:395-401 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/RSS/RSSFetcher.swift:244— Modules/Services/RSS/RSSFetcher.swift:244-250 | Modules/Services/RSS/RSSFetcher.swift:502-508 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:172— Modules/Core/EPUB/PublicationSession.swift:172-179 | Modules/Core/EPUB/PublicationSession.swift:181-187 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/ReaderCore/EPUBProgress.swift:181— Modules/Core/ReaderCore/EPUBProgress.swift:181-187 | Modules/Core/ReaderCore/EPUBProgress.swift:189-195 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/Online/SearchAggregator.swift:1143— Modules/Services/Online/SearchAggregator.swift:1143-1151 | Modules/Services/Works/SearchWorkResolver.swift:190-196 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/AI/ReaderTranslationSettingsStore.swift:23— Modules/Services/AI/ReaderTranslationSettingsStore.swift:23-29 | Targets/Yuedu/SharedApp/ReaderBackgroundMigration.swift:294-300 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/Account/GatewayAccountBackend.swift:191— Modules/Services/Account/GatewayAccountBackend.swift:191-198 | Modules/Services/Works/ImportedMetadataCapture.swift:309-315 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/BookSource/LegadoImageSourceResolver.swift:210— Modules/Core/BookSource/LegadoImageSourceResolver.swift:210-216 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1625-1631 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/Online/DiscoverViewModel.swift:1206— Modules/Services/Online/DiscoverViewModel.swift:1206-1212 | Modules/Services/Online/DiscoverViewModel.swift:1220-1226 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:168— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:168-174 | Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:290-296 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:787— Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:787-793 | Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1253-1260 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2827— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2827-2835 | Modules/Features/Settings/SharedCustomizationImportFlow.swift:91-97 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Services/RSS/LegadoRSSScraper.swift:332— Modules/Services/RSS/LegadoRSSScraper.swift:332-338 | Modules/Core/RuleEngine/ModernParser/Variables/RuleData.swift:35-42 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:184— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:184-190 | Modules/Services/Network/LegadoOutgoingHeaders.swift:53-59 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Features/BookSource/BookSourceRowViews.swift:395— Modules/Features/BookSource/BookSourceRowViews.swift:395-401 | Modules/Features/BookSource/SourceValidationListHeader.swift:34-40 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Targets/Yuedu/SharedApp/AppearanceThemeExtrasApplier.swift:36— Targets/Yuedu/SharedApp/AppearanceThemeExtrasApplier.swift:36-42 | Targets/Yuedu/SharedApp/GlobalSettings.swift:1350-1358 — These two members are one piece of code written twice and then edited apart: 7 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.
Edited copy of a member (7 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:527— Modules/Features/BookDetail/AudiobookDetailView.swift:527-533 | Modules/Features/BookDetail/OnlineBookView.swift:598-604 — These two members are one piece of code written twice and then edited apart: 7 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.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×32
Edited copy of a member (9 corresponding lines) Modules/Services/Calibre/CalibreWirelessProtocol.swift:9— Modules/Services/Calibre/CalibreWirelessProtocol.swift:9-17 | Modules/Services/Works/HomeSection.swift:554-571 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:264— Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:264-272 | Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:155-167 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1964— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1964-1973 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:383-391 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Services/Feedback/FeedbackService.swift:230— Modules/Services/Feedback/FeedbackService.swift:230-240 | Modules/Services/Feedback/FeedbackService.swift:260-268 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Services/Works/Providers/BookSourceProvider.swift:178— Modules/Core/Aozora/AozoraTables.swift:42-53 | Modules/Services/Works/Providers/BookSourceProvider.swift:178-186 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:63— Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:63-73 | Modules/Features/BookDetail/OnlineBookView.swift:181-189 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2768— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2768-2778 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1556-1564 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:370— Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:370-384 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:649-657 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Services/RSS/RSSStore.swift:534— Modules/Services/RSS/RSSStore.swift:534-544 | Modules/Services/RSS/RSSUtilities.swift:277-285 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Reader/RegexHighlightSettingsModel.swift:36— Modules/Features/Reader/RegexHighlightSettingsModel.swift:36-44 | Modules/Features/Reader/RegexHighlightSettingsModel.swift:69-79 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Services/Online/ChangeSourceCache.swift:126— Modules/Services/Online/ChangeSourceCache.swift:126-134 | Modules/Services/Works/SourceRecordDerivation.swift:7-15 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/BookSource/BookSourceSession.swift:119— Modules/Core/BookSource/BookSourceSession.swift:119-127 | Modules/Core/BookSource/SourceScriptHost.swift:48-56 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Reader/ReaderPageTouchProbe.swift:129— Modules/Features/Reader/ReaderPageTouchProbe.swift:129-137 | Modules/Features/Reader/ReaderPageTouchProbe.swift:140-150 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Library/Modules/RuleModuleImportSheet.swift:252— Modules/Features/Library/Modules/RuleModuleImportSheet.swift:252-260 | Modules/Features/Library/Modules/RuleModuleRepositoryView.swift:190-198 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:235— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:235-245 | Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:327-335 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/ChangeSource/ChangeSourceSearch.swift:572— Modules/Features/ChangeSource/ChangeSourceSearch.swift:572-580 | Modules/Features/ChangeSource/ChangeSourceSearch.swift:588-598 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Services/RSS/RSSStore.swift:127— Modules/Services/RSS/RSSStore.swift:127-136 | Modules/Services/RSS/RSSStore.swift:582-590 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPagePrerenderer.swift:53— Modules/Core/ReaderCore/CoreText/CoreTextPagePrerenderer.swift:53-63 | Modules/Features/Reader/ReaderFragmentRasterizer.swift:97-105 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/TTS/ChapterAudioProvider.swift:104— Modules/Core/TTS/ChapterAudioProvider.swift:104-112 | Modules/Services/Offline/OfflineDownloadManager.swift:809-817 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Reader/ChapterTitleInspectorView.swift:575— Modules/Features/Reader/ChapterTitleInspectorView.swift:575-591 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:645-653 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:2105— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:2105-2113 | Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:2116-2124 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Reader/ChapterTitleInspectorView.swift:60— Modules/Features/Reader/ChapterTitleInspectorView.swift:60-68 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:430-439 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Features/Search/SearchRecents.swift:37— Modules/Features/Search/SearchRecents.swift:37-45 | Modules/Services/LibraryStore/OffShelfReadRecords.swift:63-71 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Targets/Yuedu/SharedApp/GlobalSettings+CommentCards.swift:93— Targets/Yuedu/SharedApp/GlobalSettings+CommentCards.swift:93-101 | Targets/Yuedu/SharedApp/ReaderCustomBackgroundStore.swift:19-29 — These two members are one piece of code written twice and then edited apart: 9 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.
Edited copy of a member (9 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:293— Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:293-301 | Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:305-313 — These two members are one piece of code written twice and then edited apart: 9 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.
Duplicated block (5 lines × 2) Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:87— Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:87-91 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3598-3602 — 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 `Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:87` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Modules/Features/Reader/CoreTextPagedView.swift:1506— Modules/Features/Reader/CoreTextPagedView.swift:1506-1510 | Modules/Features/Reader/CoreTextPagedView.swift:1533-1537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/CoreTextPagedView.swift:1506` it does not close everything it opens, so those 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) Modules/Services/LibraryStore/AozoraBookImporter.swift:55— Modules/Services/LibraryStore/AozoraBookImporter.swift:55-59 | Modules/Services/LibraryStore/MOBIBookImporter.swift:23-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (5 lines × 2) Modules/Services/RSS/RSSStore.swift:128— Modules/Services/RSS/RSSStore.swift:128-133 | Modules/Services/RSS/RSSStore.swift:584-588 — both copies are in the same file, so extract the 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, `Modules/Services/RSS/RSSStore.swift:134` calls `save` and `Modules/Services/RSS/RSSStore.swift:589` 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 (5 lines × 2) Modules/Services/RuleModules/ModuleSearch.swift:62— Modules/Services/RuleModules/ModuleSearch.swift:62-66 | Modules/Services/Works/LibrarySearch.swift:115-119 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/RuleModules/ModuleSearch.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) Modules/Services/RuleModules/RuleModuleClient+Comments.swift:269— Modules/Services/RuleModules/RuleModuleClient+Comments.swift:269-273 | Modules/Services/RuleModules/RuleModuleClient+Reviews.swift:98-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Services/Works/ImportedMetadataStore.swift:63— Modules/Services/Works/ImportedMetadataStore.swift:63-67 | Modules/Services/Works/ImportedMetadataStore.swift:180-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 `Modules/Services/Works/ImportedMetadataStore.swift:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:414— Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:414-418 | Modules/Core/ReaderCore/Customization/LottieTitleTemplateImporter.swift:601-605 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:804— Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:804-808 | Modules/Core/ReaderCore/Customization/ReaderStylePackage.swift:415-419 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/TTS/HTTPTTSEngine.swift:314— Modules/Core/TTS/HTTPTTSEngine.swift:314-318 | Modules/Core/TTS/SystemTTSEngine.swift:239-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 both call sites, so a change lands once.
Duplicated block (5 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:162— Modules/Features/BookDetail/AudiobookDetailView.swift:162-166 | Modules/Features/BookDetail/VideoDetailView.swift:128-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (5 lines × 2) Modules/Features/Reader/ChapterTitleInspectorView.swift:698— Modules/Features/Reader/ChapterTitleInspectorView.swift:698-702 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:831-835 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Features/Reader/ReaderViewModel.swift:664— Modules/Features/Reader/ReaderViewModel.swift:664-668 | Modules/Services/Online/OnlineReadingPipeline.swift:311-315 — 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) Modules/Services/Works/ImportedMetadataStore.swift:21— Modules/Services/Works/ImportedMetadataStore.swift:21-25 | Modules/Services/Works/RemoteRecordStore.swift:108-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/BookSource/SharedImportQueueDrainer.swift:904— Modules/Core/BookSource/SharedImportQueueDrainer.swift:904-908 | Modules/Core/Replace/ReplaceRuleStore.swift:320-324 — 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) Modules/Features/Reader/ReaderChromeCustomization.swift:412— Modules/Features/Reader/ReaderChromeCustomization.swift:412-416 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:348-352 — 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) Modules/Services/AI/AIBookSummaryService.swift:43— Modules/Services/AI/AIBookSummaryService.swift:43-47 | Modules/Services/AI/AIChapterTranslationService.swift:53-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `store` to `AIBookSummaryStore = .shared` in one and `AIChapterTranslationStore = .shared` 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) Modules/Services/AI/AIChapterTranslationStore.swift:45— Modules/Services/AI/AIChapterTranslationStore.swift:45-49 | Modules/Services/AI/AIDialogueCastStore.swift:59-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Modules/Core/EPUB/BookParsing.swift:279— Modules/Core/EPUB/BookParsing.swift:279-283 | Modules/Core/TTS/TTSAudioProvider.swift:208-212 — 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) Modules/Core/MOBI/KF8Converter.swift:420— Modules/Core/MOBI/KF8Converter.swift:420-424 | Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:405-409 — 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 `Modules/Core/MOBI/KF8Converter.swift:420` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2164— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2164-2168 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2234-2238 — both copies are in the same file, so extract the 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 (5 lines × 2) Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:735— Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:735-739 | Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:769-773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:735` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:101— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:101-105 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:118-122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:527— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:527-531 | Modules/Features/BookSource/BookSourceFormLoginView.swift:851-855 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:426— Modules/Core/RuleEngine/RuleEngine.swift:426-430 | Modules/Core/RuleEngine/RuleEngine.swift:451-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/RuleEngine.swift:426` 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.
Swallowed exception (empty catch) Resources/Assets/Readability.js:449— 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) Resources/Assets/Readability.js:567— 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) REDACTED:83— 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) REDACTED:101— 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) REDACTED:369— 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) REDACTED:672— 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) Packages/SwiftSoup/Sources/Attribute.swift:415— 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) Packages/SwiftSoup/Sources/Collector.swift:276— 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) Packages/SwiftSoup/Sources/CombiningEvaluator.swift:47— 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) Packages/SwiftSoup/Sources/CombiningEvaluator.swift:71— 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) Packages/SwiftSoup/Sources/Comment.swift:27— 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) Packages/SwiftSoup/Sources/Comment.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.
Swallowed exception (empty catch) Packages/SwiftSoup/Sources/DataNode.swift:28— 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) Packages/SwiftSoup/Sources/DataNode.swift:89— 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) Packages/SwiftSoup/Sources/DataNode.swift:190— 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) Packages/SwiftSoup/Sources/DocumentType.swift:47— 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) Packages/SwiftSoup/Sources/DocumentType.swift:68— 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) Packages/SwiftSoup/Sources/DocumentType.swift:82— 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) Packages/SwiftSoup/Sources/Element.swift:505— 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) Packages/SwiftSoup/Sources/Element.swift:514— 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) Packages/SwiftSoup/Sources/Node.swift:1332— 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) Packages/SwiftSoup/Sources/Node.swift:1344— 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) Packages/SwiftSoup/Sources/StructuralEvaluator.swift:46— 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) Packages/SwiftSoup/Sources/StructuralEvaluator.swift:72— 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) Packages/SwiftSoup/Sources/StructuralEvaluator.swift:97— 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.
Duplicated block (6 lines × 2) Modules/Core/EPUB/EPUBMediaOverlay.swift:102— Modules/Core/EPUB/EPUBMediaOverlay.swift:102-107 | Modules/Core/EPUB/PublicationSession.swift:1684-1689 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/EPUB/EPUBMediaOverlay.swift:102` it does not close everything it opens, so those 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) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:368— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:368-373 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:378-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 `Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:378` 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) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1668— Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1668-1673 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1685-1690 — both copies are in the same file, so extract the 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 (6 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:293— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:293-298 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:328-333 — both copies are in the same file, so extract the 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 (6 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:26— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:26-31 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2572-2577 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.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. 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) Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:335— Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:335-340 | Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:357-362 — both copies are in the same file, so extract the 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) Modules/Core/ReaderCore/CoreText/ReaderTextDecorationRenderer.swift:97— Modules/Core/ReaderCore/CoreText/ReaderTextDecorationRenderer.swift:97-102 | Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:272-277 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:270` calls `CTFrameGetLineOrigins`, `CFRangeMake` and `Modules/Core/ReaderCore/CoreText/ReaderTextDecorationRenderer.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) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:290— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:290-295 | Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:320-325 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:290` 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) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:159— Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:159-164 | Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:72-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:159` 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 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 (6 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:552— Modules/Core/RuleEngine/RuleEngine.swift:552-557 | Modules/Core/RuleEngine/RuleEngine.swift:1355-1360 — both copies are in the same file, so extract the 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 (6 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:1032— Modules/Core/RuleEngine/RuleEngine.swift:1032-1037 | Modules/Core/RuleEngine/RuleEngine.swift:1388-1393 — both copies are in the same file, so extract the 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) Modules/Features/BookDetail/AudiobookDetailView.swift:703— Modules/Features/BookDetail/AudiobookDetailView.swift:703-708 | Modules/Features/BookDetail/VideoDetailView.swift:765-770 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:703` 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) Modules/Features/BookDetail/SourcePickerSheet.swift:167— Modules/Features/BookDetail/SourcePickerSheet.swift:167-172 | Modules/Features/BookDetail/SourcePickerSheet.swift:180-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookDetail/SourcePickerSheet.swift:167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) Modules/Features/Explore/Home/HomeSectionCards.swift:291— Modules/Features/Explore/Home/HomeSectionCards.swift:291-296 | Modules/Features/Explore/Home/HomeSectionCards.swift:439-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Explore/Home/HomeSectionCards.swift:291` it does not close everything it opens, so those 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) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:203— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:203-208 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:305-310 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Reader/ReaderCommentCardSettingsView.swift:203` it does not close everything it opens, so those exact lines 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) Modules/Services/Online/OnlineReadingPipeline.swift:458— Modules/Services/Online/OnlineReadingPipeline.swift:458-463 | Modules/Services/Online/OnlineReadingPipeline.swift:620-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Online/OnlineReadingPipeline.swift:458` it does not close everything it opens, so those exact lines 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) Modules/Services/RSS/RSSFetcher.swift:11— Modules/Services/RSS/RSSFetcher.swift:11-16 | Modules/Services/RSS/RSSFetcher.swift:37-42 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/RSS/RSSFetcher.swift:11` it does not close everything it opens, so those exact lines 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) Modules/Services/RSS/RSSUtilities.swift:55— Modules/Services/RSS/RSSUtilities.swift:55-60 | Modules/Services/RSS/RSSUtilities.swift:70-75 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/RSS/RSSUtilities.swift:55` 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) Modules/Services/Works/AuthorWorks.swift:124— Modules/Services/Works/AuthorWorks.swift:124-129 | Modules/Services/Works/ShelfGenres.swift:9-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. 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) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1216— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1216-1221 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1226-1231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1216` 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) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3174— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3174-3179 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3219-3224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3174` 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) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3192— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3192-3197 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3237-3242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3192` it does not close everything it opens, so those exact lines 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) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1262— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1262-1267 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1590-1595 — both copies are in the same file, so extract the 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 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 (6 lines × 2) Modules/Core/BookSource/SharedImportQueueDrainer.swift:814— Modules/Core/BookSource/SharedImportQueueDrainer.swift:814-819 | Modules/Core/EPUB/BookParsing.swift:130-135 — 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) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:584— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:584-589 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:565-570 — 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.
+ 5 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×29
Edited copy of a member (8 corresponding lines) Modules/Services/RSS/RSSFetcher.swift:854— Modules/Services/RSS/RSSFetcher.swift:854-861 | Modules/Services/RSS/RSSFetcher.swift:917-928 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/EPUB/EPUBCFIResolver.swift:136— Modules/Core/EPUB/EPUBCFIResolver.swift:136-143 | Modules/Core/EPUB/PublicationSession.swift:1942-1949 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:326— Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:326-333 | Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:335-343 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/BookSource/SourceAPIErrorLog.swift:286— Modules/Core/BookSource/SourceAPIErrorLog.swift:286-293 | Modules/Core/BookSource/SourceAPIErrorLog.swift:295-304 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/EPUB/PackageResourcesBookResourceProvider.swift:27— Modules/Core/EPUB/PackageResourcesBookResourceProvider.swift:27-34 | Modules/Core/EPUB/PublicationSession.swift:939-946 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:876— Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:876-883 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:1039-1046 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1615— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1615-1622 | Modules/Services/RSS/RSSUtilities.swift:799-806 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Services/ForYou/ReadingGenreProfile.swift:157— Modules/Services/ForYou/ReadingGenreProfile.swift:157-164 | Modules/Services/RuleModules/RuleModuleClient.swift:458-465 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/Bookshelf/HomeView.swift:2883— Modules/Features/Bookshelf/HomeView.swift:2883-2894 | Modules/Features/Bookshelf/HomeView.swift:2898-2905 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/Explore/PublicLibrary/PublicLibraryBookSheet.swift:733— Modules/Features/Explore/PublicLibrary/PublicLibraryBookSheet.swift:733-740 | Modules/SharedUI/Components/ScrollOffsetReader.swift:294-305 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:149— Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:149-156 | Modules/Core/ReaderCore/Customization/ChapterTitleDesign.swift:239-251 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/RuleEngine/WebNovelParser.swift:106— Modules/Core/RuleEngine/WebNovelParser.swift:106-115 | Modules/Services/Online/ChapterFetcher.swift:1002-1009 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Services/PublicLibrary/PublicLibrary.swift:76— Modules/Services/PublicLibrary/PublicLibrary.swift:76-83 | Modules/Services/PublicLibrary/PublicLibrary.swift:87-95 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:918— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:918-925 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:222-232 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Services/Account/FirebaseAccountBackend.swift:73— Modules/Services/Account/FirebaseAccountBackend.swift:73-83 | Modules/Services/Account/FirebaseAccountBackend.swift:98-105 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/AI/AICharacterMemoryView.swift:268— Modules/Features/AI/AICharacterMemoryView.swift:268-275 | Modules/Features/AI/AIStatusView.swift:93-100 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Services/Feedback/FeedbackModels.swift:195— Modules/Services/Feedback/FeedbackModels.swift:195-202 | Modules/Services/Feedback/FeedbackModels.swift:205-212 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/Subscription/PaywallShowcase.swift:63— Modules/Features/Subscription/PaywallShowcase.swift:63-70 | Modules/Features/Subscription/PaywallShowcase.swift:109-116 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:764— Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:764-772 | Modules/Core/ReaderCore/Customization/QiThemeManifest.swift:332-339 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Services/Diagnostics/DiagnosticLog.swift:524— Modules/Services/Diagnostics/DiagnosticLog.swift:524-531 | Modules/Services/Diagnostics/MainThreadMonitor.swift:232-239 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/FixedPageReader/FixedPageFrameGapProbe.swift:47— Modules/Features/FixedPageReader/FixedPageFrameGapProbe.swift:47-54 | Modules/Features/Reader/ReaderTurnFrameRateRequest.swift:25-37 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/ReaderCore/CoreText/ReaderDocumentTrace.swift:34— Modules/Core/ReaderCore/CoreText/ReaderDocumentTrace.swift:34-41 | Modules/Core/ReaderCore/CoreText/ReaderDocumentTrace.swift:91-99 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/BookDetail/SourcePickerSheet.swift:137— Modules/Features/BookDetail/SourcePickerSheet.swift:137-147 | Modules/Features/BookDetail/WorkDetailView.swift:1305-1312 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Features/Explore/Home/AIRecommendationRow.swift:263— Modules/Features/Explore/Home/AIRecommendationRow.swift:263-272 | Modules/Features/Library/Modules/AIRecommendationModuleView.swift:129-136 — These two members are one piece of code written twice and then edited apart: 8 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.
Edited copy of a member (8 corresponding lines) Modules/Core/AI/AIBM25Index.swift:124— Modules/Core/AI/AIBM25Index.swift:124-131 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:155-163 — These two members are one piece of code written twice and then edited apart: 8 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.
Duplicated block (8 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2667— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2667-2674 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3409-3416 — both copies are in the same file, so extract the 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 (8 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2708— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2708-2715 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3418-3425 — both copies are in the same file, so extract the 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 (8 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3067— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3067-3074 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3501-3508 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3067` 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) Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:327— Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:327-334 | Modules/Services/LibraryStore/BookCoverLoader.swift:157-164 — 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 `Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:327` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:730— Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:730-737 | Modules/Core/ReaderCore/CoreText/RegexHighlightEngine.swift:536-543 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:258— Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:258-265 | Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:279-289 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:258` 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) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:537— Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:537-544 | Modules/Services/RuleModules/RuleModuleClient.swift:419-426 — 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 `Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:537` it does not close everything it opens, so those exact lines 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) Modules/Features/Library/Modules/RuleModuleGroupView.swift:96— Modules/Features/Library/Modules/RuleModuleGroupView.swift:96-103 | Modules/Features/Library/Modules/RuleModuleSection.swift:95-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Features/Reader/ReaderView.swift:1365— Modules/Features/Reader/ReaderView.swift:1365-1372 | Modules/Features/Reader/ReaderView.swift:1387-1395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) Modules/Features/Settings/ReaderChromeIconSettingsView.swift:95— Modules/Features/Settings/ReaderChromeIconSettingsView.swift:95-102 | Modules/Features/Settings/RootTabCustomizationView.swift:189-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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, `Modules/Features/Settings/ReaderChromeIconSettingsView.swift:105` calls `accessibilityElement`, `modifier`, `ToolReorderActions` and `Modules/Features/Settings/RootTabCustomizationView.swift:198` 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) Modules/Services/LibraryStore/ShelfWorkService.swift:209— Modules/Services/LibraryStore/ShelfWorkService.swift:209-216 | Modules/Services/LibraryStore/ShelfWorkService.swift:252-259 — both copies are in the same file, so extract the 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 (8 lines × 2) Modules/Services/Online/ChangeSourceCache.swift:127— Modules/Services/Online/ChangeSourceCache.swift:127-134 | Modules/Services/Works/SourceRecordDerivation.swift:8-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. 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) Modules/Services/RuleModules/ModuleSearch.swift:46— Modules/Services/RuleModules/ModuleSearch.swift:46-53 | Modules/Services/Works/LibrarySearch.swift:99-106 — 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 `Modules/Services/RuleModules/ModuleSearch.swift:46` it does not close everything it opens, so those exact lines 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) Modules/Services/Works/HomePageStore.swift:218— Modules/Services/Works/HomePageStore.swift:218-225 | Modules/Services/Works/WorkDecisionsStore.swift:190-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Services/Works/HomePageStore.swift:218` it does not close everything it opens, so those 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, `Modules/Services/Works/WorkDecisionsStore.swift:189` calls `File` and `Modules/Services/Works/HomePageStore.swift:217` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) Modules/Core/BookSource/SharedImportQueueDrainer.swift:837— Modules/Core/BookSource/SharedImportQueueDrainer.swift:837-844 | Modules/Core/EPUB/BookParsing.swift:121-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/BookSource/SharedImportQueueDrainer.swift:837` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:861— Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:861-868 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:898-905 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:861` 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) Modules/Features/BookDetail/BookDetailComponents.swift:781— Modules/Features/BookDetail/BookDetailComponents.swift:781-788 | Modules/Features/Explore/Home/HomeSectionCards.swift:234-241 — 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) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:204— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:204-211 | Modules/Core/PDF/PDFPageRasterizer.swift:122-129 — 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 `Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:204` 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 (8 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:161— Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:161-168 | Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:186-193 — both copies are in the same file, so extract the 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, `Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:194` calls `RenderColor` and `Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:169` 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) Modules/Features/BookDetail/AudiobookDetailView.swift:189— Modules/Features/BookDetail/AudiobookDetailView.swift:189-196 | Modules/Features/BookDetail/OnlineBookView.swift:208-215 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Modules/Features/Reader/ChapterTitleInspectorView.swift:706— Modules/Features/Reader/ChapterTitleInspectorView.swift:706-713 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:938-945 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Features/Reader/ChapterTitleInspectorView.swift:717— Modules/Features/Reader/ChapterTitleInspectorView.swift:717-724 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:907-914 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Services/RSS/LegadoRSSScraper.swift:366— Modules/Services/RSS/LegadoRSSScraper.swift:366-373 | Modules/Services/RSS/RSSUtilities.swift:1239-1247 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:643— Modules/Features/BookDetail/AudiobookDetailView.swift:643-650 | Modules/Features/BookDetail/OnlineBookView.swift:706-713 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) Modules/Features/Reader/ChapterTitleInspectorView.swift:728— Modules/Features/Reader/ChapterTitleInspectorView.swift:728-735 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:918-925 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×26
Edited copy of a member (11 corresponding lines) Modules/Services/OPDS/OPDSClient.swift:236— Modules/Services/OPDS/OPDSClient.swift:236-246 | Modules/Services/WebDAV/WebDAVBrowseClient.swift:63-73 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/ReaderCore/CoreText/DialogueHighlighter.swift:155— Modules/Core/ReaderCore/CoreText/DialogueHighlighter.swift:155-167 | Modules/Core/ReaderCore/Customization/AppearanceThemePreset.swift:769-779 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:834— Modules/Core/BookSource/SharedImportQueueDrainer.swift:834-844 | Modules/Core/EPUB/BookParsing.swift:117-128 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2332— Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2332-2342 | Modules/Services/RSS/RSSModels.swift:261-273 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Services/Calibre/CalibreWirelessProtocol.swift:19— Modules/Services/Calibre/CalibreWirelessProtocol.swift:19-29 | Modules/Services/Works/HomeSection.swift:573-584 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/TXT/TXTTocRule.swift:53— Modules/Core/TXT/TXTTocRule.swift:53-64 | Modules/Services/Works/HomeSection.swift:317-327 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:139— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:139-150 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:177-187 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:136— Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:136-146 | Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:285-297 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/RuleEngine/ModernParser/CookieStore.swift:131— Modules/Core/RuleEngine/ModernParser/CookieStore.swift:131-141 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1686-1699 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Services/ForYou/ForYouCandidateStore.swift:44— Modules/Services/ForYou/ForYouCandidateStore.swift:44-54 | Modules/Services/Works/HomeFeedPageStore.swift:64-74 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/BookDetail/WorkDetailView.swift:1135— Modules/Features/BookDetail/WorkDetailView.swift:1135-1145 | Modules/Services/Works/VersionReadingCopy.swift:53-64 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:228— Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:228-243 | Modules/Core/ReaderCore/Customization/ReaderStyleAssetReferences.swift:11-21 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:606— Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:606-616 | Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:752-763 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/BookSource/BookSourceFetcher.swift:189— Modules/Core/BookSource/BookSourceFetcher.swift:189-199 | Modules/Services/Network/WebFetcher.swift:100-114 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/BookDetail/BookDetailGenreViews.swift:67— Modules/Features/BookDetail/BookDetailGenreViews.swift:67-77 | Modules/Features/BookDetail/BookDetailShelfGenreViews.swift:39-51 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:839— Modules/Core/BookSource/BookSourceStore.swift:839-851 | Modules/Core/TTS/TTSSourceImport.swift:62-72 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Services/AI/AIRecommendationStore.swift:74— Modules/Services/AI/AIRecommendationStore.swift:74-85 | Modules/Services/Works/MetadataFill.swift:348-358 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/RSS/RSSListView.swift:431— Modules/Features/RSS/RSSListView.swift:431-441 | Modules/Features/RSS/RSSListView.swift:527-537 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/RuleEngine/ModernParser/Cache/RegexCache.swift:35— Modules/Core/RuleEngine/ModernParser/Cache/RegexCache.swift:35-46 | Modules/Core/RuleEngine/ModernParser/Cache/RegexCache.swift:51-61 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/RuleEngine/ModernParser/Login/LoginFieldStyle.swift:72— Modules/Core/RuleEngine/ModernParser/Login/LoginFieldStyle.swift:72-82 | Modules/Core/RuleEngine/ModernParser/Login/LoginFieldStyle.swift:84-94 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/Reader/ReaderView+TXTVerticalScroll.swift:186— Modules/Features/Reader/ReaderView+TXTVerticalScroll.swift:186-202 | Modules/Features/Reader/ReaderView+TXTVerticalScroll.swift:204-214 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:543— Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:543-555 | Modules/Core/RuleEngine/ModernParser/Cache/RegexSanitizer.swift:66-76 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Core/TTS/TTSRoleVoiceCast.swift:235— Modules/Core/TTS/TTSRoleVoiceCast.swift:235-245 | Modules/Core/TTS/TTSRoleVoiceCast.swift:249-260 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/SharedUI/Components/SourceWebUIDelegate.swift:39— Modules/SharedUI/Components/SourceWebUIDelegate.swift:39-50 | Modules/Features/Reader/ReaderWebEmbedManager.swift:143-153 — These two members are one piece of code written twice and then edited apart: 11 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.
Edited copy of a member (11 corresponding lines) Modules/Features/BookSource/SourceValidationListHeader.swift:190— Modules/Features/BookSource/SourceValidationListHeader.swift:190-202 | Modules/Features/Reader/ReaderModernBottomControlBar.swift:427-437 — These two members are one piece of code written twice and then edited apart: 11 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.
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×26
Edited copy of a member (4 corresponding lines) Modules/Services/Works/HomeDefaultsGenresMigration.swift:25— Modules/Services/Works/HomeDefaultsGenresMigration.swift:25-28 | Modules/Services/Works/HomeDefaultsStoreMigration.swift:32-35 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/WorkDetailView.swift:1171— Modules/Features/BookDetail/WorkDetailView.swift:1171-1174 | Modules/Features/Bookshelf/RemoteLibraryBookDetailView.swift:173-176 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1787— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1787-1792 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:367-370 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:451— Modules/Features/BookDetail/AudiobookDetailView.swift:451-454 | Modules/Features/BookDetail/OnlineBookView.swift:514-517 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/AI/AIDialogueCastStore.swift:32— Modules/Services/AI/AIDialogueCastStore.swift:32-35 | Modules/Services/Calibre/CalibreWirelessService.swift:52-55 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleRenderer.swift:396— Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleRenderer.swift:396-399 | Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:659-666 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:281— Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:281-284 | Modules/Services/RSS/RSSModels.swift:212-215 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/RSS/RSSFetcher.swift:1527— Modules/Services/RSS/RSSFetcher.swift:1527-1530 | Modules/Services/RSS/RSSUtilities.swift:488-491 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/RSS/RSSFaviconView.swift:194— Modules/Features/RSS/RSSFaviconView.swift:194-197 | Modules/Services/RSS/RSSFetcher.swift:1073-1076 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/AI/LLMStreamDecoding.swift:32— Modules/Core/AI/LLMStreamDecoding.swift:32-35 | Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:348-351 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/Subscription/SubscriptionICloudMirror.swift:223— Modules/Services/Subscription/SubscriptionICloudMirror.swift:223-226 | Modules/Services/iCloud/ICloudSyncManager.swift:1966-1969 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/Reader/Video/VideoPlaybackController.swift:100— Modules/Features/Reader/Video/VideoPlaybackController.swift:100-103 | Modules/Services/Online/OnlineChapterContentService.swift:21-24 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/RSS/RSSStore.swift:563— Modules/Services/RSS/RSSStore.swift:563-569 | Modules/Services/RuleModules/RuleModuleRepository.swift:74-77 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/EPUBBrowserLayoutResourceAdapter.swift:42— Modules/Core/ReaderCore/BrowserLayout/EPUBBrowserLayoutResourceAdapter.swift:42-45 | Modules/Core/ReaderCore/CoreText/EPUBAttributedStringBuilder.swift:78-81 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:429— Modules/Features/BookDetail/AudiobookDetailView.swift:429-432 | Modules/Features/BookDetail/OnlineBookView.swift:477-481 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/Customization/ChapterTitleDesign.swift:286— Modules/Core/ReaderCore/Customization/ChapterTitleDesign.swift:286-292 | Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:304-307 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:138— Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:138-145 | Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:40-43 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Core/AI/AIBookshelfOrganizer.swift:131— Modules/Core/AI/AIBookshelfOrganizer.swift:131-134 | Modules/Core/AI/AIRecommendation.swift:113-116 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:568— Modules/Features/BookDetail/AudiobookDetailView.swift:568-571 | Modules/Features/BookDetail/OnlineBookView.swift:639-642 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/VideoDetailView.swift:297— Modules/Features/BookDetail/VideoDetailView.swift:297-300 | Modules/Features/Explore/Home/HomeSectionCards.swift:654-657 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/Reader/ReaderChromeCustomization.swift:253— Modules/Features/Reader/ReaderChromeCustomization.swift:253-256 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:182-185 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/LibraryStore/StorageLocations.swift:44— Modules/Services/LibraryStore/StorageLocations.swift:44-47 | Modules/Services/Works/WebDAVIndexCoordinator.swift:124-127 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:174— Modules/Features/BookDetail/AudiobookDetailView.swift:174-177 | Modules/Features/BookDetail/VideoDetailView.swift:139-142 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Services/ForYou/ReadingGenreProfile.swift:96— Modules/Services/ForYou/ReadingGenreProfile.swift:96-99 | Modules/Services/Works/HomeFeedPageStore.swift:41-45 — These two members are one piece of code written twice and then edited apart: 4 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.
Edited copy of a member (4 corresponding lines) Modules/Features/Reader/ReaderPullDownBookmarkMotion.swift:78— Modules/Features/Reader/ReaderPullDownBookmarkMotion.swift:78-81 | Modules/Features/Reader/ReaderSwipeUpExitMotion.swift:58-61 — These two members are one piece of code written twice and then edited apart: 4 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.
+ 1 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×25
Edited copy of a member (10 corresponding lines) Modules/Features/WebBrowser/BrowserView.swift:483— Modules/Features/WebBrowser/BrowserView.swift:483-515 | Modules/Features/WebBrowser/BrowserView.swift:517-537 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/TTS/AzureTTS.swift:253— Modules/Core/TTS/AzureTTS.swift:253-262 | Modules/Core/TTS/OpenAICompatibleTTS.swift:152-162 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/EPUB/EPUBMediaOverlay.swift:116— Modules/Core/EPUB/EPUBMediaOverlay.swift:116-127 | Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:364-373 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:291— Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:291-300 | Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:305-317 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1344— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1344-1360 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:372-381 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:460— Modules/Features/BookDetail/AudiobookDetailView.swift:460-469 | Modules/Features/BookDetail/OnlineBookView.swift:523-532 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1761— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1761-1782 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:425-434 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:2330— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:2330-2345 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:2536-2545 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:190— Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:190-199 | Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:202-213 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:420— Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:420-431 | Modules/Core/ReaderCore/Customization/QiThemeManifest.swift:319-328 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1392— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1392-1401 | Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1412-1421 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Services/RSS/RSSStore.swift:178— Modules/Services/RSS/RSSStore.swift:178-187 | Modules/Services/RSS/RSSStore.swift:189-198 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1304— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1304-1313 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1317-1326 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Features/BookSource/BookSourceFormLoginView.swift:975— Modules/Features/BookSource/BookSourceFormLoginView.swift:975-984 | Modules/Features/BookSource/BookSourceFormLoginView.swift:1037-1051 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:685— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:685-695 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1058-1067 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Services/RuleModules/RuleModuleLibrary.swift:167— Modules/Services/RuleModules/RuleModuleLibrary.swift:167-176 | Modules/Services/RuleModules/RuleModuleLibrary.swift:178-187 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:846— Modules/Core/BookSource/SharedImportQueueDrainer.swift:846-855 | Modules/Core/ReaderCore/Customization/LottieTitleTemplateImporter.swift:586-597 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2497— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2497-2507 | Modules/Core/ReaderCore/CoreText/RegexHighlightEngine.swift:525-534 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:462— Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:462-471 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:401-413 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:718— Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:718-727 | Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:766-777 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:20— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:20-29 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:31-40 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:235— Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:235-244 | Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:246-255 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:98— Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:98-107 | Modules/Services/RSS/RSSStore.swift:571-580 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Features/AI/AIChatComponents.swift:99— Modules/Features/AI/AIChatComponents.swift:99-108 | Modules/Features/Feedback/FeedbackThreadView.swift:335-344 — These two members are one piece of code written twice and then edited apart: 10 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.
Edited copy of a member (10 corresponding lines) Modules/Features/Feedback/FeedbackComposeView.swift:283— Modules/Features/Feedback/FeedbackComposeView.swift:283-294 | Modules/Features/Settings/DiagnosticsView.swift:343-352 — These two members are one piece of code written twice and then edited apart: 10 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 (5 corresponding lines) · ×25
Edited copy of a member (5 corresponding lines) Modules/Features/BookDetail/VideoDetailView.swift:930— Modules/Features/BookDetail/VideoDetailView.swift:930-937 | Modules/Services/RuleModules/ModuleStore.swift:75-79 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/RuleEngine/ModernParser/RuleListMapping.swift:203— Modules/Core/RuleEngine/ModernParser/RuleListMapping.swift:203-207 | Modules/Features/BookDetail/OnlineBookDetailDestination.swift:244-260 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:927— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:927-934 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:178-182 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:726— Modules/Features/BookDetail/AudiobookDetailView.swift:726-735 | Modules/Features/BookDetail/VideoDetailView.swift:787-791 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:433— Modules/Core/EPUB/PublicationSession.swift:433-437 | Modules/Services/LibraryStore/ConvertedBookRegenerator.swift:187-191 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Services/RuleModules/ModuleProvider.swift:212— Modules/Services/RuleModules/ModuleProvider.swift:212-216 | Modules/Services/RuleModules/ModuleProvider.swift:222-227 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Widget/DownloadLiveActivityWidget.swift:52— Widget/DownloadLiveActivityWidget.swift:52-56 | Widget/DownloadLiveActivityWidget.swift:59-75 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:436— Modules/Features/BookDetail/AudiobookDetailView.swift:436-440 | Modules/Features/BookDetail/OnlineBookView.swift:494-498 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:476— Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:476-480 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:641-646 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:415— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:415-419 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:417-421 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Services/Works/HomeConfiguration.swift:187— Modules/Services/Works/HomeConfiguration.swift:187-191 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3347-3353 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/PublicationFontScalePolicy.swift:33— Modules/Core/ReaderCore/BrowserLayout/PublicationFontScalePolicy.swift:33-40 | Modules/Core/ReaderCore/BrowserLayout/PublicationPageAlignment.swift:17-21 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Services/Network/WebFetcher.swift:347— Modules/Services/Network/WebFetcher.swift:347-351 | Modules/Services/Network/WebViewFetcher.swift:765-769 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Services/ForYou/ForYouCandidateStore.swift:38— Modules/Services/ForYou/ForYouCandidateStore.swift:38-42 | Modules/Services/LibraryStore/CoverImagePipeline.swift:665-669 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:409— Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:409-413 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2274-2281 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:254— Modules/Core/BookSource/SharedImportQueueDrainer.swift:254-261 | Modules/Services/RuleModules/RuleModuleStore.swift:210-214 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/TTS/TTSCoordinator.swift:1467— Modules/Core/TTS/TTSCoordinator.swift:1467-1472 | Modules/Core/TTS/SystemTTSEngine.swift:668-672 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Services/Online/BookContentProviderAdapters.swift:152— Modules/Services/Online/BookContentProviderAdapters.swift:152-157 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:324-328 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/PDF/LocalPDFArchive.swift:146— Modules/Core/PDF/LocalPDFArchive.swift:146-153 | Modules/Core/Comic/LocalMangaArchive.swift:252-256 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:233— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:233-237 | Modules/Services/Online/DiscoverViewModel.swift:1214-1218 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/BookSource/BookSourceCheckMarks.swift:45— Modules/Core/BookSource/BookSourceCheckMarks.swift:45-49 | Modules/Services/RuleModules/ModuleFillProvider.swift:236-240 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Core/Replace/ReplaceRuleStore.swift:65— Modules/Core/Replace/ReplaceRuleStore.swift:65-69 | Modules/Core/TXT/TXTTocRuleStore.swift:44-49 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:205— Modules/Features/BookDetail/AudiobookDetailView.swift:205-210 | Modules/Features/BookDetail/OnlineBookView.swift:231-235 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Features/AI/AIBookSummaryView.swift:294— Modules/Features/AI/AIBookSummaryView.swift:294-298 | Modules/Features/AI/AICharacterListView.swift:239-247 — These two members are one piece of code written twice and then edited apart: 5 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.
Edited copy of a member (5 corresponding lines) Modules/Features/Explore/Home/HomeCollectionCards.swift:201— Modules/Features/Explore/Home/HomeCollectionCards.swift:201-205 | Modules/Features/Explore/Home/HomeGenreList.swift:46-50 — These two members are one piece of code written twice and then edited apart: 5 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 (14 corresponding lines) · ×22
Edited copy of a member (14 corresponding lines) Modules/Services/LibraryStore/BookStore.swift:3630— Modules/Services/LibraryStore/BookStore.swift:3630-3656 | Modules/Services/Works/ImportedMetadataStore.swift:201-214 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/BookDetail/OnlineBookView.swift:656— Modules/Features/BookDetail/OnlineBookView.swift:656-671 | Modules/Features/BookDetail/VideoDetailView.swift:720-733 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:627— Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:627-640 | Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:645-661 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/LibraryStore/UniversalBookInterfaces.swift:117— Modules/Services/LibraryStore/UniversalBookInterfaces.swift:117-131 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:133-146 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Account/FirebaseAuthManager.swift:172— Modules/Services/Account/FirebaseAuthManager.swift:172-185 | Modules/Services/Account/FirebaseAuthManager.swift:187-201 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Works/RemoteRecordStore.swift:156— Modules/Services/Works/RemoteRecordStore.swift:156-169 | Modules/Services/Works/RemoteRecordStore.swift:172-187 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Account/GatewayAPIClient.swift:77— Modules/Services/Account/GatewayAPIClient.swift:77-90 | Modules/Services/Account/GatewayAPIClient.swift:95-108 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Targets/Yuedu/SharedApp/GlobalSettings.swift:2758— Targets/Yuedu/SharedApp/GlobalSettings.swift:2758-2771 | Targets/Yuedu/SharedApp/GlobalSettings.swift:2777-2793 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1550— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1550-1563 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1818-1831 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/Bookshelf/HomeView.swift:1847— Modules/Features/Bookshelf/HomeView.swift:1847-1860 | Modules/Features/Settings/UserDetailView.swift:562-575 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Account/GatewayKeychain.swift:29— Modules/Services/Account/GatewayKeychain.swift:29-42 | Modules/Services/Subscription/SubscriptionEntitlementCache.swift:38-51 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Online/SearchResultPresentation.swift:56— Modules/Services/Online/SearchResultPresentation.swift:56-69 | Modules/Services/Online/SearchResultPresentation.swift:71-84 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Core/BookSource/BookSourceSession.swift:286— Modules/Core/BookSource/BookSourceSession.swift:286-299 | Modules/Core/BookSource/BookSourceSession.swift:302-315 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:90— Modules/Features/BookDetail/AudiobookDetailView.swift:90-103 | Modules/Features/BookDetail/OnlineBookView.swift:98-115 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/BookSource/BookSourceListView.swift:535— Modules/Features/BookSource/BookSourceListView.swift:535-548 | Modules/Features/BookSource/BookSourceListView.swift:623-637 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:483— Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:483-496 | Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:498-511 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:575— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:575-589 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:398-411 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/RSS/RSSListView.swift:644— Modules/Features/RSS/RSSListView.swift:644-660 | Modules/Features/Settings/GlobalFontSettingsView.swift:148-161 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Features/Reader/ReaderModernBookCard.swift:104— Modules/Features/Reader/ReaderModernBookCard.swift:104-119 | Modules/Features/Reader/TTS/TTSPanelView.swift:319-332 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Modules/Services/Network/WebViewFetcher.swift:16— Modules/Services/Network/WebViewFetcher.swift:16-33 | Modules/Services/Network/WebViewFetcher.swift:62-75 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Targets/Yuedu/SharedApp/GlobalSettings+CommentCards.swift:103— Targets/Yuedu/SharedApp/GlobalSettings+CommentCards.swift:103-116 | Targets/Yuedu/SharedApp/ReaderCustomBackgroundStore.swift:31-44 — These two members are one piece of code written twice and then edited apart: 14 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.
Edited copy of a member (14 corresponding lines) Targets/Yuedu/SharedApp/AppDependencies.swift:160— Targets/Yuedu/SharedApp/AppDependencies.swift:160-173 | Targets/Yuedu/SharedApp/AppDependencies.swift:286-300 — These two members are one piece of code written twice and then edited apart: 14 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 (13 corresponding lines) · ×20
Edited copy of a member (13 corresponding lines) Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:51— Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:51-63 | Modules/Services/RuleModules/ModuleBooks.swift:104-121 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Features/Explore/Home/HomeChartCards.swift:93— Modules/Features/Explore/Home/HomeChartCards.swift:93-105 | Modules/Features/Explore/Home/HomeChartCards.swift:107-119 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Services/Works/HomePageStore.swift:517— Modules/Services/Works/HomePageStore.swift:517-536 | Modules/Services/Works/WorkDecisionsStore.swift:168-180 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:605— Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:605-618 | Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:539-551 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/BookSource/ReviewSummaryResponseCache.swift:58— Modules/Core/BookSource/ReviewSummaryResponseCache.swift:58-70 | Modules/Core/BookSource/ReviewSummaryResponseCache.swift:117-137 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:42— Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:42-54 | Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:79-91 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Features/RSS/RSSListView.swift:675— Modules/Features/RSS/RSSListView.swift:675-691 | Modules/Features/RSS/RSSListView.swift:1631-1643 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/EPUB/BookParsing.swift:245— Modules/Core/EPUB/BookParsing.swift:245-263 | Modules/Core/RuleEngine/RuleEngine.swift:1551-1563 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/EPUB/BookParsing.swift:265— Modules/Core/EPUB/BookParsing.swift:265-277 | Modules/Core/TTS/TTSAudioProvider.swift:179-191 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Services/LibraryStore/BookChapterStore.swift:172— Modules/Services/LibraryStore/BookChapterStore.swift:172-189 | Modules/Services/Works/ImportedMetadataStore.swift:73-85 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:28— Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:28-40 | Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:64-76 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/BookSource/BookSourceFetcher+Search.swift:130— Modules/Core/BookSource/BookSourceFetcher+Search.swift:130-142 | Modules/Core/BookSource/BookSourceHealthChecker.swift:95-108 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Features/Reader/ChapterTitleInspectorView.swift:616— Modules/Features/Reader/ChapterTitleInspectorView.swift:616-629 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:729-741 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/ReaderCore/ReaderPositionSentry.swift:190— Modules/Core/ReaderCore/ReaderPositionSentry.swift:190-202 | Modules/Core/ReaderCore/ReaderPositionSentry.swift:209-222 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:221— Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:221-233 | Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:114-126 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Features/AI/AIChatComponents.swift:303— Modules/Features/AI/AIChatComponents.swift:303-316 | Modules/Features/WebBrowser/BrowserView.swift:1193-1205 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/AI/LLMProviding.swift:45— Modules/Core/AI/LLMProviding.swift:45-57 | Modules/Core/RuleEngine/ModernParser/Login/LoginFieldStyle.swift:36-50 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:21— Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:21-33 | Targets/Yuedu/SharedApp/AppDependencies.swift:341-353 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:7— Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:7-19 | Targets/Yuedu/SharedApp/AppDependencies.swift:393-405 — These two members are one piece of code written twice and then edited apart: 13 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.
Edited copy of a member (13 corresponding lines) Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:91— Modules/Core/BookSource/BookSourceFetcher+ChapterCache.swift:91-103 | Targets/Yuedu/SharedApp/AppDependencies.swift:379-391 — These two members are one piece of code written twice and then edited apart: 13 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 (6 corresponding lines) · ×20
Edited copy of a member (6 corresponding lines) Modules/Features/Reader/ChapterTitleDesignerCanvas.swift:372— Modules/Features/Reader/ChapterTitleDesignerCanvas.swift:372-377 | Modules/Features/Reader/ChapterTitleLayerListView.swift:101-109 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserTextInteractionController.swift:276— Modules/Core/ReaderCore/BrowserLayout/BrowserTextInteractionController.swift:276-281 | Modules/Core/ReaderCore/BrowserLayout/BrowserTextInteractionController.swift:283-289 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:622— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:622-628 | Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:1288-1293 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/Video/VideoEpisodeGuide.swift:59— Modules/Core/Video/VideoEpisodeGuide.swift:59-64 | Modules/Core/Video/VideoEpisodeGuide.swift:67-72 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Services/AI/AIDiagnostics.swift:105— Modules/Services/AI/AIDiagnostics.swift:105-111 | Modules/Services/AI/AIDiagnostics.swift:117-122 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/OnlineImageRequestOptions.swift:83— Modules/Core/ReaderCore/OnlineImageRequestOptions.swift:83-88 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2288-2293 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:62— Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:62-67 | Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:69-74 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1280— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1280-1286 | Modules/Core/RuleEngine/RuleEngine.swift:1252-1257 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Features/Bookshelf/RemoteLibraryBookDetailView.swift:110— Modules/Features/Bookshelf/RemoteLibraryBookDetailView.swift:110-115 | Modules/Features/Explore/PublicLibrary/AozoraCatalogViews.swift:121-128 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Features/Library/Modules/RuleModuleImportModel.swift:47— Modules/Features/Library/Modules/RuleModuleImportModel.swift:47-52 | Modules/Services/RuleModules/RuleModuleRepository.swift:220-225 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:10— Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:10-15 | Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:151-156 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Features/ChangeSource/ChangeSourceViews.swift:276— Modules/Features/ChangeSource/ChangeSourceViews.swift:276-282 | Modules/Features/Settings/TTSSettingsView.swift:331-336 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/Audio/LocalAudiobookArchive.swift:311— Modules/Core/Audio/LocalAudiobookArchive.swift:311-316 | Modules/Core/Audio/LocalAudiobookArchive.swift:318-323 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:62— Modules/Core/BookSource/BookSourceStore.swift:62-67 | Modules/Services/RuleModules/RuleModuleStore.swift:40-50 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2530— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2530-2535 | Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:40-49 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Features/BookSource/BookSourceEditView.swift:363— Modules/Features/BookSource/BookSourceEditView.swift:363-368 | Modules/Features/BookSource/BookSourceListView.swift:771-777 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2327— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2327-2335 | Modules/Core/ReaderCore/CoreText/TextSelectionInteractor.swift:78-83 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Services/Works/MetadataResolver.swift:101— Modules/Services/Works/MetadataResolver.swift:101-106 | Modules/Services/Works/WorkDecisionsStore.swift:53-58 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:31— Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:31-37 | Modules/Core/ReaderCore/EPUBProgress.swift:229-234 — These two members are one piece of code written twice and then edited apart: 6 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.
Edited copy of a member (6 corresponding lines) Modules/Features/Reader/TTS/AudiobookPlayerControls.swift:496— Modules/Features/Reader/TTS/AudiobookPlayerControls.swift:496-502 | Modules/Features/Reader/Video/VideoPlayerView.swift:587-592 — These two members are one piece of code written twice and then edited apart: 6 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.
Low cohesion: LegadoJSBridge (LCOM4 54) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:639— LegadoJSBridge's methods fall into 54 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 54 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: String (LCOM4 23) Modules/Core/AI/AICharacterProfile.swift:164— String's methods fall into 23 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 23 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: GlobalSettings (LCOM4 14) Targets/Yuedu/SharedApp/GlobalSettings.swift:533— GlobalSettings's methods fall into 14 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 14 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: BookSourceFetcher (LCOM4 11) Modules/Core/BookSource/BookSourceFetcher.swift:108— BookSourceFetcher'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: HTMLAttributedStringBuilder (LCOM4 9) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:10— HTMLAttributedStringBuilder'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: ReaderViewModel (LCOM4 7) Modules/Features/Reader/ReaderViewModel.swift:5— ReaderViewModel's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Coordinator (LCOM4 6) Modules/Features/BookSource/JsBridgeBrowserView.swift:620— Coordinator's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FixedPageZoomableScrollView (LCOM4 6) Modules/Features/FixedPageReader/FixedPageZoomableScrollView.swift:11— FixedPageZoomableScrollView's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ReaderWebEmbedManager (LCOM4 5) Modules/Features/Reader/ReaderWebEmbedManager.swift:16— ReaderWebEmbedManager's methods fall into 5 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 5 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: ReadingStatsStore (LCOM4 5) Modules/Services/Stats/ReadingStats.swift:164— ReadingStatsStore's methods fall into 5 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 5 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 5) Modules/SharedUI/Extensions/UIViewController+CoversFullScreen.swift:3— UIViewController's methods fall into 5 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 5 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: SourceTurnGate (LCOM4 4) Modules/Core/BookSource/BookSourceSession.swift:259— SourceTurnGate's methods fall into 4 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 4 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: BookSourceStore (LCOM4 4) Modules/Core/BookSource/BookSourceStore.swift:44— BookSourceStore's methods fall into 4 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 4 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: WebViewFetcher (LCOM4 4) Modules/Services/Network/WebViewFetcher.swift:96— WebViewFetcher's methods fall into 4 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 4 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: RSSNotificationManager (LCOM4 4) Modules/Services/RSS/RSSNotificationManager.swift:6— RSSNotificationManager's methods fall into 4 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 4 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: SubscriptionAccountService (LCOM4 4) Modules/Services/Subscription/SubscriptionAccountService.swift:15— SubscriptionAccountService's methods fall into 4 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 4 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: SourceWebUIDelegate (LCOM4 4) Modules/SharedUI/Components/SourceWebUIDelegate.swift:23— SourceWebUIDelegate's methods fall into 4 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 4 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: NavigationBackEdgePanGestureRecognizer (LCOM4 4) Modules/SharedUI/Navigation/NavigationBackEdgePanGestureRecognizer.swift:17— NavigationBackEdgePanGestureRecognizer's methods fall into 4 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 4 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: GutenbergProvider (LCOM4 4) Modules/Services/Works/Providers/OPDSProvider.swift:130— GutenbergProvider's methods fall into 4 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 4 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.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×17
Edited copy of a member (12 corresponding lines) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:856— Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:856-868 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:894-905 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/BookSource/RuleAutoComplete.swift:114— Modules/Core/BookSource/RuleAutoComplete.swift:114-127 | Modules/Core/BookSource/RuleAutoComplete.swift:134-145 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/TTS/AudiobookPlayer.swift:1571— Modules/Core/TTS/AudiobookPlayer.swift:1571-1582 | Modules/Core/TTS/TTSCoordinator.swift:1212-1242 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/TTS/TTSAudioProvider.swift:355— Modules/Core/TTS/TTSAudioProvider.swift:355-366 | Modules/Core/TTS/TTSAudioProvider.swift:368-381 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/Reader/CoreTextPagedView.swift:2181— Modules/Features/Reader/CoreTextPagedView.swift:2181-2194 | Modules/Features/Reader/CoreTextPagedView.swift:2196-2207 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Services/Offline/OfflineDownloadManager.swift:157— Modules/Services/Offline/OfflineDownloadManager.swift:157-168 | Modules/Services/Offline/OfflineDownloadManager.swift:170-186 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/Reader/ReaderOverlayContent.swift:287— Modules/Features/Reader/ReaderOverlayContent.swift:287-299 | Modules/Features/Reader/ReaderOverlayContent.swift:301-312 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:230— Modules/Core/BookSource/BookSourceStore.swift:230-243 | Modules/Core/RuleEngine/ModernParser/CookieStore.swift:218-229 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/BookDetail/OnlineBookMetadataFormatter.swift:12— Modules/Features/BookDetail/OnlineBookMetadataFormatter.swift:12-23 | Modules/Services/Works/BookSourceFillProvider.swift:174-185 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2314— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2314-2325 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:695-707 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:516— Modules/Core/BookSource/BookSourceStore.swift:516-527 | Modules/Core/BookSource/BookSourceStore.swift:529-540 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/Onboarding/OnboardingView.swift:233— Modules/Features/Onboarding/OnboardingView.swift:233-244 | Modules/Features/Reader/TTS/TTSPanelView.swift:582-593 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/RSS/RSSListView.swift:703— Modules/Features/RSS/RSSListView.swift:703-714 | Modules/Features/RSS/RSSArticleReaderView.swift:134-145 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:282— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:282-293 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1753-1764 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/BookSource/BookSourceImportConfirmSheet.swift:122— Modules/Features/BookSource/BookSourceImportConfirmSheet.swift:122-133 | Modules/Features/BookSource/JsBridgeBrowserView.swift:225-237 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:47— Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:47-58 | Modules/Features/FixedPageReader/Paged/FixedPageSpreadViewController.swift:52-63 — These two members are one piece of code written twice and then edited apart: 12 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.
Edited copy of a member (12 corresponding lines) Modules/Features/Settings/AppearanceThemeView.swift:1099— Modules/Features/Settings/AppearanceThemeView.swift:1099-1110 | Modules/Features/Settings/RootTabCustomizationView.swift:361-373 — These two members are one piece of code written twice and then edited apart: 12 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 (18 corresponding lines) · ×16
Edited copy of a member (18 corresponding lines) Modules/Services/Works/HomePageStore.swift:307— Modules/Services/Works/HomePageStore.swift:307-324 | Modules/Services/Works/HomePageStore.swift:334-351 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:157— Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:157-183 | Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:804-821 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Services/LibraryStore/BookStore.swift:1720— Modules/Services/LibraryStore/BookStore.swift:1720-1738 | Modules/Services/LibraryStore/BookStore.swift:1746-1763 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:432— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:432-449 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:451-469 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/TTS/TTSLoginScript.swift:58— Modules/Core/TTS/TTSLoginScript.swift:58-75 | Modules/Features/BookSource/BookSourceFormLoginView.swift:421-440 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Services/ForYou/ForYouCandidateStore.swift:59— Modules/Services/ForYou/ForYouCandidateStore.swift:59-82 | Modules/Services/Works/HomeFeedPageStore.swift:78-95 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/BookSource/BookSourceFetcher+Cache.swift:19— Modules/Core/BookSource/BookSourceFetcher+Cache.swift:19-36 | Modules/Core/BookSource/BookSourceFetcher+Cache.swift:76-93 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:249— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:249-269 | Modules/Features/Reader/CoreTextChunkCell.swift:435-452 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/SharedUI/Components/SourceWebUIDelegate.swift:54— Modules/SharedUI/Components/SourceWebUIDelegate.swift:54-71 | Modules/SharedUI/Components/SourceWebUIDelegate.swift:73-91 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/BookSource/BookSourceParsingPipeline.swift:62— Modules/Core/BookSource/BookSourceParsingPipeline.swift:62-79 | Modules/Core/BookSource/BookSourceParsingPipeline.swift:85-105 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2936— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2936-2953 | Modules/Core/ReaderCore/CoreText/FixedLayoutPageViewController.swift:163-182 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:885— Modules/Core/BookSource/SharedImportQueueDrainer.swift:885-902 | Modules/Core/Replace/ReplaceRuleStore.swift:294-318 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Features/Settings/ReplaceRuleListView.swift:214— Modules/Features/Settings/ReplaceRuleListView.swift:214-242 | Modules/Features/Settings/TXTTocRuleListView.swift:171-188 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Features/Reader/AutoReadControlView.swift:156— Modules/Features/Reader/AutoReadControlView.swift:156-173 | Modules/Features/Reader/TTS/TTSPanelView.swift:391-409 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:236— Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:236-253 | Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:1066-1090 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) Modules/Services/Account/GatewaySessionStore.swift:159— Modules/Services/Account/GatewaySessionStore.swift:159-177 | Modules/Services/Account/GatewaySessionStore.swift:179-196 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (10 lines × 2) Modules/Core/EPUB/BookParsing.swift:268— Modules/Core/EPUB/BookParsing.swift:268-277 | Modules/Core/TTS/TTSAudioProvider.swift:182-191 — 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 `Modules/Core/EPUB/BookParsing.swift:268` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401-410 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:452-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2153— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2153-2162 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2204-2213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2944— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2944-2953 | Modules/Core/ReaderCore/CoreText/FixedLayoutPageViewController.swift:173-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2944` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:273— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:273-282 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:332-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:273` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:609— Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:609-618 | Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:542-551 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:609` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:172— Modules/Core/RuleEngine/RuleEngine.swift:172-181 | Modules/Core/RuleEngine/RuleEngine.swift:242-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/RuleEngine.swift:172` it does not close everything it opens, so those exact lines 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) Modules/Core/TTS/HTTPTTSEngine.swift:303— Modules/Core/TTS/HTTPTTSEngine.swift:303-312 | Modules/Core/TTS/SystemTTSEngine.swift:228-237 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Features/Reader/ChapterTitleInspectorView.swift:642— Modules/Features/Reader/ChapterTitleInspectorView.swift:642-651 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:750-759 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Reader/ChapterTitleInspectorView.swift:642` it does not close everything it opens, so those exact lines 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) Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:623— Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:623-632 | Modules/Features/Reader/ReaderDialogueBubbleSettingsView.swift:595-604 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:623` it does not close everything it opens, so those exact lines 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) Modules/Services/Account/FirebaseAuthManager.swift:236— Modules/Services/Account/FirebaseAuthManager.swift:236-245 | Modules/Services/Account/FirebaseAuthManager.swift:782-791 — both copies are in the same file, so extract the 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 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 (10 lines × 2) Modules/Services/Account/GatewayKeychain.swift:44— Modules/Services/Account/GatewayKeychain.swift:44-53 | Modules/Services/Subscription/SubscriptionEntitlementCache.swift:73-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Modules/Services/Online/ChapterCacheRepository.swift:296— Modules/Services/Online/ChapterCacheRepository.swift:296-305 | Modules/Services/Online/ChapterCacheRepository.swift:395-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Online/ChapterCacheRepository.swift:296` it does not close everything it opens, so those exact lines 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) Modules/Services/Works/ImportedMetadataCapture.swift:12— Modules/Services/Works/ImportedMetadataCapture.swift:12-21 | Modules/Services/Works/ImportedMetadataCapture.swift:32-41 — both copies are in the same file, so extract the 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) Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:756— Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:756-765 | Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:789-798 — both copies are in the same file, so extract the 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 (10 lines × 2) Modules/Features/Reader/ReaderChromeCustomization.swift:175— Modules/Features/Reader/ReaderChromeCustomization.swift:175-184 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:98-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×14
Edited copy of a member (3 corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:213— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:213-215 | Modules/Core/PDF/PDFPageRasterizer.swift:131-139 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/TTS/EdgeTTSSecurityToken.swift:180— Modules/Core/TTS/EdgeTTSSecurityToken.swift:180-182 | Modules/Core/TTS/EdgeTTSSecurityToken.swift:184-186 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Services/iCloud/ICloudSyncManager.swift:1266— Modules/Services/iCloud/ICloudSyncManager.swift:1266-1268 | Modules/Services/iCloud/ICloudSyncManager.swift:1826-1828 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:96— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:96-98 | Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:127-129 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoSharedJsLibrary.swift:87— Modules/Core/RuleEngine/ModernParser/JS/LegadoSharedJsLibrary.swift:87-89 | Modules/Services/Online/DiscoverKindsCache.swift:102-104 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Features/BookDetail/BookDetailReviewsSection.swift:155— Modules/Features/BookDetail/BookDetailReviewsSection.swift:155-157 | Modules/Features/BookDetail/OnlineBookMetadataFormatter.swift:53-55 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/EPUB/PLSLexicon.swift:92— Modules/Core/EPUB/PLSLexicon.swift:92-94 | Modules/Core/ReaderCore/CoreText/MathMLRendering.swift:57-59 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/TTS/ChapterAudioProvider.swift:88— Modules/Core/TTS/ChapterAudioProvider.swift:88-90 | Modules/Core/Video/VideoChapterLink.swift:186-188 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/TTS/EdgeTTSSecurityToken.swift:192— Modules/Core/TTS/EdgeTTSSecurityToken.swift:192-194 | Modules/Services/RuleModules/RuleModuleScript.swift:274-276 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Targets/Yuedu/SharedApp/DefaultCoverLibrary.swift:56— Targets/Yuedu/SharedApp/DefaultCoverLibrary.swift:56-58 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4248-4250 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/TTS/TTSRoleVoiceCast.swift:194— Modules/Core/TTS/TTSRoleVoiceCast.swift:194-196 | Modules/Services/Online/VideoEpisodeStills.swift:42-44 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:65— Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:65-67 | Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift:202-204 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:61— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:61-63 | Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:131-133 — These two members are one piece of code written twice and then edited apart: 3 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.
Edited copy of a member (3 corresponding lines) scripts/explore_cover_fixture.py:42— scripts/explore_cover_fixture.py:42-44 | scripts/navigation_swipe_fixture.py:61-63 — These two members are one piece of code written twice and then edited apart: 3 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.
Duplicated block (15 lines × 2) Modules/Core/EPUB/PublicationSession.swift:212— Modules/Core/EPUB/PublicationSession.swift:212-226 | Modules/Core/EPUB/PublicationSession.swift:414-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/EPUB/PublicationSession.swift:212` 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 (15 lines × 2) Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:48— Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:48-62 | Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:206-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:222` calls `trimmingCharacters` and `Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:64` 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 (15 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1979— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1979-1993 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2008-2022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1979` 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 (15 lines × 2) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:288— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:288-302 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:345-359 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:288` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:1100— Modules/Core/RuleEngine/RuleEngine.swift:1100-1114 | Modules/Core/RuleEngine/RuleEngine.swift:1121-1135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/RuleEngine.swift:1100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Core/TTS/HTTPTTSEngine.swift:348— Modules/Core/TTS/HTTPTTSEngine.swift:348-362 | Modules/Core/TTS/SystemTTSEngine.swift:266-280 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) Modules/Core/TTS/HTTPTTSEngine.swift:810— Modules/Core/TTS/HTTPTTSEngine.swift:810-824 | Modules/Core/TTS/SystemTTSEngine.swift:425-439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/TTS/HTTPTTSEngine.swift:810` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:492— Modules/Features/BookDetail/AudiobookDetailView.swift:492-506 | Modules/Features/BookDetail/OnlineBookView.swift:558-572 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) Modules/Features/RSS/RSSListView.swift:1652— Modules/Features/RSS/RSSListView.swift:1652-1666 | Modules/Features/RSS/RSSListView.swift:1705-1719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSListView.swift:1652` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Features/RSS/RSSListView.swift:1713— Modules/Features/RSS/RSSListView.swift:1713-1727 | Modules/Features/RSS/RSSSourceEditSheets.swift:73-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/RSS/RSSListView.swift:1713` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Features/Reader/ReaderView+SourceChange.swift:243— Modules/Features/Reader/ReaderView+SourceChange.swift:243-257 | Modules/Features/Reader/ReaderView+SourceChange.swift:273-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderView+SourceChange.swift:243` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Features/Settings/BackupSyncView.swift:37— Modules/Features/Settings/BackupSyncView.swift:37-51 | Modules/Features/Settings/CacheManagementView.swift:167-181 — before extracting anything, compare `Modules/Features/Settings/BackupSyncView.swift` and `Modules/Features/Settings/CacheManagementView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Settings/BackupSyncView.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.
Duplicated block (15 lines × 2) Modules/Features/Settings/ICloudSyncView.swift:23— Modules/Features/Settings/ICloudSyncView.swift:23-37 | Modules/Features/Settings/WebDAVSyncView.swift:22-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Settings/ICloudSyncView.swift:23` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:256— Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:256-270 | Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:315-329 — both copies are in the same file, so extract the 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 (11 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextAnnotationRenderer.swift:172— Modules/Core/ReaderCore/CoreText/CoreTextAnnotationRenderer.swift:172-182 | Modules/Core/ReaderCore/CoreText/CoreTextAnnotationRenderer.swift:212-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextAnnotationRenderer.swift:172` 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) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:52— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:52-62 | Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:117-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:52` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Modules/Core/TTS/AudiobookPlayer.swift:1655— Modules/Core/TTS/AudiobookPlayer.swift:1655-1665 | Modules/Features/Reader/Video/VideoPlaybackController.swift:425-435 — 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 `Modules/Core/TTS/AudiobookPlayer.swift:1655` 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) Modules/Features/BookDetail/AudiobookDetailView.swift:107— Modules/Features/BookDetail/AudiobookDetailView.swift:107-117 | Modules/Features/BookDetail/VideoDetailView.swift:104-114 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookDetail/AudiobookDetailView.swift:107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:590— Modules/Features/BookDetail/AudiobookDetailView.swift:590-600 | Modules/Features/BookDetail/OnlineBookView.swift:661-671 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:590` 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) Modules/Features/Explore/Home/HomeSectionForm.swift:541— Modules/Features/Explore/Home/HomeSectionForm.swift:541-551 | Modules/Features/Explore/Home/HomeSectionForm.swift:589-599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Explore/Home/HomeSectionForm.swift:541` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Modules/Features/Library/Modules/RuleModuleImportSheet.swift:281— Modules/Features/Library/Modules/RuleModuleImportSheet.swift:281-291 | Modules/Features/Library/Modules/RuleModuleImportSheet.swift:293-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:62— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:62-72 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:54-64 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Reader/ReaderCommentCardSettingsView.swift:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Modules/Features/Reader/ReaderCustomBackgroundEditorView.swift:140— Modules/Features/Reader/ReaderCustomBackgroundEditorView.swift:140-150 | Modules/Features/Settings/AppearancePageBackgroundView.swift:60-70 — 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 `Modules/Features/Reader/ReaderCustomBackgroundEditorView.swift:140` 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) Modules/Features/Settings/ReaderChromeIconSettingsView.swift:156— Modules/Features/Settings/ReaderChromeIconSettingsView.swift:156-166 | Modules/Features/Settings/RootTabCustomizationView.swift:228-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Settings/ReaderChromeIconSettingsView.swift:156` 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) Modules/Services/Online/SearchResultPresentation.swift:59— Modules/Services/Online/SearchResultPresentation.swift:59-69 | Modules/Services/Online/SearchResultPresentation.swift:74-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Online/SearchResultPresentation.swift:59` 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) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1003— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1003-1013 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:399-409 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1003` it does not close everything it opens, so those exact lines 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) Modules/Features/WebBrowser/BrowserView.swift:447— Modules/Features/WebBrowser/BrowserView.swift:447-457 | Modules/SharedUI/Components/SourceLoginWebView.swift:216-226 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) scripts/source_category_cards_fixture.py:23— scripts/source_category_cards_fixture.py:23-33 | scripts/work_fill_fixture.py:25-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
R4 · Test Coverage· No test reaches this file · ×14
No test reaches this file Resources/Assets/Readability.js:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/appleTriage.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/feedbackTriage.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/triage.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/tools/feedback.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file gateway/scripts/integration-auth.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/apns.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/feedbackPush.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file gateway/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/feedbackStatusSync.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file functions/src/appStoreConnectSecrets.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×13
Edited copy of a member (15 corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:194— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:194-211 | Modules/Core/PDF/PDFPageRasterizer.swift:115-129 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:386— Modules/Core/BookSource/BookSourceStore.swift:386-400 | Modules/Core/BookSource/BookSourceStore.swift:405-419 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/Reader/ReaderView.swift:1555— Modules/Features/Reader/ReaderView.swift:1555-1569 | Modules/Features/Reader/ReaderView.swift:1573-1588 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Services/RuleModules/ModuleSearch.swift:28— Modules/Services/RuleModules/ModuleSearch.swift:28-42 | Modules/Services/Works/LibrarySearch.swift:80-94 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Services/Migration/StorageMigration.swift:71— Modules/Services/Migration/StorageMigration.swift:71-93 | Modules/Services/Migration/StorageMigration.swift:95-109 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/BookDetail/OnlineBookDetailDestination.swift:196— Modules/Features/BookDetail/OnlineBookDetailDestination.swift:196-213 | Modules/Features/ChangeSource/ChangeSourceViews.swift:384-398 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/Reader/ReaderBookmarkToast.swift:25— Modules/Features/Reader/ReaderBookmarkToast.swift:25-44 | Modules/Features/Reader/ReaderBookmarkToast.swift:52-66 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/Bookshelf/HomeView.swift:2095— Modules/Features/Bookshelf/HomeView.swift:2095-2109 | Modules/Features/Bookshelf/HomeView.swift:2291-2310 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:630— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:630-644 | Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:773-788 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Core/Comic/LocalMangaArchive.swift:367— Modules/Core/Comic/LocalMangaArchive.swift:367-381 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:172-190 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/BookDetail/BookDetailAuthorWorksSection.swift:23— Modules/Features/BookDetail/BookDetailAuthorWorksSection.swift:23-37 | Modules/Features/BookDetail/BookDetailGenreViews.swift:228-244 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Features/Feedback/FeedbackNotificationPresenter.swift:54— Modules/Features/Feedback/FeedbackNotificationPresenter.swift:54-68 | Modules/Features/Feedback/FeedbackThreadView.swift:466-482 — These two members are one piece of code written twice and then edited apart: 15 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.
Edited copy of a member (15 corresponding lines) Modules/Core/ReaderCore/Customization/RegexHighlightRule.swift:86— Modules/Core/ReaderCore/Customization/RegexHighlightRule.swift:86-100 | Modules/Core/ReaderCore/Customization/RegexHighlightRule.swift:102-118 — These two members are one piece of code written twice and then edited apart: 15 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.
Change coupling: AudiobookDetailView.swift ↔ OnlineBookView.swift Modules/Features/BookDetail/AudiobookDetailView.swift:1— `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` change together 88% of the time (30 of the 34 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 30 shared commits counted here, the most recent 3 are `724f13a8` feat(detail): a book's page shows its main genre alone; `d5f8a85d` feat(toc): 正序/倒序 in every 目錄, remembered per book (FB-37); `bf6e3a42` feat(video): an Emby-style detail page and a player for video sources — run `git show` on any of them.
Change coupling: BookSourceParsingPipeline.swift ↔ ModernParserBridge.swift Modules/Core/BookSource/BookSourceParsingPipeline.swift:1— `Modules/Core/BookSource/BookSourceParsingPipeline.swift` and `Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift` change together 80% of the time (8 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `960e71f5` fix(video): aggregate-source videos play in the app's player, never a…; `87bcd9c9` fix(sources): a page's, a chapter's and a book's puts stay with them; `bd56705e` fix(toc): read nextTocUrl as a URL list, as Legado does — run `git show` on any of them.
Change coupling: ExploreHome.swift ↔ AggregationSettingsView.swift Modules/Features/Explore/Home/ExploreHome.swift:1— `Modules/Features/Explore/Home/ExploreHome.swift` and `Modules/Features/Settings/AggregationSettingsView.swift` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `aa1a4b8f` feat(aggregation): one 中繼資料語言偏好推薦 menu that follows the app's language; `894c166f` feat(settings): 聚合設定 follows Emby's Home Screen page; `0fdc15be` refactor(explore): remove the catalog entry at the top of the home — run `git show` on any of them.
Change coupling: BookSourceFetcher+Chapter.swift ↔ ModernParserBridge.swift Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:1— `Modules/Core/BookSource/BookSourceFetcher+Chapter.swift` and `Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift` change together 67% of the time (10 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 10 shared commits counted here, the most recent 3 are `960e71f5` fix(video): aggregate-source videos play in the app's player, never a…; `87bcd9c9` fix(sources): a page's, a chapter's and a book's puts stay with them; `67eb5e9b` fix(sources): a book's requests are built with its own variables — run `git show` on any of them.
Change coupling: ExploreDestinations.swift ↔ HomeRowView.swift Modules/Features/Explore/ExploreDestinations.swift:1— `Modules/Features/Explore/ExploreDestinations.swift` and `Modules/Features/Explore/Home/HomeRowView.swift` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 10 shared commits counted here, the most recent 3 are `3f0bc32e` feat(explore): a 來源配置's categories as 分類卡片; `5ffa123a` feat(explore): shelf copies open their reader; a 書架 section for the home; `af58eaca` feat(ai): AI 推薦 home section, official module in the content picker (8c) — run `git show` on any of them.
Change coupling: BookStore.swift ↔ ChapterCacheRepository.swift Modules/Services/LibraryStore/BookStore.swift:1— `Modules/Services/LibraryStore/BookStore.swift` and `Modules/Services/Online/ChapterCacheRepository.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 — 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 `e8a07db8` feat(cache): automatic cleanup keeps caches under a size cap (FB-47); `4cac5edf` fix(reader): keep other highlights intact when one is added or removed; `14f37c72` Show imported books in the Files app, move internal data out of Docum… — run `git show` on any of them.
Change coupling: OnlineProviderAttributedStringBuilder.swift ↔ TXTLazyAttributedStringBuilder.swift Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:1— `Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift` and `Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `7c38881c` fix(reader): apply 繁簡轉換 everywhere the reader shows text; `1c8570ae` Fix replace rules not taking effect after long-press selection; `87b88857` Fix reader navigation, imports, fonts, and offline cache — run `git show` on any of them.
Change coupling: HTTPTTSEngine.swift ↔ TTSPanelView.swift Modules/Core/TTS/HTTPTTSEngine.swift:1— `Modules/Core/TTS/HTTPTTSEngine.swift` and `Modules/Features/Reader/TTS/TTSPanelView.swift` change together 50% of the time (10 of the 20 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 10 shared commits counted here, the most recent 3 are `5171372e` refactor(tts): remove the dead segment-skipped notice chain; `df6c392c` feat: export the whole customised look, and keep TTS playing with the…; `576a3776` Fix iOS TTS background playback — run `git show` on any of them.
Change coupling: BookSourceFetcher+Chapter.swift ↔ BookSourceFetcher+Search.swift Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:1— `Modules/Core/BookSource/BookSourceFetcher+Chapter.swift` and `Modules/Core/BookSource/BookSourceFetcher+Search.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 — 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 `87bcd9c9` fix(sources): a page's, a chapter's and a book's puts stay with them; `5ee41bd8` refactor(swift6): Sendable source session, header snapshot, RSS host …; `6b0fe026` wip(booksource): in-flight book-source, RSS, and audio-source changes — run `git show` on any of them.
Change coupling: NodeAttributedStringBuilder.swift ↔ BookContentProviderAdapters.swift Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:1— `Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift` and `Modules/Services/Online/BookContentProviderAdapters.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `a4d77f62` refactor: unify online reader rendering pipeline; `dea80e62` Remove temporary 段評 / manga-fetch DEBUG diagnostics (at that commit the files were still `iOS/Models/Reader/CoreText/NodeAttributedStringBuilder.swift` and `iOS/Models/Online/BookContentProviderAdapters.swift`); `cae3405f` Render online 段評 chapters via node layout; resolve EPUB TOC anchors t… (at that commit the files were still `iOS/Models/Reader/CoreText/NodeAttributedStringBuilder.swift` and `iOS/Models/Online/BookContentProviderAdapters.swift`) — run `git show` on any of them.
Change coupling: BookContentProviderAdapters.swift ↔ OnlineReadingPipeline.swift Modules/Services/Online/BookContentProviderAdapters.swift:1— `Modules/Services/Online/BookContentProviderAdapters.swift` and `Modules/Services/Online/OnlineReadingPipeline.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 5 shared commits counted here, the most recent 3 are `a4d77f62` refactor: unify online reader rendering pipeline; `dea80e62` Remove temporary 段評 / manga-fetch DEBUG diagnostics (at that commit the files were still `iOS/Models/Online/BookContentProviderAdapters.swift` and `iOS/Models/Online/OnlineReadingPipeline.swift`); `3599a076` Fix browser TOC web novel paragraphing (at that commit the files were still `iOS/Models/Online/BookContentProviderAdapters.swift` and `iOS/Models/Online/OnlineReadingPipeline.swift`) — run `git show` on any of them.
Change coupling: HomeModel.swift ↔ BookSourceProvider.swift Modules/Services/Works/HomeModel.swift:1— `Modules/Services/Works/HomeModel.swift` and `Modules/Services/Works/Providers/BookSourceProvider.swift` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `d9e0e952` feat(explore): draw each home row's saved page while it loads again; `edabe226` fix(discover): 為你推薦 follows the home's categories, shares one queue a…; `02d60022` feat(discover): one first-page fetch per home, saved for 為你推薦 (7a-1) — run `git show` on any of them.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
Members sharing a duplicated core (4 members, 50+ identical tokens) Modules/Core/BookSource/BookSourceFetcher+Cache.swift:239— Modules/Core/BookSource/BookSourceFetcher+Cache.swift:239-244 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:97-102 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:266-271 | Modules/Services/Online/ChapterCacheRepository.swift:436-441 — 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) Modules/Core/EPUB/EPUBBookParser.swift:93— Modules/Core/EPUB/EPUBBookParser.swift:93-102 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:151-162 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:95-103 | Modules/Services/Online/BookContentProviderAdapters.swift:94-102 — 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) Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:13— Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:13-27 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:374-608 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:610-673 | Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift:77-197 — 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) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:215— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:215-250 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:261-283 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:291-317 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:326-349 — 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) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:370— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:370-423 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:426-463 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1955-2002 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2004-2043 — 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) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11-172 | Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:864-914 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2554-2798 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2800-2853 — 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) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11-172 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2554-2798 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3355-3438 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3440-3530 — 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) Modules/Features/AI/AIBookshelfOrganizerView.swift:56— Modules/Features/AI/AIBookshelfOrganizerView.swift:56-76 | Modules/Features/AI/AICustomPromptListView.swift:8-54 | Modules/Features/Library/Modules/AIRecommendationModuleView.swift:24-53 | Modules/Features/Reader/ReaderBatterySVGImportView.swift:152-214 — 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) Modules/Features/RSS/RSSListView.swift:1535— Modules/Features/RSS/RSSListView.swift:1535-1590 | Modules/Features/RSS/RSSSourceEditSheets.swift:38-114 | Modules/Features/Reader/ReaderCommentCardSettingsView.swift:203-279 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:305-390 — 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) Modules/Features/Reader/ReaderChromeCustomization.swift:217— Modules/Features/Reader/ReaderChromeCustomization.swift:217-251 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4127-4152 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4252-4281 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:138-174 — 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) Modules/Features/Reader/ReaderSettingsView.swift:70— Modules/Features/Reader/ReaderSettingsView.swift:70-165 | Modules/Features/Reader/TTS/AudiobookView.swift:1091-1136 | Modules/Features/Reader/TTS/AudiobookView.swift:1159-1208 | Modules/Features/Stats/ReadingStatsView.swift:48-80 — 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) Modules/Services/RuleModules/RuleModuleValidator.swift:315— Modules/Services/RuleModules/RuleModuleValidator.swift:315-335 | Modules/Services/RuleModules/RuleModuleValidator.swift:518-553 | Modules/Services/RuleModules/RuleModuleValidator.swift:557-609 | Modules/Services/RuleModules/RuleModuleValidator.swift:613-645 — 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· Edited copy of a member (16 corresponding lines) · ×12
Edited copy of a member (16 corresponding lines) Modules/Core/BookSource/BookSource.swift:844— Modules/Core/BookSource/BookSource.swift:844-859 | Modules/Services/RuleModules/RuleModule.swift:332-348 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Core/RuleEngine/RuleEngine.swift:1021— Modules/Core/RuleEngine/RuleEngine.swift:1021-1039 | Modules/Core/RuleEngine/RuleEngine.swift:1382-1397 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Features/BookSource/BookSourceQuickActions.swift:100— Modules/Features/BookSource/BookSourceQuickActions.swift:100-116 | Modules/Features/Explore/Home/HomeConfigurationPrompts.swift:30-45 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Features/Settings/ReaderChromeIconSettingsView.swift:151— Modules/Features/Settings/ReaderChromeIconSettingsView.swift:151-166 | Modules/Features/Settings/RootTabCustomizationView.swift:222-238 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:447— Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:447-462 | Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:466-481 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:326— Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:326-341 | Modules/Services/LibraryStore/BookCoverLoader.swift:156-171 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Services/LibraryStore/BookStore.swift:730— Modules/Services/LibraryStore/BookStore.swift:730-745 | Modules/Services/LibraryStore/BookStore.swift:2782-2798 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBarLayoutMigration.swift:15— Modules/Core/ReaderCore/Customization/ReaderBarLayoutMigration.swift:15-30 | Modules/Core/ReaderCore/Customization/ReaderOverlayLayoutMigration.swift:27-42 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Services/Works/HomePageStore.swift:437— Modules/Services/Works/HomePageStore.swift:437-452 | Modules/Services/Works/WorkDecisionsStore.swift:118-133 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Features/Reader/ReaderModernBottomControlBar.swift:167— Modules/Features/Reader/ReaderModernBottomControlBar.swift:167-186 | Modules/Features/WebBrowser/BrowserView.swift:1173-1188 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Features/Reader/TTS/TTSRoleCastView.swift:510— Modules/Features/Reader/TTS/TTSRoleCastView.swift:510-525 | Modules/Features/Reader/TTS/TTSRoleCastView.swift:548-563 — These two members are one piece of code written twice and then edited apart: 16 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.
Edited copy of a member (16 corresponding lines) Modules/Core/TTS/TTSCoordinator.swift:832— Modules/Core/TTS/TTSCoordinator.swift:832-847 | Modules/Core/TTS/TTSCoordinator.swift:849-864 — These two members are one piece of code written twice and then edited apart: 16 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 copies of one member (3 members, 4+ corresponding lines) · ×12
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:65— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:65-68 | Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:61-66 | Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:96-101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:445— Modules/Features/BookDetail/AudiobookDetailView.swift:445-448 | Modules/Features/BookDetail/OnlineBookView.swift:503-506 | Modules/Features/BookDetail/VideoDetailView.swift:738-741 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:278— Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:278-281 | Modules/Core/ReaderCore/CoreText/ReviewCardTemplate.swift:337-340 | Modules/Core/TTS/AudiobookPlayer.swift:74-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderCommentBubbleCustomStyle.swift:179— Modules/Core/ReaderCore/Customization/ReaderCommentBubbleCustomStyle.swift:179-184 | Modules/Core/ReaderCore/Customization/ReaderCommentCardStyle.swift:139-142 | Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:79-82 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/ReaderCore/BrowserLayout/EPUBBrowserLayoutResourceAdapter.swift:37— Modules/Core/ReaderCore/BrowserLayout/EPUBBrowserLayoutResourceAdapter.swift:37-40 | Modules/Core/ReaderCore/CoreText/EPUBAttributedStringBuilder.swift:73-76 | Modules/Services/Online/BookContentProviderAdapters.swift:43-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:675— Modules/Features/BookDetail/AudiobookDetailView.swift:675-679 | Modules/Features/BookDetail/OnlineBookView.swift:739-743 | Modules/Features/BookDetail/VideoDetailView.swift:743-746 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:247— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:247-251 | Targets/Yuedu/SharedApp/DefaultCoverLibrary.swift:103-106 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4287-4290 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:638— Modules/Features/BookDetail/AudiobookDetailView.swift:638-641 | Modules/Features/BookDetail/OnlineBookView.swift:701-704 | Modules/Features/BookDetail/VideoDetailView.swift:632-635 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Services/AI/AIChatStore.swift:63— Modules/Services/AI/AIChatStore.swift:63-66 | Modules/Services/AI/AIProviderSettings.swift:81-84 | Modules/Services/Account/AccountDisplayNameEdits.swift:35-39 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:319— Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:319-322 | Modules/Core/ReaderCore/Customization/ReaderStylePrimitives.swift:170-173 | Modules/Features/Reader/ReaderOverlayPresentation.swift:150-153 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:217— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:217-220 | Modules/Core/PDF/PDFPageRasterizer.swift:141-144 | Modules/Services/LibraryStore/CoverImagePipeline.swift:991-994 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 4+ corresponding lines) Modules/Core/MOBI/MOBIMetadata.swift:73— Modules/Core/MOBI/MOBIMetadata.swift:73-76 | Modules/Core/ReaderCore/CoreText/UserReaderFontResolver.swift:37-40 | Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:134-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×11
Edited copy of a member (17 corresponding lines) Modules/Services/RuleModules/RuleModuleClient+Comments.swift:89— Modules/Services/RuleModules/RuleModuleClient+Comments.swift:89-107 | Modules/Services/RuleModules/RuleModuleClient+Detail.swift:42-58 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Features/Reader/CoreTextPagedView.swift:2844— Modules/Features/Reader/CoreTextPagedView.swift:2844-2863 | Modules/Features/Reader/CoreTextPagedView.swift:2865-2881 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Features/Explore/Home/HomeCollectionCards.swift:372— Modules/Features/Explore/Home/HomeCollectionCards.swift:372-391 | Modules/Features/Explore/Home/HomeSectionCards.swift:152-168 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:122— Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:122-138 | Modules/Core/ReaderCore/CoreText/CoreTextChapterFramesetter.swift:141-158 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Core/TXT/TXTMetadataProbe.swift:189— Modules/Core/TXT/TXTMetadataProbe.swift:189-205 | Modules/Core/TXT/TXTMetadataProbe.swift:223-241 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:612— Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:612-638 | Modules/Features/Reader/ReaderDialogueBubbleSettingsView.swift:593-609 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Services/AI/AIRecommendationStore.swift:108— Modules/Services/AI/AIRecommendationStore.swift:108-124 | Modules/Services/ForYou/ReadingGenreProfile.swift:139-155 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:7— Modules/Features/BookDetail/AudiobookDetailView.swift:7-938 | Modules/Features/BookDetail/VideoDetailView.swift:907-923 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:79— Modules/Core/BookSource/SharedImportQueueDrainer.swift:79-95 | Modules/Core/ReaderCore/Customization/ReaderCommentBubbleCustomStyle.swift:24-44 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:77— Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:77-93 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:125-146 — These two members are one piece of code written twice and then edited apart: 17 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.
Edited copy of a member (17 corresponding lines) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:558— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:558-576 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:749-765 — These two members are one piece of code written twice and then edited apart: 17 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 (28 corresponding lines) · ×11
Edited copy of a member (28 corresponding lines) Modules/Services/LibraryStore/AozoraBookImporter.swift:47— Modules/Services/LibraryStore/AozoraBookImporter.swift:47-77 | Modules/Services/LibraryStore/MOBIBookImporter.swift:19-46 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/BookSource/SharedImportQueueDrainer.swift:461— Modules/Core/BookSource/SharedImportQueueDrainer.swift:461-488 | Modules/Core/BookSource/SharedImportQueueDrainer.swift:537-569 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Features/Reader/TTS/TTSRoleCastView.swift:615— Modules/Features/Reader/TTS/TTSRoleCastView.swift:615-645 | Modules/Features/Settings/TTSCloudVoiceSettingsView.swift:196-223 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2383— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2383-2410 | Modules/Services/RSS/RSSUtilities.swift:760-788 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Features/Reader/ReaderView+SourceChange.swift:230— Modules/Features/Reader/ReaderView+SourceChange.swift:230-257 | Modules/Features/Reader/ReaderView+SourceChange.swift:260-287 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:282— Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:282-313 | Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:316-343 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/TXT/TXTChapterParser.swift:818— Modules/Core/TXT/TXTChapterParser.swift:818-847 | Modules/Core/TXT/TXTChapterParser.swift:849-876 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:288— Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:288-316 | Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:318-345 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:81— Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:81-108 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:61-93 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:130— Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:130-161 | Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift:90-117 — These two members are one piece of code written twice and then edited apart: 28 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.
Edited copy of a member (28 corresponding lines) Modules/Core/TTS/HTTPTTSEngine.swift:844— Modules/Core/TTS/HTTPTTSEngine.swift:844-871 | Modules/Core/TTS/SystemTTSEngine.swift:479-515 — These two members are one piece of code written twice and then edited apart: 28 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.
Duplicated block (10–11 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2316— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2316-2325 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:697-707 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 2) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:438— Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:438-448 | Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:456-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:438` 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.
Duplicated block (10–11 lines × 2) Modules/Features/AI/AIBookshelfOrganizerView.swift:62— Modules/Features/AI/AIBookshelfOrganizerView.swift:62-71 | Modules/Features/Library/Modules/AIRecommendationModuleView.swift:32-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/AI/AIBookshelfOrganizerView.swift:62` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) Modules/Features/BookSource/BookSourceListView.swift:701— Modules/Features/BookSource/BookSourceListView.swift:701-710 | Modules/Features/Settings/TTSSettingsView.swift:472-482 — 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 `Modules/Features/BookSource/BookSourceListView.swift:701` 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–11 lines × 2) Modules/Features/Bookshelf/OPDSImportView.swift:349— Modules/Features/Bookshelf/OPDSImportView.swift:349-358 | Modules/Features/Bookshelf/RemoteImportViews.swift:118-128 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Bookshelf/OPDSImportView.swift:349` 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) Modules/Features/RSS/RSSListView.swift:1535— Modules/Features/RSS/RSSListView.swift:1535-1544 | Modules/Features/RSS/RSSSourceEditSheets.swift:38-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. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSListView.swift:1535` it does not close everything it opens, so those exact lines 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) Modules/Features/Reader/TTS/TTSRoleCastView.swift:361— Modules/Features/Reader/TTS/TTSRoleCastView.swift:361-371 | Modules/Features/Reader/TTS/TTSRoleCastView.swift:624-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/TTS/TTSRoleCastView.swift:361` it does not close everything it opens, so those exact lines 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) Modules/Features/Settings/ProfileView.swift:409— Modules/Features/Settings/ProfileView.swift:409-419 | Modules/Features/Settings/TestFlightApplyView.swift:24-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Settings/ProfileView.swift:409` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) Modules/Services/Subscription/SubscriptionICloudMirror.swift:211— Modules/Services/Subscription/SubscriptionICloudMirror.swift:211-221 | Modules/Services/iCloud/ICloudSyncManager.swift:1951-1960 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) Modules/Services/Works/RemoteRecordStore.swift:157— Modules/Services/Works/RemoteRecordStore.swift:157-166 | Modules/Services/Works/RemoteRecordStore.swift:173-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Works/RemoteRecordStore.swift:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (10–11 lines × 2) Modules/Features/Reader/CoreTextPagedView.swift:2806— Modules/Features/Reader/CoreTextPagedView.swift:2806-2815 | Modules/Features/Reader/CoreTextPagedView.swift:2824-2834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/CoreTextPagedView.swift:2824` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:93— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:93-105 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2675-2691 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:93` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:31— Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:31-43 | Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:187-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 `Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:31` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:175— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:175-187 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:213-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 `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:175` it does not close everything it opens, so those exact lines 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) Modules/Features/Reader/ChapterTitleDesignerView.swift:80— Modules/Features/Reader/ChapterTitleDesignerView.swift:80-92 | Modules/Features/Reader/ChapterTitleDesignerView.swift:116-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ChapterTitleDesignerView.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 (13 lines × 2) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1484— Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1484-1496 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1509-1521 — both copies are in the same file, so extract the 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 (13 lines × 2) Modules/Services/Offline/DownloadActivityIntent.swift:55— Modules/Services/Offline/DownloadActivityIntent.swift:55-67 | Widget/DownloadActivityIntent.swift:55-67 — before extracting anything, compare `Modules/Services/Offline/DownloadActivityIntent.swift` and `Widget/DownloadActivityIntent.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 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.
Duplicated block (13 lines × 2) Modules/Services/Offline/OfflineDownloadManager.swift:282— Modules/Services/Offline/OfflineDownloadManager.swift:282-294 | Modules/Services/Offline/OfflineDownloadManager.swift:463-475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) Modules/Services/Online/BookContentProvider.swift:67— Modules/Services/Online/BookContentProvider.swift:67-79 | Modules/Services/Online/BookContentProviderAdapters.swift:19-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) Modules/Services/RSS/LegadoRSSScraper.swift:86— Modules/Services/RSS/LegadoRSSScraper.swift:86-98 | Modules/Services/RSS/LegadoRSSScraper.swift:194-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 (13 lines × 2) Modules/Features/Library/Modules/RuleModuleGroupView.swift:66— Modules/Features/Library/Modules/RuleModuleGroupView.swift:66-78 | Modules/Features/Library/Modules/RuleModuleSection.swift:74-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Library/Modules/RuleModuleGroupView.swift:66` 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, `Modules/Features/Library/Modules/RuleModuleSection.swift:73` calls `accessibilityIdentifier` and `Modules/Features/Library/Modules/RuleModuleGroupView.swift:65` 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 (17 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1873— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1873-1889 | Modules/Core/ReaderCore/CoreText/TextSelectionInteractor.swift:111-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1873` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1482— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1482-1498 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1530-1546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1482` 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 (17 lines × 2) Modules/Core/ReaderCore/CoreText/PaginationManager.swift:37— Modules/Core/ReaderCore/CoreText/PaginationManager.swift:37-53 | Modules/Core/ReaderCore/CoreText/PaginationManager.swift:61-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 `Modules/Core/ReaderCore/CoreText/PaginationManager.swift:37` 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 (17 lines × 2) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:75— Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:75-91 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:128-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Modules/Features/BookDetail/OnlineBookView.swift:866— Modules/Features/BookDetail/OnlineBookView.swift:866-882 | Modules/Features/BookDetail/OnlineBookView.swift:905-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:178— Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:178-194 | Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift:152-168 — 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 `Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:178` 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 (17 lines × 2) Modules/Features/Settings/ICloudSyncView.swift:157— Modules/Features/Settings/ICloudSyncView.swift:157-173 | Modules/Features/Settings/WebDAVSyncView.swift:137-153 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (17 lines × 2) Modules/Services/Network/WebViewFetcher.swift:410— Modules/Services/Network/WebViewFetcher.swift:410-426 | Modules/Services/Network/WebViewFetcher.swift:546-562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Network/WebViewFetcher.swift:410` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Modules/Features/BookSource/BookSourceDebugExportFile.swift:19— Modules/Features/BookSource/BookSourceDebugExportFile.swift:19-35 | Modules/Services/Diagnostics/DiagnosticReportBundle.swift:104-120 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×8
Edited copy of a member (19 corresponding lines) Modules/Core/AI/AIBookshelfOrganizer.swift:95— Modules/Core/AI/AIBookshelfOrganizer.swift:95-118 | Modules/Core/AI/AIChapterTranslation.swift:80-98 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:1541— Modules/Core/EPUB/PublicationSession.swift:1541-1564 | Modules/Core/EPUB/PublicationSession.swift:1647-1665 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Features/Reader/ReaderModernBottomControlBar.swift:260— Modules/Features/Reader/ReaderModernBottomControlBar.swift:260-278 | Modules/Features/Settings/AppearanceThemeView.swift:1014-1039 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:43— Modules/Core/ReaderCore/CoreText/CharOffsetStore.swift:43-61 | Modules/Core/ReaderCore/EPUBProgress.swift:236-254 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1404— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1404-1423 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1428-1446 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:176— Modules/Features/FixedPageReader/Paged/FixedPagePageViewController.swift:176-194 | Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonCell.swift:150-168 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Features/Explore/Home/HomeSectionForm.swift:559— Modules/Features/Explore/Home/HomeSectionForm.swift:559-578 | Modules/Features/Explore/Home/HomeSectionForm.swift:584-602 — These two members are one piece of code written twice and then edited apart: 19 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.
Edited copy of a member (19 corresponding lines) Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:14— Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:14-33 | Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:35-53 — These two members are one piece of code written twice and then edited apart: 19 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.
Duplicated block (14 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:248— Modules/Features/BookDetail/AudiobookDetailView.swift:248-261 | Modules/Features/BookDetail/OnlineBookView.swift:280-293 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:248` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) Modules/Features/BookSource/BookSourceCheckOptionsView.swift:79— Modules/Features/BookSource/BookSourceCheckOptionsView.swift:79-92 | Modules/Features/BookSource/BookSourceInfoSheet.swift:107-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookSource/BookSourceCheckOptionsView.swift:79` 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, `Modules/Features/BookSource/BookSourceCheckOptionsView.swift:77` calls `scrollIndicators` and `Modules/Features/BookSource/BookSourceInfoSheet.swift:105` 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) Modules/Features/Explore/Home/HomeSectionCards.swift:599— Modules/Features/Explore/Home/HomeSectionCards.swift:599-612 | Modules/Features/Explore/Home/HomeSectionCards.swift:894-907 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Explore/Home/HomeSectionCards.swift:599` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:687— Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:687-700 | Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:714-727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:687` it does not close everything it opens, so those 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 (14 lines × 2) Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:303— Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:303-316 | Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:332-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/FixedPageReader/Paged/FixedPagePagedViewController.swift:303` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) Modules/Services/LibraryStore/UniversalBookInterfaces.swift:149— Modules/Services/LibraryStore/UniversalBookInterfaces.swift:149-162 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:170-183 — both copies are in the same file, so extract the 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 (14 lines × 2) Modules/SharedUI/DesignSystem/GlobalAppTypography.swift:38— Modules/SharedUI/DesignSystem/GlobalAppTypography.swift:38-51 | Modules/SharedUI/DesignSystem/GlobalAppTypography.swift:85-98 — both copies are in the same file, so extract the 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) Modules/Services/Works/HomePageStore.swift:311— Modules/Services/Works/HomePageStore.swift:311-324 | Modules/Services/Works/HomePageStore.swift:338-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Works/HomePageStore.swift:311` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:660— Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:660-671 | Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:182-193 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `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 (12 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1226— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1226-1237 | Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:301-312 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1226` it does not close everything it opens, so those 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, `Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1238` calls `currentContentInsets` and `Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift:313` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2350— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2350-2361 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2395-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2350` 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 (12 lines × 2) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:297— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:297-308 | Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:348-359 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:199— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:199-210 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:231-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:199` 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) Modules/Features/Reader/ReaderDownloadOptionsView.swift:456— Modules/Features/Reader/ReaderDownloadOptionsView.swift:456-467 | Modules/Features/Settings/DownloadManagementView.swift:407-418 — 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 `Modules/Features/Reader/ReaderDownloadOptionsView.swift:456` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:601— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:601-612 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:582-593 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:124— Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:124-135 | Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:156-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Swallowed exception (caught, then discarded) Packages/SwiftSoup/Sources/DocumentType.swift:137— `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) Packages/SwiftSoup/Sources/Node.swift:304— `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) Packages/SwiftSoup/Sources/String.swift:519— `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) Packages/SwiftSoup/Sources/Token.swift:1448— `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) Modules/Services/Works/WebDAVMetadataFiller.swift:55— `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) REDACTED:166— `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) Modules/Services/RuleModules/ModuleSearch.swift:67— `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) Modules/Services/RuleModules/ModuleWorkDetail.swift:203— `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.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×7
Edited copy of a member (21 corresponding lines) Modules/Features/Explore/Home/HomeSectionCards.swift:659— Modules/Features/Explore/Home/HomeSectionCards.swift:659-679 | Modules/Features/Explore/Home/HomeSectionCards.swift:819-844 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Core/RuleEngine/RuleEngine.swift:1331— Modules/Core/RuleEngine/RuleEngine.swift:1331-1351 | Modules/Core/RuleEngine/RuleEngine.swift:1353-1380 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Features/Explore/Home/HomeSectionForm.swift:354— Modules/Features/Explore/Home/HomeSectionForm.swift:354-374 | Modules/Features/Settings/AggregationDataSourcesView.swift:137-164 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Core/ReaderCore/CoreText/PaginationManager.swift:35— Modules/Core/ReaderCore/CoreText/PaginationManager.swift:35-55 | Modules/Core/ReaderCore/CoreText/PaginationManager.swift:59-79 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:206— Modules/Core/EPUB/PublicationSession.swift:206-226 | Modules/Core/EPUB/PublicationSession.swift:408-428 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Features/BookDetail/BookDetailGenreViews.swift:318— Modules/Features/BookDetail/BookDetailGenreViews.swift:318-338 | Modules/Features/Explore/DiscoverShowcaseView.swift:337-358 — These two members are one piece of code written twice and then edited apart: 21 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.
Edited copy of a member (21 corresponding lines) Modules/Features/Settings/TestFlightApplyView.swift:87— Modules/Features/Settings/TestFlightApplyView.swift:87-107 | Modules/Features/Settings/TestFlightApplyView.swift:131-151 — These two members are one piece of code written twice and then edited apart: 21 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 (22 corresponding lines) · ×7
Edited copy of a member (22 corresponding lines) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:211— Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:211-237 | Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:263-284 — 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.
Edited copy of a member (22 corresponding lines) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:445— Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:445-466 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:557-583 — 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.
Edited copy of a member (22 corresponding lines) Modules/Features/Settings/ReaderChromeIconSettingsView.swift:175— Modules/Features/Settings/ReaderChromeIconSettingsView.swift:175-196 | Modules/Features/Settings/RootTabCustomizationView.swift:321-348 — 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.
Edited copy of a member (22 corresponding lines) Modules/Services/Account/FirebaseAuthManager.swift:207— Modules/Services/Account/FirebaseAuthManager.swift:207-231 | Modules/Services/Account/FirebaseAuthManager.swift:272-293 — 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.
Edited copy of a member (22 corresponding lines) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:609— Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:609-630 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:648-671 — 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.
Edited copy of a member (22 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:652— Modules/Features/BookDetail/AudiobookDetailView.swift:652-673 | Modules/Features/BookDetail/OnlineBookView.swift:716-737 — 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.
Edited copy of a member (22 corresponding lines) Modules/Services/Online/SearchAggregator.swift:215— Modules/Services/Online/SearchAggregator.swift:215-237 | Modules/Services/Online/SearchAggregator.swift:239-260 — 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 copies of one member (3 members, 7+ corresponding lines) · ×6
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Services/RuleModules/RuleModuleClient+Comments.swift:75— Modules/Services/RuleModules/RuleModuleClient+Comments.swift:75-84 | Modules/Services/RuleModules/RuleModuleClient+Detail.swift:61-67 | Modules/Services/RuleModules/RuleModuleClient+Reviews.swift:44-50 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Core/BookSource/BookSource.swift:8— Modules/Core/BookSource/BookSource.swift:8-15 | Modules/Core/BookSource/BookSource.swift:18-24 | Modules/Core/BookSource/BookSource.swift:27-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:85— Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:85-91 | Modules/Services/Works/HomeConfiguration.swift:234-240 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3596-3602 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Services/Account/GatewayAuthProvider.swift:88— Modules/Services/Account/GatewayAuthProvider.swift:88-94 | Modules/Services/Account/GatewayAuthProvider.swift:113-119 | Modules/Services/Account/GatewayAuthProvider.swift:121-129 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:430— Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:430-436 | Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:438-449 | Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:451-457 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) Modules/Core/BookSource/SourceAPIErrorLog.swift:278— Modules/Core/BookSource/SourceAPIErrorLog.swift:278-284 | Modules/Core/Replace/ReplaceRuleStore.swift:380-389 | Modules/Core/RuleEngine/ModernParser/Login/LoginManager.swift:490-501 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×6
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:509— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:509-516 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:895-903 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1165-1172 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:546— Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:546-553 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:559-566 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:572-579 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:609— Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:609-616 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:623-630 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:636-643 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Core/ReaderCore/CoreText/ReaderScrollItem.swift:37— Modules/Core/ReaderCore/CoreText/ReaderScrollItem.swift:37-44 | Modules/Core/ReaderCore/CoreText/ReaderScrollItem.swift:51-58 | Modules/Core/ReaderCore/CoreText/ReaderScrollItem.swift:86-93 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:145— Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:145-153 | Modules/Core/TTS/SystemTTSEngine.swift:606-613 | Modules/Core/TXT/AozoraMarkupParser.swift:158-166 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) Modules/Features/BookDetail/SourcePickerSheet.swift:80— Modules/Features/BookDetail/SourcePickerSheet.swift:80-87 | Modules/Features/ChangeSource/ChangeSourceViews.swift:287-294 | Modules/Features/Search/SearchBookListRow.swift:69-76 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×6
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Core/Audio/LocalAudiobookArchive.swift:302— Modules/Core/Audio/LocalAudiobookArchive.swift:302-309 | Modules/Core/Comic/LocalMangaArchive.swift:237-242 | Modules/Services/LibraryStore/AozoraBookImporter.swift:193-197 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Core/BookSource/BookSourceFetcher+Cache.swift:246— Modules/Core/BookSource/BookSourceFetcher+Cache.swift:246-250 | Modules/Core/BookSource/BookSourceFetcher+Cache.swift:265-269 | Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:635-639 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2299— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2299-2303 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2305-2311 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2313-2317 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Services/AI/AIBookSummaryStore.swift:29— Modules/Services/AI/AIBookSummaryStore.swift:29-35 | Modules/Services/AI/AICharacterMemoryStore.swift:17-21 | Modules/Services/RuleModules/RuleModuleRepository.swift:181-186 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:41— Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:41-47 | Modules/Services/RemoteLibrary/RemoteLibraryService.swift:108-112 | Modules/Services/RuleModules/ModuleBooks.swift:94-100 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) Modules/Core/BookSource/BookSourceStore.swift:1086— Modules/Core/BookSource/BookSourceStore.swift:1086-1091 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:168-172 | Modules/Features/BookSource/JsBridgeBrowserView.swift:407-413 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (6 lines × 3) Modules/Features/BookSource/BookSourceExportFile.swift:45— Modules/Features/BookSource/BookSourceExportFile.swift:45-50 | Modules/Features/Reader/ReaderStyleExportPayloads.swift:24-29 | Modules/Features/Settings/AppearanceCustomizationExportPayload.swift:40-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) Modules/Services/LibraryStore/BookStore.swift:530— Modules/Services/LibraryStore/BookStore.swift:530-535 | Modules/Services/LibraryStore/BookStore.swift:601-606 | Modules/Services/LibraryStore/BookStore.swift:667-672 — 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 (6 lines × 3) Modules/Features/Library/Modules/RuleModuleDetailView.swift:99— Modules/Features/Library/Modules/RuleModuleDetailView.swift:99-104 | Modules/Features/Library/Modules/RuleModuleGroupView.swift:89-94 | Modules/Features/Library/Modules/RuleModuleSection.swift:88-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `Modules/Features/Library/Modules/RuleModuleDetailView.swift:99` 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 × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:149— Modules/Features/BookDetail/AudiobookDetailView.swift:149-154 | Modules/Features/BookDetail/OnlineBookView.swift:237-242 | Modules/Features/BookDetail/VideoDetailView.swift:153-158 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) Modules/Features/Reader/ReaderTextUnderlineSettingsView.swift:65— Modules/Features/Reader/ReaderTextUnderlineSettingsView.swift:65-75 | Modules/Features/Reader/TTS/TTSPanelView.swift:565-570 | Modules/Features/Reader/TTS/TTSPanelView.swift:572-577 — 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.
Duplicated block (6 lines × 3) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:964— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:964-969 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:996-1001 | Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1134-1139 — 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 × 2 locations) Resources/Assets/Readability.js:2249— Resources/Assets/Readability.js:2249 · Resources/Assets/Readability.js:2259 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:602— REDACTED:602 · REDACTED:618 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) functions/src/appStoreConnect.ts:92— functions/src/appStoreConnect.ts:92 · functions/src/appStoreConnect.ts:125 — both copies are in the same file, so extract the 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 locations) REDACTED:282— REDACTED:282 · gateway/src/routes/subscription.ts:95 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:313— REDACTED:313 · REDACTED:325 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) gateway/src/routes/subscription.ts:29— gateway/src/routes/subscription.ts:29 · gateway/src/routes/subscription.ts:65 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2) Modules/Core/EPUB/PublicationSession.swift:1774— Modules/Core/EPUB/PublicationSession.swift:1774-1789 | Modules/Core/ReaderCore/CoreText/FixedLayoutViewportResolver.swift:75-90 — 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 (16 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:547— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:547-562 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:528-543 — 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 (16 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:810— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:810-825 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:933-948 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:78— Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:78-93 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:131-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 `Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:131` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) Modules/Features/Reader/ReaderNoteEditorView.swift:204— Modules/Features/Reader/ReaderNoteEditorView.swift:204-219 | Modules/Features/Reader/ReaderNoteEditorView.swift:221-236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderNoteEditorView.swift:204` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 3) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:390— Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:390-399 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:405-414 | Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:420-429 — 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 (10 lines × 3) Modules/Core/RuleEngine/RuleEngine.swift:577— Modules/Core/RuleEngine/RuleEngine.swift:577-586 | Modules/Core/RuleEngine/RuleEngine.swift:618-627 | Modules/Core/RuleEngine/RuleEngine.swift:1360-1369 — 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) Modules/Features/Bookshelf/HomeView.swift:1568— Modules/Features/Bookshelf/HomeView.swift:1568-1577 | Modules/Features/Reader/ReaderCommentCardSettingsView.swift:40-49 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:32-41 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Bookshelf/HomeView.swift:1568` 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 × 3) Modules/Features/Explore/Home/HomeSectionForm.swift:565— Modules/Features/Explore/Home/HomeSectionForm.swift:565-574 | Modules/Features/Explore/Home/HomeSectionForm.swift:744-753 | Modules/Features/Explore/Home/HomeSectionForm.swift:761-770 — 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 `Modules/Features/Explore/Home/HomeSectionForm.swift:565` 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 × 3) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:558— Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageView.swift:558-567 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:381-390 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:3119-3128 — 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.
Duplicated block (7 lines × 3) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1961— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1961-1967 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2017-2023 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2081-2090 — 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 `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2081` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2092` calls `renderBlock` and `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1968` 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 (7 lines × 3) Modules/Features/Explore/Home/HomeHeroCard.swift:60— Modules/Features/Explore/Home/HomeHeroCard.swift:60-66 | Modules/Features/Explore/Home/HomeSectionCards.swift:665-671 | Modules/Features/Explore/Home/HomeSectionCards.swift:826-832 — 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 `Modules/Features/Explore/Home/HomeHeroCard.swift:60` 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, `Modules/Features/Explore/Home/HomeSectionCards.swift:835` calls `padding` and `Modules/Features/Explore/Home/HomeSectionCards.swift:672` 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 (7 lines × 3) Modules/Features/RSS/RSSListView.swift:617— Modules/Features/RSS/RSSListView.swift:617-626 | Modules/Features/RSS/RSSListView.swift:645-654 | Modules/Features/Settings/AppearanceThemeView.swift:685-691 — 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 `Modules/Features/RSS/RSSListView.swift:617` it does not close everything it opens, so those 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. 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 × 3) Modules/Features/Reader/ReaderSettingsView.swift:108— Modules/Features/Reader/ReaderSettingsView.swift:108-118 | Modules/Features/Reader/TTS/AudiobookView.swift:1127-1133 | Modules/Features/Reader/TTS/AudiobookView.swift:1187-1193 — 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 `Modules/Features/Reader/ReaderSettingsView.swift:108` 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 × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:573— Modules/Features/BookDetail/AudiobookDetailView.swift:573-581 | Modules/Features/BookDetail/OnlineBookView.swift:644-652 | Modules/Features/BookDetail/VideoDetailView.swift:712-718 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 × 4) Modules/Core/BookSource/BookSourceFetcher+Cache.swift:240— Modules/Core/BookSource/BookSourceFetcher+Cache.swift:240-244 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:98-102 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:267-271 | Modules/Services/Online/ChapterCacheRepository.swift:437-441 — 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. 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 × 4) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:220— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:220-224 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:267-271 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:294-298 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:329-333 — 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. 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 × 4) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:419— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:419-423 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:459-463 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1993-2002 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2034-2043 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:419` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) Modules/Features/RSS/RSSListView.swift:1537— Modules/Features/RSS/RSSListView.swift:1537-1541 | Modules/Features/RSS/RSSSourceEditSheets.swift:40-44 | Modules/Features/Reader/ReaderCommentCardSettingsView.swift:204-208 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:306-310 — 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 `Modules/Features/RSS/RSSListView.swift:1537` it does not close everything it opens, so those exact lines 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 × 4) Modules/Features/Reader/ReaderChromeCustomization.swift:239— Modules/Features/Reader/ReaderChromeCustomization.swift:239-243 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4146-4150 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4275-4279 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:161-165 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×4
Edited copy of a member (27 corresponding lines) Modules/Services/Works/AuthorWorks.swift:121— Modules/Services/Works/AuthorWorks.swift:121-150 | Modules/Services/Works/ShelfGenres.swift:7-33 — These two members are one piece of code written twice and then edited apart: 27 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.
Edited copy of a member (27 corresponding lines) Modules/Features/Reader/CoreTextPagedView.swift:2250— Modules/Features/Reader/CoreTextPagedView.swift:2250-2276 | Modules/Features/Reader/CoreTextPagedView.swift:2278-2309 — These two members are one piece of code written twice and then edited apart: 27 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.
Edited copy of a member (27 corresponding lines) Modules/Core/EPUB/EPUBBookParser.swift:61— Modules/Core/EPUB/EPUBBookParser.swift:61-91 | Modules/Services/Online/BookContentProviderAdapters.swift:66-92 — These two members are one piece of code written twice and then edited apart: 27 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.
Edited copy of a member (27 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:765— Modules/Features/BookDetail/AudiobookDetailView.swift:765-793 | Modules/Features/BookDetail/VideoDetailView.swift:804-830 — These two members are one piece of code written twice and then edited apart: 27 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 (20 corresponding lines) · ×4
Edited copy of a member (20 corresponding lines) Modules/Core/AI/AIReadingEvidence.swift:101— Modules/Core/AI/AIReadingEvidence.swift:101-120 | Modules/Features/WebBrowser/BrowserView.swift:155-192 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Modules/Services/Works/HomePageStore.swift:210— Modules/Services/Works/HomePageStore.swift:210-230 | Modules/Services/Works/WorkDecisionsStore.swift:182-201 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Modules/Services/LibraryStore/UniversalBookInterfaces.swift:148— Modules/Services/LibraryStore/UniversalBookInterfaces.swift:148-167 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:169-188 — These two members are one piece of code written twice and then edited apart: 20 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.
Edited copy of a member (20 corresponding lines) Modules/Features/Reader/TTS/AudiobookView.swift:646— Modules/Features/Reader/TTS/AudiobookView.swift:646-671 | Modules/Features/Reader/TTS/NowPlayingPopup.swift:536-555 — These two members are one piece of code written twice and then edited apart: 20 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 copies of one member (4 members, 8+ corresponding lines) · ×4
Edited copies of one member (4 members, 8+ corresponding lines) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:522— Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:522-531 | Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:368-377 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2070-2081 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2255-2262 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) Modules/Features/BookDetail/BookDetailComponents.swift:1928— Modules/Features/BookDetail/BookDetailComponents.swift:1928-1942 | Modules/Features/Bookshelf/HomeView.swift:2550-2561 | Modules/Features/ChangeSource/ChangeSourceViews.swift:370-381 | Modules/Features/Explore/Home/HomeEditor.swift:500-507 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) Modules/Core/ReaderCore/Customization/AppearanceThemePreset.swift:758— Modules/Core/ReaderCore/Customization/AppearanceThemePreset.swift:758-765 | Modules/Features/Reader/ReaderBarsView.swift:111-118 | Modules/SharedUI/Components/GeneratedBookCover.swift:73-80 | Targets/Yuedu/SharedApp/GlobalSettings.swift:695-702 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 8+ corresponding lines) Modules/Core/ReaderCore/Customization/ChapterTitleDesign.swift:277— Modules/Core/ReaderCore/Customization/ChapterTitleDesign.swift:277-284 | Modules/Core/ReaderCore/Customization/ReaderBarLayout.swift:245-252 | Modules/Core/ReaderCore/Customization/ReaderDialogueBubbleStyle.swift:345-352 | Modules/Core/ReaderCore/Customization/ReaderOverlayLayout.swift:29-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (11–12 lines × 2) Modules/Core/BookSource/BookSourceFetcher+Cache.swift:218— Modules/Core/BookSource/BookSourceFetcher+Cache.swift:218-229 | Modules/Core/BookSource/BookSourceHealthChecker.swift:124-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/BookSource/BookSourceFetcher+Cache.swift:218` it does not close everything it opens, so those exact lines 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) Modules/Features/BookDetail/OnlineBookDetailDestination.swift:231— Modules/Features/BookDetail/OnlineBookDetailDestination.swift:231-241 | Modules/Features/BookDetail/OnlineBookDetailDestination.swift:249-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookDetail/OnlineBookDetailDestination.swift:231` 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) Modules/Services/Works/ChapterComments.swift:83— Modules/Services/Works/ChapterComments.swift:83-93 | Modules/Services/Works/WorkReviews.swift:95-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Services/Works/ChapterComments.swift:83` 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 (11–12 lines × 2) Modules/Features/Reader/ReaderTOCViews.swift:591— Modules/Features/Reader/ReaderTOCViews.swift:591-601 | Modules/Features/Reader/ReaderTOCViews.swift:637-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderTOCViews.swift:591` it does not close everything it opens, so those exact lines 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) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:42— Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:42-52 | Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:83-93 | Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:95-105 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:94` calls `closeSubpath`, `move`, `CGPoint` and `Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:53` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:287— Modules/Features/BookDetail/AudiobookDetailView.swift:287-297 | Modules/Features/BookDetail/OnlineBookView.swift:319-329 | Modules/Features/BookDetail/VideoDetailView.swift:200-210 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:287` 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 × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:537— Modules/Features/BookDetail/AudiobookDetailView.swift:537-547 | Modules/Features/BookDetail/OnlineBookView.swift:608-618 | Modules/Features/BookDetail/VideoDetailView.swift:684-694 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 (11 lines × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:555— Modules/Features/BookDetail/AudiobookDetailView.swift:555-565 | Modules/Features/BookDetail/OnlineBookView.swift:626-636 | Modules/Features/BookDetail/VideoDetailView.swift:700-710 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 × 3) Modules/Services/iCloud/ICloudSyncManager.swift:494— Modules/Services/iCloud/ICloudSyncManager.swift:494-498 | Modules/Services/iCloud/ICloudSyncManager.swift:534-538 | Modules/Services/iCloud/ICloudSyncManager.swift:554-558 — 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 `Modules/Services/iCloud/ICloudSyncManager.swift:494` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 3) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:743— Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:743-747 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:770-774 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:794-798 — 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, `Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:791` calls `parseCoordinate`, `extractAttribute` and `Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:769` 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 (5 lines × 3) Modules/Services/Network/WebViewFetcher.swift:324— Modules/Services/Network/WebViewFetcher.swift:324-328 | Modules/Services/Network/WebViewFetcher.swift:663-667 | Modules/Services/RSS/RSSUtilities.swift:964-968 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Services/RSS/RSSUtilities.swift:963` calls `escapeJavaScriptString` and `Modules/Services/Network/WebViewFetcher.swift:662` 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 (5 lines × 3) scripts/module_repository_fixture.py:51— scripts/module_repository_fixture.py:51-55 | scripts/source_category_cards_fixture.py:47-51 | scripts/work_fill_fixture.py:46-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 all 3 call sites, so a change lands once.
Duplicated block (8 lines × 2 locations) Resources/Assets/Readability.js:2156— Resources/Assets/Readability.js:2156 · Resources/Assets/Readability.js:2167 — both copies are in the same file, so extract the 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 (8 lines × 2 locations) REDACTED:1098— REDACTED:1098 · REDACTED:1218 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) gateway/src/feedbackPolicy.ts:214— gateway/src/feedbackPolicy.ts:214 · gateway/src/feedbackPolicy.ts:370 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (8 lines × 2 locations) gateway/src/routes/avatar.ts:72— gateway/src/routes/avatar.ts:72 · gateway/src/routes/subscription.ts:53 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
FunctionTooLong: feedback.feedbackRouter REDACTED:38— FunctionTooLong — feedbackRouter runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× 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.
FunctionTooLong: BrowserView.swift.top-level code Modules/Features/WebBrowser/BrowserView.swift:196— FunctionTooLong — top-level code runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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.
FunctionTooLong: auth.authRouter REDACTED:25— FunctionTooLong — authRouter 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:244— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:244-303 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:305-359 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:361-421 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:427-455 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:458-480 — 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) Modules/Services/Network/WebViewFetcher.swift:214— Modules/Services/Network/WebViewFetcher.swift:214-265 | Modules/Services/Network/WebViewFetcher.swift:269-314 | Modules/Services/Network/WebViewFetcher.swift:346-426 | Modules/Services/Network/WebViewFetcher.swift:517-562 | Modules/Services/Network/WebViewFetcher.swift:570-622 — 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) Modules/Services/Works/Providers/ShelfProvider.swift:138— Modules/Services/Works/Providers/ShelfProvider.swift:138-155 | Modules/Services/Works/Providers/ShelfProvider.swift:160-181 | Modules/Services/Works/Providers/ShelfProvider.swift:197-213 | Modules/Services/Works/Providers/ShelfProvider.swift:217-234 | Modules/Services/Works/Providers/ShelfProvider.swift:242-278 — 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· Edited copy of a member (39 corresponding lines) · ×3
Edited copy of a member (39 corresponding lines) Modules/Core/RuleEngine/RuleEngine.swift:570— Modules/Core/RuleEngine/RuleEngine.swift:570-609 | Modules/Core/RuleEngine/RuleEngine.swift:612-650 — These two members are one piece of code written twice and then edited apart: 39 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.
Edited copy of a member (39 corresponding lines) Modules/Features/Reader/ReaderDownloadOptionsView.swift:451— Modules/Features/Reader/ReaderDownloadOptionsView.swift:451-489 | Modules/Features/Settings/DownloadManagementView.swift:401-441 — These two members are one piece of code written twice and then edited apart: 39 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.
Edited copy of a member (39 corresponding lines) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2806— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2806-2844 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2846-2899 — These two members are one piece of code written twice and then edited apart: 39 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 (25 corresponding lines) · ×3
Edited copy of a member (25 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1865— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1865-1889 | Modules/Core/ReaderCore/CoreText/TextSelectionInteractor.swift:95-127 — These two members are one piece of code written twice and then edited apart: 25 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.
Edited copy of a member (25 corresponding lines) Modules/Services/Works/WebDAVIndexCoordinator.swift:237— Modules/Services/Works/WebDAVIndexCoordinator.swift:237-261 | Modules/Services/Works/WebDAVIndexCoordinator.swift:278-304 — These two members are one piece of code written twice and then edited apart: 25 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.
Edited copy of a member (25 corresponding lines) Modules/Features/Subscription/PaywallMemberPage.swift:199— Modules/Features/Subscription/PaywallMemberPage.swift:199-223 | Modules/Features/Subscription/PaywallView.swift:295-324 — These two members are one piece of code written twice and then edited apart: 25 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 (26 corresponding lines) · ×3
Edited copy of a member (26 corresponding lines) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:40— Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:40-65 | Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:81-115 — These two members are one piece of code written twice and then edited apart: 26 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.
Edited copy of a member (26 corresponding lines) Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:684— Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:684-709 | Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:711-736 — These two members are one piece of code written twice and then edited apart: 26 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.
Edited copy of a member (26 corresponding lines) Modules/Core/RuleEngine/ModernParser/RegexExtractor.swift:15— Modules/Core/RuleEngine/ModernParser/RegexExtractor.swift:15-46 | Modules/Core/RuleEngine/ModernParser/RegexExtractor.swift:48-73 — These two members are one piece of code written twice and then edited apart: 26 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 copies of one member (3 members, 18+ corresponding lines) · ×3
Edited copies of one member (3 members, 18+ corresponding lines) REDACTED:328— REDACTED:328-345 | REDACTED:348-368 | REDACTED:371-391 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) Modules/Features/Settings/AppearancePageBackgroundView.swift:218— Modules/Features/Settings/AppearancePageBackgroundView.swift:218-235 | Modules/Features/Settings/DefaultCoverSettingsView.swift:204-222 | Modules/Features/Settings/LaunchImageSettingsView.swift:119-137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) Modules/Features/Reader/ReaderBarLayoutEditorView.swift:608— Modules/Features/Reader/ReaderBarLayoutEditorView.swift:608-625 | Modules/Features/Settings/AppearanceInterfaceEffectsView.swift:94-115 | Modules/Features/Settings/AppearanceInterfaceEffectsView.swift:145-164 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) Modules/Features/Explore/Home/HomeSectionCards.swift:310— Modules/Features/Explore/Home/HomeSectionCards.swift:310-340 | Modules/Features/Explore/Home/HomeSectionCards.swift:345-367 — These two members are one piece of code written twice and then edited apart: 23 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.
Edited copy of a member (23 corresponding lines) Modules/Features/Explore/Home/HomeCollectionCards.swift:177— Modules/Features/Explore/Home/HomeCollectionCards.swift:177-199 | Modules/Features/Explore/Home/HomeGenreList.swift:18-44 — These two members are one piece of code written twice and then edited apart: 23 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.
Edited copy of a member (23 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:154— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:154-176 | Modules/Core/ReaderCore/ReaderPresentationContract.swift:247-269 — These two members are one piece of code written twice and then edited apart: 23 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 copies of one member (3 members, 14+ corresponding lines) · ×3
Edited copies of one member (3 members, 14+ corresponding lines) Modules/Core/BookSource/BookSource.swift:76— Modules/Core/BookSource/BookSource.swift:76-90 | Modules/Core/BookSource/BookSource.swift:115-130 | Modules/Core/BookSource/BookSource.swift:216-229 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) Modules/Features/Reader/ReaderStyleExportPayloads.swift:43— Modules/Features/Reader/ReaderStyleExportPayloads.swift:43-56 | Modules/Features/Reader/ReaderStyleExportPayloads.swift:68-81 | Modules/Features/Settings/AppearanceCustomizationExportPayload.swift:17-34 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 14+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderCommentBubbleCustomStyle.swift:197— Modules/Core/ReaderCore/Customization/ReaderCommentBubbleCustomStyle.swift:197-212 | Modules/Core/ReaderCore/Customization/ReaderCommentCardStyle.swift:146-159 | Modules/Core/ReaderCore/Customization/ReaderCustomBackground.swift:60-73 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×3
Edited copies of one member (3 members, 15+ corresponding lines) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:432— Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:432-447 | Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:450-464 | Modules/Core/TTS/TTSAudioProvider.swift:1085-1106 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:807— Modules/Core/Aozora/AozoraXHTMLWriter.swift:392-406 | Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:807-821 | Modules/Services/RuleModules/RuleModuleClient.swift:418-433 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) Modules/Features/Reader/ChapterTitleInspectorView.swift:642— Modules/Features/Reader/ChapterTitleInspectorView.swift:642-656 | Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:376-391 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:750-764 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×3
Edited copies of one member (3 members, 10+ corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:749— Modules/Features/BookDetail/AudiobookDetailView.swift:749-763 | Modules/Features/BookDetail/OnlineBookView.swift:969-985 | Modules/Features/BookDetail/VideoDetailView.swift:832-841 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Modules/Services/iCloud/FirestoreSyncManager.swift:495— Modules/Services/iCloud/FirestoreSyncManager.swift:495-506 | Modules/Services/iCloud/FirestoreSyncManager.swift:508-517 | Modules/Services/iCloud/FirestoreSyncManager.swift:519-528 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1251— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1251-1262 | Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:213-225 | Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:316-325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 4+ corresponding lines) · ×3
Edited copies of one member (5 members, 4+ corresponding lines) Modules/Core/TTS/AzureTTS.swift:282— Modules/Core/TTS/AzureTTS.swift:282-287 | Modules/Services/AI/AIBookSummaryStore.swift:12-15 | Modules/Services/AI/AIChapterTranslationStore.swift:16-19 | Modules/Services/AI/AICharacterMemoryStore.swift:11-14 | Modules/Services/AI/AIDialogueCastStore.swift:14-18 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2655— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2655-2658 | Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:1120-1123 | Modules/Core/RuleEngine/RuleEngine.swift:1402-1405 | Modules/Core/TTS/TTSAudioProvider.swift:723-726 | Modules/Services/RSS/RSSModels.swift:255-258 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 4+ corresponding lines) Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:25— Modules/Core/ReaderCore/CoreText/NodeAttributedStringBuilder.swift:25-28 | Modules/Features/BookDetail/VideoDetailView.swift:173-176 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:342-345 | Modules/Services/Online/BookContentProvider.swift:62-65 | Modules/Services/Online/BookContentProviderAdapters.swift:14-17 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 3+ corresponding lines) · ×3
Edited copies of one member (4 members, 3+ corresponding lines) Modules/Core/ReaderCore/Customization/ReaderOverlaySVGAssetStore.swift:354— Modules/Core/ReaderCore/Customization/ReaderOverlaySVGAssetStore.swift:354-358 | Modules/Core/ReaderCore/Translation/ReaderTranslationLayout.swift:64-66 | Modules/Services/Online/LegadoReviewActionRunner.swift:121-125 | Modules/Services/RemoteLibrary/RemoteLibraryCache.swift:26-28 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) Modules/Core/AI/AISourceSnapshot.swift:26— Modules/Core/AI/AISourceSnapshot.swift:26-28 | Modules/Core/EPUB/EPUBPackageArchive.swift:81-83 | Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:212-214 | Modules/Services/PublicLibrary/AozoraCatalogStore.swift:129-131 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 3+ corresponding lines) Modules/Core/AI/AIBookshelfOrganizer.swift:121— Modules/Core/AI/AIBookshelfOrganizer.swift:121-123 | Modules/Core/AI/AIRecommendation.swift:109-111 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2650-2652 | Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:158-161 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Duplicated block (12–13 lines × 2) Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:332— Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:332-343 | Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:345-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 `Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:345` 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 (12–13 lines × 2) Modules/Core/TTS/HTTPTTSEngine.swift:203— Modules/Core/TTS/HTTPTTSEngine.swift:203-215 | Modules/Core/TTS/SystemTTSEngine.swift:141-152 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/TTS/HTTPTTSEngine.swift:203` it does not close everything it opens, so those exact lines 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–13 lines × 2) Modules/Features/Reader/ReaderView.swift:1930— Modules/Features/Reader/ReaderView.swift:1930-1942 | Modules/Features/Reader/ReaderView.swift:2009-2020 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderView.swift:1930` 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 (9–11 lines × 2) Modules/Core/EPUB/PublicationSession.swift:1058— Modules/Core/EPUB/PublicationSession.swift:1058-1068 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:121-129 — 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 `Modules/Core/EPUB/PublicationSession.swift:1058` it does not close everything it opens, so those 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–11 lines × 2) Modules/Features/Explore/Home/ExploreHome.swift:193— Modules/Features/Explore/Home/ExploreHome.swift:193-203 | Modules/Features/Library/LibraryTabRoot.swift:141-149 — 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 `Modules/Features/Explore/Home/ExploreHome.swift:193` 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–11 lines × 2) Modules/Services/Network/WebViewFetcher.swift:533— Modules/Services/Network/WebViewFetcher.swift:533-543 | Modules/Services/Network/WebViewFetcher.swift:586-594 — both copies are in the same file, so extract the 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–10 lines × 2) Modules/Features/Bookshelf/HomeView.swift:1180— Modules/Features/Bookshelf/HomeView.swift:1180-1189 | Modules/Features/Bookshelf/HomeView.swift:1330-1338 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Bookshelf/HomeView.swift:1180` 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, `Modules/Features/Bookshelf/HomeView.swift:1329` calls `toggleSelection` and `Modules/Features/Bookshelf/HomeView.swift:1180` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 2) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:217— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:217-225 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:321-330 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) Modules/Services/AI/AIBookIndexStore.swift:25— Modules/Services/AI/AIBookIndexStore.swift:25-33 | Modules/Services/AI/AICharacterCardStore.swift:17-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 3) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401-409 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:433-441 | Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:452-460 — 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 `Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:401` it does not close everything it opens, so those exact lines 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 × 3) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:310— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:310-318 | Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:361-369 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4292-4300 — 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 (9 lines × 3) Modules/Features/Reader/ReaderChromeCustomization.swift:262— Modules/Features/Reader/ReaderChromeCustomization.swift:262-270 | Targets/Yuedu/SharedApp/RootTabCustomization.swift:191-199 | Targets/Yuedu/SharedApp/UserFontStorageManager.swift:150-158 — 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) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:56— Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:56-63 | Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:87-94 | Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:99-106 — 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 `Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleDecorationShape.swift:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 3) Modules/Core/RuleEngine/RuleEngine.swift:886— Modules/Core/RuleEngine/RuleEngine.swift:886-893 | Modules/Core/RuleEngine/RuleEngine.swift:1373-1380 | Modules/Core/RuleEngine/RuleEngine.swift:1390-1397 — 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 `Modules/Core/RuleEngine/RuleEngine.swift:886` 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, `Modules/Core/RuleEngine/RuleEngine.swift:1389` calls `lowercased` and `Modules/Core/RuleEngine/RuleEngine.swift:885` 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 × 3) Modules/Features/Reader/ReaderTranslationSheet.swift:67— Modules/Features/Reader/ReaderTranslationSheet.swift:67-74 | Modules/Features/Subscription/PaywallMemberPage.swift:74-81 | Modules/Features/Subscription/PaywallView.swift:149-160 — 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 `Modules/Features/Reader/ReaderTranslationSheet.swift:67` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3 locations) REDACTED:81— REDACTED:81 · REDACTED:126 · REDACTED:153 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 3 locations) REDACTED:99— REDACTED:99 · REDACTED:181 · gateway/src/routes/subscription.ts:63 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 3 locations) gateway/src/routes/profile.ts:22— gateway/src/routes/profile.ts:22 · gateway/src/routes/subscription.ts:43 · gateway/src/routes/subscription.ts:76 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) REDACTED:304— REDACTED:304 · REDACTED:391 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) REDACTED:168— REDACTED:168 · REDACTED:206 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) REDACTED:221— REDACTED:221 · gateway/src/routes/subscription.ts:109 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
RuleEngine.extractValueByJsoupDefault (cyclomatic 17) Modules/Core/RuleEngine/RuleEngine.swift:570— RuleEngine.extractValueByJsoupDefault 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. This shape REPEATS in the file: one other method here (RuleEngine.extractValueByJsoupDefault) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RuleEngine.extractValueByJsoupDefault (cyclomatic 17) Modules/Core/RuleEngine/RuleEngine.swift:612— RuleEngine.extractValueByJsoupDefault 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. This shape REPEATS in the file: one other method here (RuleEngine.extractValueByJsoupDefault) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TodoComment Tests/iOS/yuedu appTests/LegadoAlignmentTests.swift:218— // TODO: Replace with HTML from a real Legado book source + verified output. — 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 Modules/Features/Reader/ReaderOrientationController.swift:43— // TODO: Modernization - A fixed-layout book's 方向 is forced here through the app-wide mask — 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.
RuleEngine.extractValueByJsoupDefault (cognitive 17) Modules/Core/RuleEngine/RuleEngine.swift:570— RuleEngine.extractValueByJsoupDefault has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 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. This shape REPEATS in the file: one other method here (RuleEngine.extractValueByJsoupDefault) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RuleEngine.extractValueByJsoupDefault (cognitive 17) Modules/Core/RuleEngine/RuleEngine.swift:612— RuleEngine.extractValueByJsoupDefault has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 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. This shape REPEATS in the file: one other method here (RuleEngine.extractValueByJsoupDefault) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
AtomXMLParserDelegate.parser (cognitive 17) Modules/Services/RSS/RSSFetcher.swift:512— AtomXMLParserDelegate.parser has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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.
AtomXMLParserDelegate.parser (cognitive 17) Modules/Services/RSS/RSSFetcher.swift:567— AtomXMLParserDelegate.parser has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
RuleModuleValidator.validate (cognitive 16) Modules/Services/RuleModules/RuleModuleValidator.swift:518— RuleModuleValidator.validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 3, ternaries 2 (3 pts), loops 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.
RuleModuleValidator.validate (cognitive 16) Modules/Services/RuleModules/RuleModuleValidator.swift:557— RuleModuleValidator.validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 3, loops 2, ternaries 1. Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
Change-coupling hub: ReaderView.swift → CoreTextScrollEngine.swift, TXTLazyAttributedStringBuilder.swift, TXTPageEngine.swift, ReadingPositionStore.swift, CoreTextCollectionScrollViewController.swift, ReaderViewModifiers.swift Modules/Features/Reader/ReaderView.swift— `Modules/Features/Reader/ReaderView.swift` changes together with 6 other files — `Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift`, `Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift`, `Modules/Core/ReaderCore/CoreText/TXTPageEngine.swift`, `Modules/Core/ReaderCore/ReadingPositionStore.swift`, `Modules/Features/Reader/CoreTextCollectionScrollViewController.swift`, `Modules/Features/Reader/ReaderViewModifiers.swift` — none of which declares a dependency on it: one file is the hub of 6 separate couplings, not 6 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 6.
Change-coupling hub: ReaderViewModifiers.swift → CoreTextScrollEngine.swift, ReaderView+PageBuilding.swift, ReaderView+TXTVerticalScroll.swift Modules/Features/Reader/ReaderViewModifiers.swift— `Modules/Features/Reader/ReaderViewModifiers.swift` changes together with 3 other files — `Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift`, `Modules/Features/Reader/ReaderView+PageBuilding.swift`, `Modules/Features/Reader/ReaderView+TXTVerticalScroll.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.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) Modules/Services/RuleModules/ModuleSearch.swift:45— Modules/Services/RuleModules/ModuleSearch.swift:45-75 | Modules/Services/Works/LibrarySearch.swift:96-128 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:174— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:174-210 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:212-242 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×2
Edited copy of a member (30 corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:683— Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:683-712 | Modules/Core/ReaderCore/CoreText/RegexHighlightDecorationRenderer.swift:599-631 — These two members are one piece of code written twice and then edited apart: 30 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.
Edited copy of a member (30 corresponding lines) Modules/Services/Online/BookSourceSearchFanOut.swift:111— Modules/Services/Online/BookSourceSearchFanOut.swift:111-143 | Modules/Services/Online/BookSourceSearchFanOut.swift:146-175 — These two members are one piece of code written twice and then edited apart: 30 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 (35 corresponding lines) · ×2
Edited copy of a member (35 corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:814— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:814-848 | Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:884-918 — These two members are one piece of code written twice and then edited apart: 35 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.
Edited copy of a member (35 corresponding lines) Modules/Features/Explore/Home/HomeArticleCards.swift:233— Modules/Features/Explore/Home/HomeArticleCards.swift:233-267 | Modules/Features/Explore/Home/HomeSectionCards.swift:935-969 — These two members are one piece of code written twice and then edited apart: 35 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 (38 corresponding lines) · ×2
Edited copy of a member (38 corresponding lines) Modules/Features/BookDetail/AudiobookDetailView.swift:681— Modules/Features/BookDetail/AudiobookDetailView.swift:681-724 | Modules/Features/BookDetail/VideoDetailView.swift:748-785 — These two members are one piece of code written twice and then edited apart: 38 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.
Edited copy of a member (38 corresponding lines) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:950— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:950-987 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1349-1391 — These two members are one piece of code written twice and then edited apart: 38 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 (34 corresponding lines) · ×2
Edited copy of a member (34 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1002— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1002-1036 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:397-430 — These two members are one piece of code written twice and then edited apart: 34 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.
Edited copy of a member (34 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:434— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:434-467 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:472-510 — These two members are one piece of code written twice and then edited apart: 34 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 (33 corresponding lines) · ×2
Edited copy of a member (33 corresponding lines) Modules/Core/TTS/AudiobookPlayer.swift:1584— Modules/Core/TTS/AudiobookPlayer.swift:1584-1616 | Modules/Core/TTS/TTSCoordinator.swift:1244-1282 — These two members are one piece of code written twice and then edited apart: 33 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.
Edited copy of a member (33 corresponding lines) Modules/Features/RSS/RSSListView.swift:1652— Modules/Features/RSS/RSSListView.swift:1652-1684 | Modules/Features/RSS/RSSListView.swift:1705-1740 — These two members are one piece of code written twice and then edited apart: 33 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 (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2046— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2046-2084 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2086-2117 — These two members are one piece of code written twice and then edited apart: 32 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.
Edited copy of a member (32 corresponding lines) Modules/Core/EPUB/PublicationSession.swift:1173— Modules/Core/EPUB/PublicationSession.swift:1173-1204 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:273-304 — These two members are one piece of code written twice and then edited apart: 32 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 copies of one member (3 members, 16+ corresponding lines) · ×2
Edited copies of one member (3 members, 16+ corresponding lines) Modules/Core/EPUB/PublicationSession.swift:1809— Modules/Core/EPUB/PublicationSession.swift:1809-1824 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:309-327 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:335-353 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) Modules/Features/Explore/Home/HomeArticleCards.swift:78— Modules/Features/Explore/Home/HomeArticleCards.swift:78-93 | Modules/Features/Explore/Home/HomeSectionCards.swift:291-306 | Modules/Features/Explore/Home/HomeSectionCards.swift:439-454 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) Modules/Core/EPUB/EPUBMediaOverlay.swift:101— Modules/Core/EPUB/EPUBMediaOverlay.swift:101-114 | Modules/Core/EPUB/EPUBMediaOverlay.swift:129-141 | Modules/Core/EPUB/PublicationSession.swift:1710-1724 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) Modules/Services/RuleModules/ModuleWorkDetail.swift:152— Modules/Services/RuleModules/ModuleWorkDetail.swift:152-164 | Modules/Services/RuleModules/ModuleWorkDetail.swift:182-194 | Modules/Services/Works/WorkReviews.swift:134-146 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×2
Edited copies of one member (3 members, 11+ corresponding lines) Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:240— Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:240-255 | Modules/Core/ReaderCore/Translation/ReaderTranslationLayout.swift:464-474 | Modules/Core/ReaderCore/Translation/ReaderTranslationLayout.swift:476-486 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) Modules/Features/Reader/ReaderViewModel.swift:381— Modules/Features/Reader/ReaderViewModel.swift:381-393 | Modules/Features/Reader/ReaderViewModel.swift:396-408 | Modules/Features/Reader/ReaderViewModel.swift:412-422 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×2
Edited copies of one member (3 members, 9+ corresponding lines) Modules/Core/Video/VideoLinkPositions.swift:33— Modules/Core/Video/VideoLinkPositions.swift:33-41 | Targets/Yuedu/SharedApp/AppearanceThemeReadingApplier.swift:203-213 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3229-3237 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 9+ corresponding lines) Targets/Yuedu/SharedApp/GlobalSettings.swift:3079— Targets/Yuedu/SharedApp/GlobalSettings.swift:3079-3087 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3097-3105 | Targets/Yuedu/SharedApp/GlobalSettings.swift:3471-3479 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×2
Edited copies of one member (3 members, 6+ corresponding lines) Modules/Features/Reader/ChapterTitleInspectorView.swift:662— Modules/Features/Reader/ChapterTitleInspectorView.swift:662-667 | Modules/Features/Reader/ReaderDialogueBubbleSettingsView.swift:430-441 | Modules/Features/Reader/RegexHighlightRuleEditorView.swift:824-829 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) scripts/narou_reading_fixture.py:64— scripts/narou_reading_fixture.py:64-69 | scripts/reader_chrome_fixture.py:62-67 | scripts/search_paging_fixture.py:63-68 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (35 lines × 2) Modules/Features/RSS/RSSFeedView.swift:71— Modules/Features/RSS/RSSFeedView.swift:71-105 | Modules/Features/RSS/RSSFeedView.swift:292-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSFeedView.swift:71` 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 (35 lines × 2) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:245— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:245-279 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:356-390 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Reader/ReaderCommentCardSettingsView.swift:245` 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 `header` to `Text(localized("預覽")).foregroundStyle(DSColor.textSecondary)` in one and `Text(localized("SVG / TXT")).foregroundStyle(DSColor.textSecondary)` 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 (23 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:445— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:445-467 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:488-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:445` 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 (23 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1572— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1572-1594 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1644-1666 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:39— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:39-60 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:31-52 — before extracting anything, compare `Modules/Features/Reader/ReaderCommentCardSettingsView.swift` and `Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 116 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 `Modules/Features/Reader/ReaderCommentCardSettingsView.swift:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) Modules/Services/LibraryStore/BookStore.swift:514— Modules/Services/LibraryStore/BookStore.swift:514-535 | Modules/Services/LibraryStore/BookStore.swift:585-606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/LibraryStore/BookStore.swift:514` it does not close everything it opens, so those exact lines 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–21 lines × 2) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1931— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1931-1951 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1989-2007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1931` 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 (19–21 lines × 2) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2814— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2814-2832 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2867-2887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2867` 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 (19–20 lines × 2) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:818— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:818-836 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:870-889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:818` it does not close everything it opens, so those 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 (19–20 lines × 2) Modules/Features/Settings/ICloudSyncView.swift:100— Modules/Features/Settings/ICloudSyncView.swift:100-119 | Modules/Features/Settings/WebDAVSyncView.swift:117-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:878— Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:878-896 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2815-2833 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:878` it does not close everything it opens, so those 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) Modules/Features/BookDetail/AudiobookDetailView.swift:329— Modules/Features/BookDetail/AudiobookDetailView.swift:329-347 | Modules/Features/BookDetail/OnlineBookView.swift:365-383 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:329` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) Modules/Core/TTS/TTSAudioProvider.swift:803— Modules/Core/TTS/TTSAudioProvider.swift:803-819 | Modules/Core/TTS/TTSLoginScript.swift:117-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (16–17 lines × 2) Modules/Features/BookSource/BookSourceListView.swift:751— Modules/Features/BookSource/BookSourceListView.swift:751-767 | Modules/Features/Settings/TTSSettingsView.swift:510-525 — 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 `Modules/Features/BookSource/BookSourceListView.swift:751` 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, `Modules/Features/Settings/TTSSettingsView.swift:509` calls `disabled` and `Modules/Features/BookSource/BookSourceListView.swift:750` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14–15 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:681— Modules/Features/BookDetail/AudiobookDetailView.swift:681-695 | Modules/Features/BookDetail/VideoDetailView.swift:748-761 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookDetail/AudiobookDetailView.swift:681` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) Modules/Services/Subscription/SubscriptionICloudMirror.swift:195— Modules/Services/Subscription/SubscriptionICloudMirror.swift:195-209 | Modules/Services/iCloud/ICloudSyncManager.swift:1866-1879 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) Modules/Features/Bookshelf/HomeView.swift:2432— Modules/Features/Bookshelf/HomeView.swift:2432-2445 | Modules/Features/Bookshelf/HomeView.swift:2508-2520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Bookshelf/HomeView.swift:2432` 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–14 lines × 2) Targets/Yuedu/SharedApp/AppDependencies.swift:127— Targets/Yuedu/SharedApp/AppDependencies.swift:127-140 | Targets/Yuedu/SharedApp/AppDependencies.swift:302-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Targets/Yuedu/SharedApp/AppDependencies.swift:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–14 lines × 2) Modules/Features/Reader/ReaderSettingsView.swift:107— Modules/Features/Reader/ReaderSettingsView.swift:107-120 | Modules/Features/Reader/TTS/AudiobookView.swift:1186-1195 — 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 `Modules/Features/Reader/ReaderSettingsView.swift:107` 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 (10–14 lines × 2) Modules/Features/Reader/ReaderView+Logic.swift:412— Modules/Features/Reader/ReaderView+Logic.swift:412-425 | Modules/Features/Reader/ReaderView+Logic.swift:433-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderView+Logic.swift:412` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The 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–9 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:217— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:217-224 | Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:263-271 — both copies are in the same file, so extract the 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 (8–9 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:585— Modules/Features/BookDetail/AudiobookDetailView.swift:585-593 | Modules/Features/BookDetail/VideoDetailView.swift:720-727 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:585` it does not close everything it opens, so those 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 (4–8 lines × 3) Modules/Core/RuleEngine/NextPageLinkExtractor.swift:19— Modules/Core/RuleEngine/NextPageLinkExtractor.swift:19-26 | Modules/Core/RuleEngine/NextPageLinkExtractor.swift:33-40 | Modules/Core/RuleEngine/NextPageLinkExtractor.swift:53-56 — 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 `Modules/Core/RuleEngine/NextPageLinkExtractor.swift:53` it does not close everything it opens, so those 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 (4–8 lines × 3) Modules/Core/RuleEngine/RuleEngine.swift:571— Modules/Core/RuleEngine/RuleEngine.swift:571-578 | Modules/Core/RuleEngine/RuleEngine.swift:613-616 | Modules/Core/RuleEngine/RuleEngine.swift:1332-1339 — 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 that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 4) Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20— Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20-25 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:479-491 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:659-671 | Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift:162-174 — there are 4 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 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 `Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:20` 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 × 4) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:736— Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:736-741 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:756-761 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:782-787 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:806-811 — 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 `Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:736` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2 locations) REDACTED:818— REDACTED:818 · REDACTED:974 — both copies are in the same file, so extract the 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 (15 lines × 2 locations) gateway/src/routes/account.ts:10— gateway/src/routes/account.ts:10 · REDACTED:103 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) gateway/src/identityToolkit.ts:128— gateway/src/identityToolkit.ts:128 · gateway/src/identityToolkit.ts:142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2 locations) gateway/src/policy.ts:180— gateway/src/policy.ts:180 · gateway/src/policy.ts:198 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 4 locations) REDACTED:35— REDACTED:35 · REDACTED:47 · REDACTED:59 · REDACTED:70 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 4 locations) REDACTED:101— REDACTED:101 · REDACTED:134 · REDACTED:147 · REDACTED:224 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (5 lines × 2 locations) functions/src/triage.ts:101— functions/src/triage.ts:101 · functions/src/triage.ts: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.
Duplicated block (5 lines × 2 locations) gateway/src/feedbackPolicy.ts:312— gateway/src/feedbackPolicy.ts:312 · gateway/src/routes/profile.ts:69 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
ReaderView.buildBody (cyclomatic 127) Modules/Features/Reader/ReaderView.swift:1885— ReaderView.buildBody has cyclomatic complexity 127 (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.
_grabArticle (cyclomatic 118) Resources/Assets/Readability.js:1021— _grabArticle has cyclomatic complexity 118 (threshold 15). Of this number, 106 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTMLAttributedStringBuilder.apply (cyclomatic 105) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1761— HTMLAttributedStringBuilder.apply has cyclomatic complexity 105 (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.
HTMLTableRasterizer.renderPages (cyclomatic 92) Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:461— HTMLTableRasterizer.renderPages has cyclomatic complexity 92 (threshold 15). Of this number, 57 points are the body's own statements and 35 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AIAgenticAssistant.answerQuestion (cyclomatic 83) Modules/Core/AI/AIAgenticAssistant+Question.swift:30— AIAgenticAssistant.answerQuestion has cyclomatic complexity 83 (threshold 15). Of this number, 59 points are the body's own statements and 24 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReaderStyleCSSCodec.apply (cyclomatic 77) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:422— ReaderStyleCSSCodec.apply has cyclomatic complexity 77 (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.
LegadoRhinoNormalizer.normalize (cyclomatic 69) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:40— LegadoRhinoNormalizer.normalize has cyclomatic complexity 69 (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.
RuleModuleValidator.validateFields (cyclomatic 67) Modules/Services/RuleModules/RuleModuleValidator.swift:69— RuleModuleValidator.validateFields has cyclomatic complexity 67 (threshold 15). Of this number, 66 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoreTextPaginator.computeLayout (cyclomatic 62) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1055— CoreTextPaginator.computeLayout has cyclomatic complexity 62 (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.
NodeAttributedStringRenderer.render (cyclomatic 58) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:417— NodeAttributedStringRenderer.render has cyclomatic complexity 58 (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.
StatementReader.readStatement (cyclomatic 56) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:324— StatementReader.readStatement 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.
NodeAttributedStringRenderer.renderBlock (cyclomatic 55) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:717— NodeAttributedStringRenderer.renderBlock 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.
ModernParserBridge.wireJSEngine (cyclomatic 54) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:420— ModernParserBridge.wireJSEngine has cyclomatic complexity 54 (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.
ReaderViewportFragmentHost.update (cyclomatic 52) Modules/Features/Reader/ReaderViewportFragmentHost.swift:160— ReaderViewportFragmentHost.update has cyclomatic complexity 52 (threshold 15). Of this number, 45 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ElementNode.asRenderableNode (cyclomatic 51) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:181— ElementNode.asRenderableNode has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ruleEngine.routeExtractValue (cyclomatic 50) REDACTED:970— ruleEngine.routeExtractValue has cyclomatic complexity 50 (threshold 15). Of this number, 47 points are the body's own statements and 3 belong to one function literal 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.
RuleModuleValidator.validate (cyclomatic 49) Modules/Services/RuleModules/RuleModuleValidator.swift:367— RuleModuleValidator.validate has cyclomatic complexity 49 (threshold 15). Of this number, 48 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChapterFetchManager.fetchChapter (cyclomatic 48) Modules/Services/Online/OnlineReadingPipeline.swift:319— ChapterFetchManager.fetchChapter has cyclomatic complexity 48 (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.
NodeAttributedStringRenderer.applyBlockStyle (cyclomatic 46) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1071— NodeAttributedStringRenderer.applyBlockStyle has cyclomatic complexity 46 (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.
HTMLSourceValidator.validate (cyclomatic 46) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:640— HTMLSourceValidator.validate has cyclomatic complexity 46 (threshold 15). Of this number, 40 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LegadoRhinoNormalizer.lex (cyclomatic 45) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:387— LegadoRhinoNormalizer.lex has cyclomatic complexity 45 (threshold 15). Of this number, 33 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReaderStyleCSSCodec.decodeChapterLayerDeclarations (cyclomatic 43) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:267— ReaderStyleCSSCodec.decodeChapterLayerDeclarations 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.
CommentBubbleSVGRecognizer.parseSVG (cyclomatic 42) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:689— CommentBubbleSVGRecognizer.parseSVG 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.
HTMLAttributedStringBuilder.resolvedStyle (cyclomatic 42) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1296— HTMLAttributedStringBuilder.resolvedStyle 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.
RSSXMLParserDelegate.handleArticleElementEnd (cyclomatic 40) Modules/Services/RSS/RSSFetcher.swift:335— RSSXMLParserDelegate.handleArticleElementEnd has cyclomatic complexity 40 (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.
SVGPathParser.execute (cyclomatic 40) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1613— SVGPathParser.execute has cyclomatic complexity 40 (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.
CoreTextScrollEngine.loadChapter (cyclomatic 40) Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:551— CoreTextScrollEngine.loadChapter has cyclomatic complexity 40 (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.
HighlightPackImporter.parseQiReader (cyclomatic 40) Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:174— HighlightPackImporter.parseQiReader has cyclomatic complexity 40 (threshold 15). Of this number, 22 points are the body's own statements and 18 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReaderTranslationLayout.splice (cyclomatic 38) Modules/Core/ReaderCore/Translation/ReaderTranslationLayout.swift:142— ReaderTranslationLayout.splice has cyclomatic complexity 38 (threshold 15). Of this number, 31 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LegadoRhinoNormalizer.letReadsItsOwnName (cyclomatic 37) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:278— LegadoRhinoNormalizer.letReadsItsOwnName has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AnalyzeUrl.normalizeLegadoOptionJSON (cyclomatic 37) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:938— AnalyzeUrl.normalizeLegadoOptionJSON has cyclomatic complexity 37 (threshold 15). Of this number, 31 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
ruleEngine.parseSearchResultsJSON (cyclomatic 37) REDACTED:1101— ruleEngine.parseSearchResultsJSON 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.
CoreTextPaginator.extractImages (cyclomatic 36) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2554— CoreTextPaginator.extractImages has cyclomatic complexity 36 (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.
ReaderStyleCSSCodec.canonicalDeclarations (cyclomatic 36) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:575— ReaderStyleCSSCodec.canonicalDeclarations has cyclomatic complexity 36 (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.
errors.mapIdentityToolkitError (cyclomatic 36) gateway/src/errors.ts:96— errors.mapIdentityToolkitError has cyclomatic complexity 36 (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.
_getJSONLD (cyclomatic 36) Resources/Assets/Readability.js:1638— _getJSONLD has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 2 of the 36 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 1643, 1657, 1681, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CoreTextPageEngineView.updateUIViewController (cyclomatic 35) Modules/Features/Reader/CoreTextPagedView.swift:201— CoreTextPageEngineView.updateUIViewController has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JSONPathEvaluator.apply (cyclomatic 35) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:216— JSONPathEvaluator.apply has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HTMLParser.swift.matches (cyclomatic 35) Modules/Core/RuleEngine/HTMLParser.swift:290— HTMLParser.swift.matches has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_getArticleMetadata (cyclomatic 35) Resources/Assets/Readability.js:1763— _getArticleMetadata has cyclomatic complexity 35 (threshold 15). Of this number, 28 points are the body's own statements and 7 belong to one function literal inside it that branches. 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.
ChapterContentCleaner.cleanChapterContent (cyclomatic 34) Modules/Core/RuleEngine/ChapterContentCleaner.swift:4— ChapterContentCleaner.cleanChapterContent 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.
OnlineBookView.loadTOC (cyclomatic 34) Modules/Features/BookDetail/OnlineBookView.swift:761— OnlineBookView.loadTOC 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.
AIBookSummaryService.run (cyclomatic 34) Modules/Services/AI/AIBookSummaryService.swift:120— AIBookSummaryService.run has cyclomatic complexity 34 (threshold 15). Of this number, 23 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OPDSFeedParserDelegate.parser (cyclomatic 34) Modules/Services/OPDS/OPDSClient.swift:378— OPDSFeedParserDelegate.parser 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.
JsoupDefaultExtractor.parseSingleRule (cyclomatic 34) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:499— JsoupDefaultExtractor.parseSingleRule 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.
RemoteLibraryResourceClient.loadRequest (cyclomatic 33) Modules/Services/RemoteLibrary/RemoteLibraryCache.swift:76— RemoteLibraryResourceClient.loadRequest 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.
BrowserTextInteractionController.editMenuInteraction (cyclomatic 33) Modules/Core/ReaderCore/BrowserLayout/BrowserTextInteractionController.swift:211— BrowserTextInteractionController.editMenuInteraction has cyclomatic complexity 33 (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.
JsoupDefaultExtractor.applyIndexFilter (cyclomatic 33) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:280— JsoupDefaultExtractor.applyIndexFilter has cyclomatic complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 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.
Lexer.lex (cyclomatic 33) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:140— Lexer.lex 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.
ruleEngine.extractValueFromObject (cyclomatic 33) REDACTED:811— ruleEngine.extractValueFromObject 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.
BookSourceFetcher.fetchChapterPackageInner (cyclomatic 32) Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:52— BookSourceFetcher.fetchChapterPackageInner has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 belong to one function item inside it that branches. 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.
RuleEngine.extractValueList (cyclomatic 32) Modules/Core/RuleEngine/RuleEngine.swift:798— RuleEngine.extractValueList 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.
OPDSFeedParserDelegate.handleLink (cyclomatic 32) Modules/Services/OPDS/OPDSClient.swift:419— OPDSFeedParserDelegate.handleLink 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.
TTSAudioPayload.looksLikeAudioContainer (cyclomatic 31) Modules/Core/TTS/TTSAudioProvider.swift:256— TTSAudioPayload.looksLikeAudioContainer has cyclomatic complexity 31 (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.
Coordinator.handleCoverPan (cyclomatic 31) Modules/Features/Reader/CoreTextPagedView.swift:2595— Coordinator.handleCoverPan 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.
ChapterFetcher.looksLikeRejectedChapterPage (cyclomatic 31) Modules/Services/Online/ChapterFetcher.swift:888— ChapterFetcher.looksLikeRejectedChapterPage has cyclomatic complexity 31 (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.
RelatedWorks.pick (cyclomatic 31) Modules/Services/Works/RelatedWorks.swift:22— RelatedWorks.pick has cyclomatic complexity 31 (threshold 15). Of this number, 20 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ICloudSyncManager.performSyncPass (cyclomatic 31) Modules/Services/iCloud/ICloudSyncManager.swift:414— ICloudSyncManager.performSyncPass 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.
CommentBubbleSVGRecognizer.draw (cyclomatic 31) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1255— CommentBubbleSVGRecognizer.draw 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.
CoreTextPaginator.extractFrameBlockRenderables (cyclomatic 31) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2879— CoreTextPaginator.extractFrameBlockRenderables has cyclomatic complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 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.
AIMemoryExtraction.validate (cyclomatic 30) Modules/Core/AI/AICharacterMemoryExtraction.swift:128— AIMemoryExtraction.validate has cyclomatic complexity 30 (threshold 15). Of this number, 23 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.
MOBIMarkupNormalizer.normalizeElement (cyclomatic 30) Modules/Core/MOBI/MOBIMarkupNormalizer.swift:50— MOBIMarkupNormalizer.normalizeElement 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.
TXTChapterParser.detectMappedTitleMatches (cyclomatic 30) Modules/Core/TXT/TXTChapterParser.swift:538— TXTChapterParser.detectMappedTitleMatches has cyclomatic complexity 30 (threshold 15). Of this number, 25 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AICharacterMemoryService.execute (cyclomatic 30) Modules/Services/AI/AICharacterMemoryService.swift:134— AICharacterMemoryService.execute 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.
LegadoSymmetricCipher.commonCrypto (cyclomatic 30) Modules/Core/RuleEngine/ModernParser/JS/LegadoSymmetricCipher.swift:133— LegadoSymmetricCipher.commonCrypto has cyclomatic complexity 30 (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.
NextPageLinkExtractor.extractNextPageURL (cyclomatic 29) Modules/Core/RuleEngine/NextPageLinkExtractor.swift:4— NextPageLinkExtractor.extractNextPageURL 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.
RuleEngine.jsonGet (cyclomatic 29) Modules/Core/RuleEngine/RuleEngine.swift:1496— RuleEngine.jsonGet 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.
TXTReaderIndexMigrationService.complete (cyclomatic 29) Modules/Core/TXT/TXTReaderIndexMigrationService.swift:34— TXTReaderIndexMigrationService.complete has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RSSXMLParser.parser (cyclomatic 29) Modules/Services/RSS/RSSFetcher.swift:1365— RSSXMLParser.parser 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.
GlobalSettings.init (cyclomatic 29) Targets/Yuedu/SharedApp/GlobalSettings.swift:2121— GlobalSettings.init has cyclomatic complexity 29 (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.
GlobalSettings.writeAppearanceExtras (cyclomatic 29) Targets/Yuedu/SharedApp/AppearanceThemeExtrasApplier.swift:187— GlobalSettings.writeAppearanceExtras has cyclomatic complexity 29 (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.
QiThemeImporter.applyAppearance (cyclomatic 29) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:203— QiThemeImporter.applyAppearance 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.
JSONPathEvaluator.resolveFilterPath (cyclomatic 29) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:470— JSONPathEvaluator.resolveFilterPath 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.
ruleEngine.routeExtractList (cyclomatic 29) REDACTED:911— ruleEngine.routeExtractList 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.
OnlineBookContentInference.kind (cyclomatic 28) Modules/Core/BookSource/BookSource.swift:674— OnlineBookContentInference.kind has cyclomatic complexity 28 (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.
MOBI6Converter.convert (cyclomatic 28) Modules/Core/MOBI/MOBI6Converter.swift:37— MOBI6Converter.convert has cyclomatic complexity 28 (threshold 15). Of this number, 21 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuleEngine.parseJsoupSegment (cyclomatic 28) Modules/Core/RuleEngine/RuleEngine.swift:331— RuleEngine.parseJsoupSegment has cyclomatic complexity 28 (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.
WorkDetailView.workPage (cyclomatic 28) Modules/Features/BookDetail/WorkDetailView.swift:292— WorkDetailView.workPage has cyclomatic complexity 28 (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.
ReaderRenderSettings.refreshIntent (cyclomatic 28) Modules/Core/ReaderCore/ReaderRenderRefresh.swift:147— ReaderRenderSettings.refreshIntent has cyclomatic complexity 28 (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.
CoreTextFontRegistrationService.registerUncached (cyclomatic 28) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:69— CoreTextFontRegistrationService.registerUncached has cyclomatic complexity 28 (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.
ChapterTitleHTMLCodec.parseCanonical (cyclomatic 28) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:183— ChapterTitleHTMLCodec.parseCanonical has cyclomatic complexity 28 (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.
QiThemeImporter.chapterTitleStyle (cyclomatic 28) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:796— QiThemeImporter.chapterTitleStyle has cyclomatic complexity 28 (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.
HTMLParser.swift.parseSingleSelector (cyclomatic 28) Modules/Core/RuleEngine/HTMLParser.swift:114— HTMLParser.swift.parseSingleSelector has cyclomatic complexity 28 (threshold 15). Of this number, 23 points are the body's own statements and 5 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.
BookSourceHealthChecker.runStages (cyclomatic 27) Modules/Core/BookSource/BookSourceHealthChecker.swift:1046— BookSourceHealthChecker.runStages 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.
RuleEngine.routeExtractList (cyclomatic 27) Modules/Core/RuleEngine/RuleEngine.swift:91— RuleEngine.routeExtractList 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.
CustomHTTPProvider.evaluateArithmetic (cyclomatic 27) Modules/Core/TTS/TTSAudioProvider.swift:1121— CustomHTTPProvider.evaluateArithmetic has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Multibyte.character (cyclomatic 27) Modules/Core/TXT/TXTEncodingDetector.swift:39— Multibyte.character has cyclomatic complexity 27 (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.
AudiobookDetailView.body (cyclomatic 27) Modules/Features/BookDetail/AudiobookDetailView.swift:233— AudiobookDetailView.body has cyclomatic complexity 27 (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.
CalibreWirelessService.handle (cyclomatic 27) Modules/Services/Calibre/CalibreWirelessService.swift:200— CalibreWirelessService.handle has cyclomatic complexity 27 (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.
RSSFeedDiscovery.feedURLs (cyclomatic 27) Modules/Services/RSS/RSSUtilities.swift:30— RSSFeedDiscovery.feedURLs 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.
NextInSeries.pick (cyclomatic 27) Modules/Services/Works/NextInSeries.swift:23— NextInSeries.pick has cyclomatic complexity 27 (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.
CoreTextPageEngine.preloadChapterInternal (cyclomatic 27) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1150— CoreTextPageEngine.preloadChapterInternal 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.
RuleAnalyzer.splitRule (cyclomatic 27) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:60— RuleAnalyzer.splitRule 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.
WebDAVProvider.fixedHTTPDate (cyclomatic 27) Modules/Services/Works/HomeSectionProviding.swift:277— WebDAVProvider.fixedHTTPDate has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
StatementReader.skipExpression (cyclomatic 27) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:546— StatementReader.skipExpression 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.
HTMLParser.swift.parseTagAttributes (cyclomatic 27) Modules/Core/RuleEngine/HTMLParser.swift:439— HTMLParser.swift.parseTagAttributes has cyclomatic complexity 27 (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.
AIBookSummaryPlanner.plan (cyclomatic 26) Modules/Core/AI/AIBookSummary.swift:150— AIBookSummaryPlanner.plan 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.
BookSourceFetcher.searchOutcome (cyclomatic 26) Modules/Core/BookSource/BookSourceFetcher+Search.swift:151— BookSourceFetcher.searchOutcome 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.
OnlineBookView.body (cyclomatic 26) Modules/Features/BookDetail/OnlineBookView.swift:261— OnlineBookView.body 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.
BookReaderContent.body (cyclomatic 26) Modules/Features/Reader/BookReaderView.swift:73— BookReaderContent.body 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.
LegadoSourceJSONParser.exportJSON (cyclomatic 26) Modules/Services/RSS/LegadoSourceJSONParser.swift:84— LegadoSourceJSONParser.exportJSON 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.
ReviewCardSVGMetrics.rewrittenTag (cyclomatic 26) Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:172— ReviewCardSVGMetrics.rewrittenTag 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.
ruleEngine.applyJsonToken (cyclomatic 26) REDACTED:728— ruleEngine.applyJsonToken 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.
SharedImportPayloadClassifier.classify (cyclomatic 25) Modules/Core/BookSource/SharedImportQueueDrainer.swift:714— SharedImportPayloadClassifier.classify has cyclomatic complexity 25 (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.
KF8Converter.convert (cyclomatic 25) Modules/Core/MOBI/KF8Converter.swift:52— KF8Converter.convert has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 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.
AIReadingConversation.send (cyclomatic 25) Modules/Services/AI/AIReadingConversation.swift:77— AIReadingConversation.send has cyclomatic complexity 25 (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.
BookStore.commitRefreshedList (cyclomatic 25) Modules/Services/LibraryStore/BookStore.swift:2578— BookStore.commitRefreshedList has cyclomatic complexity 25 (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.
HomeSection.displayTitle (cyclomatic 25) Modules/Features/Explore/Home/HomeRowView.swift:12— HomeSection.displayTitle has cyclomatic complexity 25 (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.
WorkIndex.build (cyclomatic 25) Modules/Services/Works/WorkIndex.swift:184— WorkIndex.build has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
RootTabBarTransitionCover.pageWillChange (cyclomatic 25) Modules/SharedUI/Adaptive/RootTabBarTransitionCover.swift:53— RootTabBarTransitionCover.pageWillChange has cyclomatic complexity 25 (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.
AppearanceThemeExtras.isEmpty (cyclomatic 25) Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:246— AppearanceThemeExtras.isEmpty has cyclomatic complexity 25 (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.
AnalyzeUrl.parseOptions (cyclomatic 25) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:550— AnalyzeUrl.parseOptions has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_cleanConditionally::(anonymous)::shouldRemoveNode (cyclomatic 25) Resources/Assets/Readability.js:2561— _cleanConditionally::(anonymous)::shouldRemoveNode has cyclomatic complexity 25 (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.
RuleEngine.parseXPathSteps (cyclomatic 24) Modules/Core/RuleEngine/RuleEngine.swift:1079— RuleEngine.parseXPathSteps 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.
AozoraMarkupParser.parse (cyclomatic 24) Modules/Core/TXT/AozoraMarkupParser.swift:68— AozoraMarkupParser.parse has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Mapper.entry (cyclomatic 24) Modules/Services/OPDS/OPDS2FeedParser.swift:137— Mapper.entry 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.
CalibreProgressService.process (cyclomatic 24) Modules/Services/RemoteLibrary/CalibreProgressService.swift:123— CalibreProgressService.process 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.
RemoteLibraryHTTPClient.stream (cyclomatic 24) Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:151— RemoteLibraryHTTPClient.stream 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.
RemoteLibraryService.prepare (cyclomatic 24) Modules/Services/RemoteLibrary/RemoteLibraryService.swift:179— RemoteLibraryService.prepare 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.
BrowserLayoutPageEngine.preloadChapter (cyclomatic 24) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:602— BrowserLayoutPageEngine.preloadChapter 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.
BrowserLayoutPageEngine.layoutBrowserChapter (cyclomatic 24) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:811— BrowserLayoutPageEngine.layoutBrowserChapter 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.
OnlineProviderAttributedStringBuilder.chapterFormatProbe (cyclomatic 24) Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:869— OnlineProviderAttributedStringBuilder.chapterFormatProbe has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 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.
DialogueBubbleScriptImporter.configLiteral (cyclomatic 24) Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:169— DialogueBubbleScriptImporter.configLiteral 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.
auth.authRouter (cyclomatic 24) REDACTED:25— auth.authRouter has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 160, 188, 92, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_fixLazyImages (cyclomatic 24) Resources/Assets/Readability.js:2338— _fixLazyImages has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 2341). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
AIReadingEvidence.requestedChapters (cyclomatic 23) Modules/Core/AI/AIReadingEvidence.swift:53— AIReadingEvidence.requestedChapters 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.
CalibreCFIMapper.match (cyclomatic 23) Modules/Core/EPUB/CalibreCFIMapper.swift:36— CalibreCFIMapper.match has cyclomatic complexity 23 (threshold 15). Of this number, 16 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.
CustomizationImportOverview.appearanceItems (cyclomatic 23) Modules/Features/Settings/CustomizationImportOverview.swift:332— CustomizationImportOverview.appearanceItems has cyclomatic complexity 23 (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.
BookStore.importEpub (cyclomatic 23) Modules/Services/LibraryStore/BookStore.swift:766— BookStore.importEpub has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 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.
WebDAVPropfindParserDelegate.parser (cyclomatic 23) Modules/Services/WebDAV/WebDAVBrowseClient.swift:119— WebDAVPropfindParserDelegate.parser 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.
LanguageTag.init (cyclomatic 23) Modules/Services/Works/WorkMatchKey.swift:160— LanguageTag.init has cyclomatic complexity 23 (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.
EPUBStylesheetIngestion.collect (cyclomatic 23) Modules/Core/ReaderCore/BrowserLayout/EPUBStylesheetIngestion.swift:9— EPUBStylesheetIngestion.collect has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoreTextPageView.handleTap (cyclomatic 23) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1474— CoreTextPageView.handleTap 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.
NodeAttributedStringRenderer.applyInlineStyle (cyclomatic 23) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1254— NodeAttributedStringRenderer.applyInlineStyle has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
XPathExtractor.splitXPathAndAccessor (cyclomatic 23) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:413— XPathExtractor.splitXPathAndAccessor 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.
LegadoBase64.androidDecode (cyclomatic 23) Modules/Core/RuleEngine/ModernParser/JS/LegadoBase64.swift:36— LegadoBase64.androidDecode 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.
ruleEngine.parseTOCJSON (cyclomatic 23) REDACTED:1221— ruleEngine.parseTOCJSON has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1227, 1242). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
legado-engine.queryElements (cyclomatic 23) REDACTED:90— legado-engine.queryElements 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.
BookSourceDebugEngine.debugEntry (cyclomatic 22) Modules/Core/BookSource/BookSourceDebugEngine.swift:314— BookSourceDebugEngine.debugEntry 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.
RefreshPreparation.preparePaged (cyclomatic 22) Modules/Core/ReaderCore/EPUBPageRenderer.swift:185— RefreshPreparation.preparePaged 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.
RuleEngine.applyIndexSpec (cyclomatic 22) Modules/Core/RuleEngine/RuleEngine.swift:468— RuleEngine.applyIndexSpec 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.
RuleEngine.sanitizeExtractedURL (cyclomatic 22) Modules/Core/RuleEngine/RuleEngine.swift:955— RuleEngine.sanitizeExtractedURL 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.
ImportedBookPresentationController.presentPending (cyclomatic 22) Modules/Features/Bookshelf/ImportedBookPresentation.swift:110— ImportedBookPresentationController.presentPending 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.
CoreTextCollectionScrollViewController.commitViewportGeometry (cyclomatic 22) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1924— CoreTextCollectionScrollViewController.commitViewportGeometry 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.
CoreTextPaintFragment.make (cyclomatic 22) Modules/Features/Reader/CoreTextPaintFragment.swift:17— CoreTextPaintFragment.make 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.
ReaderBookSearchSession.run (cyclomatic 22) Modules/Features/Reader/ReaderBookSearchSession.swift:220— ReaderBookSearchSession.run has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReaderCardTransitionAnimator.interruptibleAnimator (cyclomatic 22) Modules/Features/Reader/ReaderCardTransitionAnimator.swift:119— ReaderCardTransitionAnimator.interruptibleAnimator 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.
ReaderView.loadContent (cyclomatic 22) Modules/Features/Reader/ReaderView+PageBuilding.swift:362— ReaderView.loadContent 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.
OpenAICompatibleProvider.generateDeepSeek (cyclomatic 22) Modules/Services/AI/OpenAICompatibleProvider.swift:208— OpenAICompatibleProvider.generateDeepSeek has cyclomatic complexity 22 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BookOriginSearchService.stream (cyclomatic 22) Modules/Services/Online/BookOriginSearchService.swift:52— BookOriginSearchService.stream has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AuthorWorksModel.load (cyclomatic 22) Modules/Services/Works/AuthorWorks.swift:208— AuthorWorksModel.load 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.
MetadataResolver.resolve (cyclomatic 22) Modules/Services/Works/MetadataResolver.swift:37— MetadataResolver.resolve 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.
ReaderConfig.setupBindings (cyclomatic 22) Targets/Yuedu/SharedApp/GlobalSettings.swift:388— ReaderConfig.setupBindings 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.
BrowserLayoutPageEngine.decideEngine (cyclomatic 22) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:711— BrowserLayoutPageEngine.decideEngine 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.
CoreTextChunkAttachmentExtractor.extract (cyclomatic 22) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11— CoreTextChunkAttachmentExtractor.extract 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.
CoreTextChunkSlicer.slice (cyclomatic 22) Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:54— CoreTextChunkSlicer.slice 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.
LottieTitleTemplateImporter.`import` (cyclomatic 22) Modules/Core/ReaderCore/Customization/LottieTitleTemplateImporter.swift:58— LottieTitleTemplateImporter.`import` 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.
ModernParserBridge.parseExploreResults (cyclomatic 22) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2674— ModernParserBridge.parseExploreResults 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.
HomeSectionForm.body (cyclomatic 22) Modules/Features/Explore/Home/HomeSectionForm.swift:216— HomeSectionForm.body 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.
VideoPlayerView.body (cyclomatic 22) Modules/Features/Reader/Video/VideoPlayerView.swift:46— VideoPlayerView.body 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.
Lexer.skipNumber (cyclomatic 22) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:259— Lexer.skipNumber has cyclomatic complexity 22 (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.
LegadoRuleScope.callerNames (cyclomatic 22) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:271— LegadoRuleScope.callerNames has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 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.
LegadoRuleScope.seededNames (cyclomatic 22) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:353— LegadoRuleScope.seededNames has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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.
ruleEngine.evaluateRuleLike (cyclomatic 22) REDACTED:394— ruleEngine.evaluateRuleLike 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.
AITextCoordinates.mappedRange (cyclomatic 21) Modules/Core/AI/AISourceSnapshot.swift:126— AITextCoordinates.mappedRange has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SourceAPIErrorLog.chapterTransportFailureMessage (cyclomatic 21) Modules/Core/BookSource/SourceAPIErrorLog.swift:199— SourceAPIErrorLog.chapterTransportFailureMessage has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReaderHTMLUtilities.promoteBreakSeparatedParagraphs (cyclomatic 21) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:267— ReaderHTMLUtilities.promoteBreakSeparatedParagraphs has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
TXTChapterParser.enumerateMappedTitleLines (cyclomatic 21) Modules/Core/TXT/TXTChapterParser.swift:938— TXTChapterParser.enumerateMappedTitleLines has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoreTextCollectionScrollViewController.scrollViewDidScroll (cyclomatic 21) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:2281— CoreTextCollectionScrollViewController.scrollViewDidScroll has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Coordinator.handleChapterReady (cyclomatic 21) Modules/Features/Reader/CoreTextPagedView.swift:1564— Coordinator.handleChapterReady has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SingleWriteHTTPExchange.requestBytes (cyclomatic 21) Modules/Services/Network/SingleWriteHTTPExchange.swift:393— SingleWriteHTTPExchange.requestBytes has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChapterFetcher.reattachStandaloneParagraphReviews (cyclomatic 21) Modules/Services/Online/ChapterFetcher.swift:404— ChapterFetcher.reattachStandaloneParagraphReviews has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RSSArticleHTMLSanitizer.normalizeNodes (cyclomatic 21) Modules/Services/RSS/RSSUtilities.swift:599— RSSArticleHTMLSanitizer.normalizeNodes has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuleModuleRepositoryIndex.parse (cyclomatic 21) Modules/Services/RuleModules/RuleModuleRepository.swift:31— RuleModuleRepositoryIndex.parse 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.
HomeDefaultsLanguageSwap.apply (cyclomatic 21) Modules/Services/Works/HomeDefaultsLanguageSwap.swift:38— HomeDefaultsLanguageSwap.apply has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HomeModel.build (cyclomatic 21) Modules/Services/Works/HomeModel.swift:128— HomeModel.build 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.
GlobalSettings.writeReadingSettings (cyclomatic 21) Targets/Yuedu/SharedApp/AppearanceThemeReadingApplier.swift:371— GlobalSettings.writeReadingSettings has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoreTextPageView.editMenuInteraction (cyclomatic 21) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:421— CoreTextPageView.editMenuInteraction has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChapterLayout.appearanceUpdated (cyclomatic 21) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:374— ChapterLayout.appearanceUpdated has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NodeAttributedStringRenderer.collapseAdjacentParagraphSpacing (cyclomatic 21) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2912— NodeAttributedStringRenderer.collapseAdjacentParagraphSpacing 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.
RuleModuleManifestSections.body (cyclomatic 21) Modules/Features/Library/Modules/RuleModuleImportSheet.swift:151— RuleModuleManifestSections.body has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LegadoRuleScope.declaredNames (cyclomatic 21) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:438— LegadoRuleScope.declaredNames 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.
AnalyzeUrl.javaAbsoluteURL (cyclomatic 21) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:687— AnalyzeUrl.javaAbsoluteURL has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
legado-engine.getList (cyclomatic 21) REDACTED:127— legado-engine.getList has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AISelfAssessmentStreamParser.finish (cyclomatic 20) Modules/Core/AI/AISelfAssessment.swift:116— AISelfAssessmentStreamParser.finish has cyclomatic complexity 20 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
CustomHTTPProvider.buildJSRequestOrThrow (cyclomatic 20) Modules/Core/TTS/TTSAudioProvider.swift:728— CustomHTTPProvider.buildJSRequestOrThrow 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.
TXTChapterParser.skipLeadingWhitespaceBytes (cyclomatic 20) Modules/Core/TXT/TXTChapterParser.swift:750— TXTChapterParser.skipLeadingWhitespaceBytes 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.
TXTEncodingDetector.detect (cyclomatic 20) Modules/Core/TXT/TXTEncodingDetector.swift:80— TXTEncodingDetector.detect 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.
HomeView.body (cyclomatic 20) Modules/Features/Bookshelf/HomeView.swift:598— HomeView.body 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.
OPDSFeedView.body (cyclomatic 20) Modules/Features/Bookshelf/OPDSImportView.swift:232— OPDSFeedView.body 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.
BrowserScrollTileCell.configure (cyclomatic 20) Modules/Features/Reader/BrowserScrollTileCell.swift:174— BrowserScrollTileCell.configure 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.
ReaderView.scrollBody (cyclomatic 20) Modules/Features/Reader/ReaderView+TXTVerticalScroll.swift:11— ReaderView.scrollBody 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.
UserDetailView.body (cyclomatic 20) Modules/Features/Settings/UserDetailView.swift:40— UserDetailView.body 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.
BookStore.mergeOnlineChapters (cyclomatic 20) Modules/Services/LibraryStore/BookStore.swift:3784— BookStore.mergeOnlineChapters 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.
HTTPResponseReader.advance (cyclomatic 20) Modules/Services/Network/SingleWriteHTTPExchange.swift:652— HTTPResponseReader.advance 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.
RSSXMLParserDelegate.parser (cyclomatic 20) Modules/Services/RSS/RSSFetcher.swift:254— RSSXMLParserDelegate.parser 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.
RSSXMLParser.parser (cyclomatic 20) Modules/Services/RSS/RSSFetcher.swift:1402— RSSXMLParser.parser 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.
RemoteLibraryHTTPClient.validContentRange (cyclomatic 20) Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:133— RemoteLibraryHTTPClient.validContentRange 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.
SearchWorkResolver.resolve (cyclomatic 20) Modules/Services/Works/SearchWorkResolver.swift:121— SearchWorkResolver.resolve 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.
yuedu_appApp.init (cyclomatic 20) Targets/Yuedu/SharedApp/yuedu_appApp.swift:78— yuedu_appApp.init 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.
CoreTextPageView.drawBlockRenderables (cyclomatic 20) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1156— CoreTextPageView.drawBlockRenderables 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.
CoreTextPaginator.applyOrphanControl (cyclomatic 20) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2426— CoreTextPaginator.applyOrphanControl 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.
CoreTextPaginator.computeExplicitBlockRenderableRect (cyclomatic 20) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3440— CoreTextPaginator.computeExplicitBlockRenderableRect 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.
EmbeddedTrueTypeFontIdentity.namespaced (cyclomatic 20) Modules/Core/ReaderCore/CoreText/EmbeddedTrueTypeFontIdentity.swift:6— EmbeddedTrueTypeFontIdentity.namespaced 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.
NodeAttributedStringRenderer.applyVerticalSealBreaks (cyclomatic 20) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:917— NodeAttributedStringRenderer.applyVerticalSealBreaks 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.
RegexHighlightEngine.cascade (cyclomatic 20) Modules/Core/ReaderCore/CoreText/RegexHighlightEngine.swift:240— RegexHighlightEngine.cascade 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.
ReaderStyleDeclarationScanner.scan::declaration (cyclomatic 20) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:55— ReaderStyleDeclarationScanner.scan::declaration 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. This shape REPEATS in the file: one other method here (ReaderStyleDeclarationScanner.scan) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
JsoupDefaultExtractor.getResultLast (cyclomatic 20) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:386— JsoupDefaultExtractor.getResultLast 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.
LegadoRuleScope.isAssigned (cyclomatic 20) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:416— LegadoRuleScope.isAssigned 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.
HTMLParser.swift.parseHTML (cyclomatic 20) Modules/Core/RuleEngine/HTMLParser.swift:338— HTMLParser.swift.parseHTML has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ruleEngine.evaluateTemplateExpression (cyclomatic 20) REDACTED:307— ruleEngine.evaluateTemplateExpression 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.
parseTOC (cyclomatic 20) REDACTED:1175— parseTOC has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1183, 1201, 1198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AIAgenticAssistant.run (cyclomatic 19) Modules/Core/AI/AIAgenticAssistant.swift:80— AIAgenticAssistant.run has cyclomatic complexity 19 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
AIMemoryPlanner.plan (cyclomatic 19) Modules/Core/AI/AICharacterMemoryPlanner.swift:11— AIMemoryPlanner.plan has cyclomatic complexity 19 (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.
RuleEngine.routeExtractValue (cyclomatic 19) Modules/Core/RuleEngine/RuleEngine.swift:167— RuleEngine.routeExtractValue 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.
TXTEncodingDetector.multibyteMatch (cyclomatic 19) Modules/Core/TXT/TXTEncodingDetector.swift:140— TXTEncodingDetector.multibyteMatch 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.
BookSourceManagementModel.rebuildRows (cyclomatic 19) Modules/Features/BookSource/BookSourceManagementModel.swift:409— BookSourceManagementModel.rebuildRows has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FixedPageReaderView.readerContent (cyclomatic 19) Modules/Features/FixedPageReader/FixedPageReaderView.swift:95— FixedPageReaderView.readerContent 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.
CoreTextCollectionScrollViewController.applyReadingPositionIfPossible (cyclomatic 19) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1256— CoreTextCollectionScrollViewController.applyReadingPositionIfPossible 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.
ReaderChapterCommentDecorator.placements (cyclomatic 19) Modules/Features/Reader/ReaderChapterCommentDecorator.swift:113— ReaderChapterCommentDecorator.placements has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
CalibreWireBuffer.nextFrame (cyclomatic 19) Modules/Services/Calibre/CalibreWirelessProtocol.swift:74— CalibreWireBuffer.nextFrame 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.
BookStore.snapshotForSync (cyclomatic 19) Modules/Services/LibraryStore/BookStore.swift:2882— BookStore.snapshotForSync has cyclomatic complexity 19 (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.
UniversalBookResourceAdapter.rewriteResourceReferences (cyclomatic 19) Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:160— UniversalBookResourceAdapter.rewriteResourceReferences 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.
RSSFetcher.fetchItems (cyclomatic 19) Modules/Services/RSS/RSSFetcher.swift:1133— RSSFetcher.fetchItems 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.
WorkIndexService.compute (cyclomatic 19) Modules/Services/Works/WorkIndexService.swift:235— WorkIndexService.compute 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.
GeneratedCoverTextLayout.glyphs (cyclomatic 19) Modules/SharedUI/Components/GeneratedBookCover.swift:124— GeneratedCoverTextLayout.glyphs 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.
yuedu_appApp.body (cyclomatic 19) Targets/Yuedu/SharedApp/yuedu_appApp.swift:233— yuedu_appApp.body has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChapterTitleDesignRenderer.compile (cyclomatic 19) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:132— ChapterTitleDesignRenderer.compile has cyclomatic complexity 19 (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.
CoreTextPageView.handleSelectionHandlePan (cyclomatic 19) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1682— CoreTextPageView.handleSelectionHandlePan 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.
HTMLAttributedStringBuilder.buildChildren (cyclomatic 19) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:760— HTMLAttributedStringBuilder.buildChildren 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. This is NOT this file's highest cyclomatic complexity: HTMLAttributedStringBuilder.userAgentDeclarations (cyclomatic 25) 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.
HTMLStyledASTRenderableNodeConverter.mapChildren (cyclomatic 19) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:94— HTMLStyledASTRenderableNodeConverter.mapChildren has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 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.
MarkdownRenderableNodeConverter.convertBody (cyclomatic 19) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:148— MarkdownRenderableNodeConverter.convertBody has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MarkdownRenderableNodeConverter.topLevelText (cyclomatic 21) 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.
MarkdownInlineParser.parse (cyclomatic 19) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:391— MarkdownInlineParser.parse has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MarkdownRenderableNodeConverter.topLevelText (cyclomatic 21) 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.
SVGWebViewRasterizer.beginCapture (cyclomatic 19) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:518— SVGWebViewRasterizer.beginCapture has cyclomatic complexity 19 (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.
ReaderStyleDeclarationScanner.scan (cyclomatic 19) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:35— ReaderStyleDeclarationScanner.scan 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. This shape REPEATS in the file: one other method here (ReaderStyleDeclarationScanner.scan::declaration) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ReaderStylePackage.validateManifest (cyclomatic 19) Modules/Core/ReaderCore/Customization/ReaderStylePackage.swift:332— ReaderStylePackage.validateManifest 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.
ModernParserBridge.exploreItems (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2407— ModernParserBridge.exploreItems has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModernRuleEngine.modeQualifiedRule (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:766— ModernRuleEngine.modeQualifiedRule has cyclomatic complexity 19 (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.
OrderedJSON.javaDouble (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:202— OrderedJSON.javaDouble 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.
KeyOrderScanner.walkObject (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:297— KeyOrderScanner.walkObject 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.
HomeSectionCards.body (cyclomatic 19) Modules/Features/Explore/Home/HomeSectionCards.swift:89— HomeSectionCards.body 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.
CoreTextHorizontalLineDrawer.drawInlineBorderBoxes (cyclomatic 19) Modules/Core/ReaderCore/CoreText/CoreTextHorizontal/CoreTextHorizontalLineDrawer.swift:250— CoreTextHorizontalLineDrawer.drawInlineBorderBoxes 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.
JSCoreEngine.extractBytes (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:818— JSCoreEngine.extractBytes 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.
JSCoreEngine.configureContext (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:947— JSCoreEngine.configureContext has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LegadoJSBridge.runAjaxBatch (cyclomatic 19) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1102— LegadoJSBridge.runAjaxBatch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ruleEngine.splitTopLevel (cyclomatic 19) REDACTED:170— ruleEngine.splitTopLevel 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.
legado-engine.getAttr (cyclomatic 19) REDACTED:55— legado-engine.getAttr has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
PublicationSession.makeSession (cyclomatic 18) Modules/Core/EPUB/PublicationSession.swift:720— PublicationSession.makeSession 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.
MOBIFile.init (cyclomatic 18) Modules/Core/MOBI/MOBIFile.swift:40— MOBIFile.init has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderHTMLUtilities.qidianReviewTarget (cyclomatic 18) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1917— ReaderHTMLUtilities.qidianReviewTarget 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.
TTSChunkDecoder.fileTypeHint (cyclomatic 18) Modules/Core/TTS/TTSChunkDecoder.swift:140— TTSChunkDecoder.fileTypeHint has cyclomatic complexity 18 (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.
BookGridCell.body (cyclomatic 18) Modules/Features/Bookshelf/HomeView.swift:2171— BookGridCell.body has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CoreTextCollectionScrollViewController.update (cyclomatic 18) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:755— CoreTextCollectionScrollViewController.update has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CoreTextCollectionScrollViewController.handleTap (cyclomatic 18) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1465— CoreTextCollectionScrollViewController.handleTap has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CoreTextCollectionScrollViewController.resolveVisibleViewport (cyclomatic 18) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:2061— CoreTextCollectionScrollViewController.resolveVisibleViewport 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.
ReaderNavigationTransitionDriver.handleEdgePan (cyclomatic 18) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:280— ReaderNavigationTransitionDriver.handleEdgePan 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.
ReaderOverlayValueFormatter.text (cyclomatic 18) Modules/Features/Reader/ReaderOverlayContent.swift:167— ReaderOverlayValueFormatter.text 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.
ReaderView.followTTSPlaybackHighlight (cyclomatic 18) Modules/Features/Reader/ReaderView+SourceChange.swift:798— ReaderView.followTTSPlaybackHighlight has cyclomatic complexity 18 (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.
ReaderView.startTTSChapter (cyclomatic 18) Modules/Features/Reader/ReaderView+SourceChange.swift:1034— ReaderView.startTTSChapter has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookSearchView.body (cyclomatic 18) Modules/Features/Search/BookSearchView.swift:333— BookSearchView.body has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookStore.refreshOnlineBookMetadata (cyclomatic 18) Modules/Services/LibraryStore/BookStore.swift:2263— BookStore.refreshOnlineBookMetadata has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BookStore.rereadTXTHeaders (cyclomatic 18) Modules/Services/LibraryStore/BookStore.swift:3500— BookStore.rereadTXTHeaders 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.
LocalBookImportService.importBook (cyclomatic 18) Modules/Services/LibraryStore/LocalBookImportService.swift:15— LocalBookImportService.importBook has cyclomatic complexity 18 (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.
ShelfWorkMerger.absorb (cyclomatic 18) Modules/Services/LibraryStore/ShelfWorkService.swift:231— ShelfWorkMerger.absorb has cyclomatic complexity 18 (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.
DiscoverViewModel.reload (cyclomatic 18) Modules/Services/Online/DiscoverViewModel.swift:489— DiscoverViewModel.reload 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.
AtomXMLParserDelegate.handleArticleElementEnd (cyclomatic 18) Modules/Services/RSS/RSSFetcher.swift:613— AtomXMLParserDelegate.handleArticleElementEnd 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.
RemoteLibraryService.probe (cyclomatic 18) Modules/Services/RemoteLibrary/RemoteLibraryService.swift:423— RemoteLibraryService.probe has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ImportedMetadataCapture.classify (cyclomatic 18) Modules/Services/Works/ImportedMetadataCapture.swift:142— ImportedMetadataCapture.classify has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderBackgroundMigration.migrateSavedBackgrounds (cyclomatic 18) Targets/Yuedu/SharedApp/ReaderBackgroundMigration.swift:48— ReaderBackgroundMigration.migrateSavedBackgrounds 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.
SVGPathParser.numberEnd (cyclomatic 18) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1582— SVGPathParser.numberEnd has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
CoreTextPageView.renderPage (cyclomatic 18) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:746— CoreTextPageView.renderPage has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CoreTextPaginator.standaloneImageRenderableRect (cyclomatic 18) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3355— CoreTextPaginator.standaloneImageRenderableRect 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.
CoreTextPaginator.makeBlockImageAttachment (cyclomatic 18) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3532— CoreTextPaginator.makeBlockImageAttachment 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.
EPUBStyleResolver.registerFontFaces (cyclomatic 18) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:110— EPUBStyleResolver.registerFontFaces 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.
ReaderBatterySVGRasterRequestValidator.validate (cyclomatic 18) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:22— ReaderBatterySVGRasterRequestValidator.validate has cyclomatic complexity 18 (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.
ReaderStylePackage.importContents (cyclomatic 18) Modules/Core/ReaderCore/Customization/ReaderStylePackage.swift:208— ReaderStylePackage.importContents 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.
ReedenThemeImporter.appendUnmappedAppearanceNotes (cyclomatic 18) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:968— ReedenThemeImporter.appendUnmappedAppearanceNotes has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModernParserBridge.reviewSummaryIdentifiers (cyclomatic 18) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:919— ModernParserBridge.reviewSummaryIdentifiers has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
ModernParserBridge.parseBookInfo (cyclomatic 18) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1255— ModernParserBridge.parseBookInfo has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RuleAnalyzer.chompCodeBalanced (cyclomatic 18) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:282— RuleAnalyzer.chompCodeBalanced 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.
Readability.Readability (cyclomatic 18) Resources/Assets/Readability.js:27— Readability.Readability has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
ruleEngine.getAttr (cyclomatic 18) REDACTED:508— ruleEngine.getAttr has cyclomatic complexity 18 (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.
policy.sanitizePreferences (cyclomatic 18) gateway/src/policy.ts:146— policy.sanitizePreferences 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.
feedback.feedbackRouter (cyclomatic 18) REDACTED:38— feedback.feedbackRouter has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 170, 230, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_unwrapNoscriptImages (cyclomatic 18) Resources/Assets/Readability.js:1898— _unwrapNoscriptImages has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 1923, 1902). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: _initializeNode (cyclomatic 20) 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.
AIAnswerMarkdown.blocks (cyclomatic 17) Modules/Core/AI/AIAnswerMarkdown.swift:24— AIAnswerMarkdown.blocks has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BookSourceHealthChecker.checkMarks (cyclomatic 17) Modules/Core/BookSource/BookSourceHealthChecker.swift:901— BookSourceHealthChecker.checkMarks 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.
SourceAPIErrorLog.chapterErrorEnvelopeMessage (cyclomatic 17) Modules/Core/BookSource/SourceAPIErrorLog.swift:158— SourceAPIErrorLog.chapterErrorEnvelopeMessage 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.
ReaderHTMLUtilities.normalizeQidianGodReviewImage (cyclomatic 17) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1538— ReaderHTMLUtilities.normalizeQidianGodReviewImage 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.
ReaderHTMLUtilities.reviewTarget (cyclomatic 17) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1837— ReaderHTMLUtilities.reviewTarget 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.
ReplaceRuleEngine.edits (cyclomatic 17) Modules/Core/Replace/ReplaceRuleEngine.swift:216— ReplaceRuleEngine.edits has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebNovelParser.parseTOC (cyclomatic 17) Modules/Core/RuleEngine/WebNovelParser.swift:53— WebNovelParser.parseTOC 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.
AIAssistantPanelView.body (cyclomatic 17) Modules/Features/AI/AIAssistantPanelView.swift:41— AIAssistantPanelView.body 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.
AICharacterMemoryView.body (cyclomatic 17) Modules/Features/AI/AICharacterMemoryView.swift:58— AICharacterMemoryView.body 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.
BookSourceFormLoginView.configureLegadoRuntime (cyclomatic 17) Modules/Features/BookSource/BookSourceFormLoginView.swift:812— BookSourceFormLoginView.configureLegadoRuntime 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.
CalibreWirelessView.body (cyclomatic 17) Modules/Features/Bookshelf/CalibreWirelessView.swift:16— CalibreWirelessView.body 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.
Coordinator.handleInstantPan (cyclomatic 17) Modules/Features/Reader/CoreTextPagedView.swift:2540— Coordinator.handleInstantPan 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.
ReaderNavigationTransitionDriver.schedulePendingReconciliation (cyclomatic 17) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:524— ReaderNavigationTransitionDriver.schedulePendingReconciliation 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.
ReaderView.applyChapterRefreshAction (cyclomatic 17) Modules/Features/Reader/ReaderView+OnlineChapterLoading.swift:158— ReaderView.applyChapterRefreshAction 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.
ReaderView.gatherAIBookText (cyclomatic 17) Modules/Features/Reader/ReaderView+SourceChange.swift:1641— ReaderView.gatherAIBookText 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.
BrowserPage.addressField (cyclomatic 17) Modules/Features/WebBrowser/BrowserView.swift:1053— BrowserPage.addressField 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.
AIRecommendationService.fillCovers (cyclomatic 17) Modules/Services/AI/AIRecommendationService.swift:270— AIRecommendationService.fillCovers 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.
BookReaderSettingsStore.migrateLegacyFixedPageReadingModes (cyclomatic 17) Modules/Services/LibraryStore/BookReaderSettingsStore.swift:117— BookReaderSettingsStore.migrateLegacyFixedPageReadingModes 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.
CacheManagementService.automaticCleanupCandidates (cyclomatic 17) Modules/Services/LibraryStore/CacheManagementService.swift:421— CacheManagementService.automaticCleanupCandidates 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.
HTMLResponseDecoder.decode (cyclomatic 17) Modules/Services/Network/HTMLResponseDecoder.swift:16— HTMLResponseDecoder.decode has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SingleWriteHTTPExchange.redirectRequest (cyclomatic 17) Modules/Services/Network/SingleWriteHTTPExchange.swift:461— SingleWriteHTTPExchange.redirectRequest 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.
WebFetcher.buildRequest (cyclomatic 17) Modules/Services/Network/WebFetcher.swift:254— WebFetcher.buildRequest 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.
OfflineChapterStore.persistMangaImages (cyclomatic 17) Modules/Services/Offline/OfflineChapterStore.swift:237— OfflineChapterStore.persistMangaImages 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.
ChapterFetcher.buildRenderableNormalizedHTML (cyclomatic 17) Modules/Services/Online/ChapterFetcher.swift:67— ChapterFetcher.buildRenderableNormalizedHTML 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.
SearchAggregator.runSearch (cyclomatic 17) Modules/Services/Online/SearchAggregator.swift:614— SearchAggregator.runSearch 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.
AozoraLibraryDownloadService.importWork (cyclomatic 17) Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:65— AozoraLibraryDownloadService.importWork has cyclomatic complexity 17 (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.
RSSXMLParserDelegate.parser (cyclomatic 17) Modules/Services/RSS/RSSFetcher.swift:302— RSSXMLParserDelegate.parser 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.
RSSXMLParser.handleFeedElementEnd (cyclomatic 17) Modules/Services/RSS/RSSFetcher.swift:1430— RSSXMLParser.handleFeedElementEnd 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.
RuleModuleValidator.validate (cyclomatic 17) Modules/Services/RuleModules/RuleModuleValidator.swift:557— RuleModuleValidator.validate has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
WebDAVIndexCoordinator.refreshStatuses (cyclomatic 17) Modules/Services/Works/WebDAVIndexCoordinator.swift:340— WebDAVIndexCoordinator.refreshStatuses 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.
WebDAVIndexer.run (cyclomatic 17) Modules/Services/Works/WebDAVIndexer.swift:44— WebDAVIndexer.run 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.
BrowserLayoutPageEngine.pageViewController (cyclomatic 17) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1589— BrowserLayoutPageEngine.pageViewController 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.
ChapterTitleAttributedBuilder.append (cyclomatic 17) Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:29— ChapterTitleAttributedBuilder.append 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.
CoreTextChunk.stringIndex (cyclomatic 17) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:370— CoreTextChunk.stringIndex 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.
SVGWebViewRasterizer.resolveSVGSize (cyclomatic 17) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:337— SVGWebViewRasterizer.resolveSVGSize 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.
ChapterTitleHTMLCodec.decodeContent (cyclomatic 17) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:327— ChapterTitleHTMLCodec.decodeContent 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.
ReaderStyleAssetStore.importValidatedPackageAssets (cyclomatic 17) Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:430— ReaderStyleAssetStore.importValidatedPackageAssets 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.
ReaderStyleAssetStore.prepareImage (cyclomatic 17) Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:662— ReaderStyleAssetStore.prepareImage 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.
ReaderStyleCSSCodec.parseGradient (cyclomatic 17) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:848— ReaderStyleCSSCodec.parseGradient 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.
ModernRuleEngine.getStringList (cyclomatic 17) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:299— ModernRuleEngine.getStringList 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.
OrderedJSON.appendJSON (cyclomatic 17) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:115— OrderedJSON.appendJSON 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.
JSCoreEngine.setResult (cyclomatic 17) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2129— JSCoreEngine.setResult 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.
ruleEngine.safeQuerySelectorAll (cyclomatic 17) REDACTED:74— ruleEngine.safeQuerySelectorAll has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal 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.
ruleEngine.extractValueByJsoupDefaultFromElements (cyclomatic 17) REDACTED:623— ruleEngine.extractValueByJsoupDefaultFromElements 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.
AIReadingEvidence.collect (cyclomatic 16) Modules/Core/AI/AIReadingEvidence.swift:9— AIReadingEvidence.collect 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.
BookSource.legacySearchURLParts (cyclomatic 16) Modules/Core/BookSource/BookSourceURLRendering.swift:107— BookSource.legacySearchURLParts 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.
BookSourceFetcher.fetchWebContent (cyclomatic 16) Modules/Core/BookSource/BookSourceFetcher+WebContent.swift:10— BookSourceFetcher.fetchWebContent 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.
SharedImportPayloadClassifier.classify (cyclomatic 16) Modules/Core/BookSource/SharedImportQueueDrainer.swift:669— SharedImportPayloadClassifier.classify 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.
FixedLayoutSpreadPairingBuilder.build (cyclomatic 16) Modules/Core/EPUB/PublicationSession.swift:92— FixedLayoutSpreadPairingBuilder.build has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PublicationSession.parseOPFMetadataXML (cyclomatic 16) Modules/Core/EPUB/PublicationSession.swift:1364— PublicationSession.parseOPFMetadataXML 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.
RuleEngine.isJsoupDefaultRule (cyclomatic 16) Modules/Core/RuleEngine/RuleEngine.swift:291— RuleEngine.isJsoupDefaultRule has cyclomatic complexity 16 (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.
OnlineBookView.openReader (cyclomatic 16) Modules/Features/BookDetail/OnlineBookView.swift:1085— OnlineBookView.openReader 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.
WorkDetailView.body (cyclomatic 16) Modules/Features/BookDetail/WorkDetailView.swift:187— WorkDetailView.body 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.
RemoteLibraryManagementView.body (cyclomatic 16) Modules/Features/Bookshelf/RemoteLibraryManagementView.swift:19— RemoteLibraryManagementView.body 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.
RSSFeedView.body (cyclomatic 16) Modules/Features/RSS/RSSFeedView.swift:230— RSSFeedView.body 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.
Coordinator.bindEngineCallbacks (cyclomatic 16) Modules/Features/Reader/CoreTextPagedView.swift:1240— Coordinator.bindEngineCallbacks 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.
ReaderSettingsExportSnapshot.make (cyclomatic 16) Modules/Features/Reader/ReaderSettingsImportService.swift:464— ReaderSettingsExportSnapshot.make 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.
ReaderView.handleTouchAction (cyclomatic 16) Modules/Features/Reader/ReaderView.swift:3257— ReaderView.handleTouchAction 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.
ReaderView.currentMediaOverlayHighlightText (cyclomatic 16) Modules/Features/Reader/ReaderView+SourceChange.swift:901— ReaderView.currentMediaOverlayHighlightText has cyclomatic complexity 16 (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.
TXTTocRuleEditView.refreshPreview (cyclomatic 16) Modules/Features/Settings/TXTTocRuleEditView.swift:206— TXTTocRuleEditView.refreshPreview 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.
OpenAICompatibleProvider.stream (cyclomatic 16) Modules/Services/AI/OpenAICompatibleProvider.swift:244— OpenAICompatibleProvider.stream has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
OfflineChapterStore.persistTextImages (cyclomatic 16) Modules/Services/Offline/OfflineChapterStore.swift:374— OfflineChapterStore.persistTextImages 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.
OfflineChapterStore.isSupportedImageData (cyclomatic 16) Modules/Services/Offline/OfflineChapterStore.swift:583— OfflineChapterStore.isSupportedImageData 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.
OfflineDownloadManager.reconcileInterruptedDownloads (cyclomatic 16) Modules/Services/Offline/OfflineDownloadManager.swift:232— OfflineDownloadManager.reconcileInterruptedDownloads 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.
OfflineDownloadManager.runBook (cyclomatic 16) Modules/Services/Offline/OfflineDownloadManager.swift:379— OfflineDownloadManager.runBook 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.
ChapterAlignment.alignedIndex (cyclomatic 16) Modules/Services/Online/ChapterAlignment.swift:35— ChapterAlignment.alignedIndex 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.
ChapterAlignment.numericValue (cyclomatic 16) Modules/Services/Online/ChapterAlignment.swift:199— ChapterAlignment.numericValue 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.
SearchResultCoverURLPolicy.normalizedString (cyclomatic 16) Modules/Services/Online/SearchResultCoverURLPolicy.swift:12— SearchResultCoverURLPolicy.normalizedString has cyclomatic complexity 16 (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.
CalibreProgressService.save (cyclomatic 16) Modules/Services/RemoteLibrary/CalibreProgressService.swift:92— CalibreProgressService.save has cyclomatic complexity 16 (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.
RemoteLibraryWritingService.updateMetadata (cyclomatic 16) Modules/Services/RemoteLibrary/RemoteLibraryWritingService.swift:154— RemoteLibraryWritingService.updateMetadata 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.
RuleModule.localized (cyclomatic 16) Modules/Services/RuleModules/RuleModule.swift:534— RuleModule.localized 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.
RuleModuleValidator.validate (cyclomatic 16) Modules/Services/RuleModules/RuleModuleValidator.swift:518— RuleModuleValidator.validate 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.
AuthorShelf.adding (cyclomatic 16) Modules/Services/Works/AuthorShelf.swift:27— AuthorShelf.adding has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HomeModel.fetch (cyclomatic 16) Modules/Services/Works/HomeModel.swift:267— HomeModel.fetch 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.
CollectionSummary.cards (cyclomatic 16) Modules/Services/Works/HomeListCards.swift:241— CollectionSummary.cards 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.
ChapterDocumentStore.document (cyclomatic 16) Modules/Core/ReaderCore/CoreText/ChapterDocument.swift:97— ChapterDocumentStore.document 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.
CoreTextPaginator.debugUnitDescription (cyclomatic 16) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2285— CoreTextPaginator.debugUnitDescription 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.
CoreTextPaginator.explicitRenderableText (cyclomatic 16) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3645— CoreTextPaginator.explicitRenderableText 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.
HTMLAttributedStringBuilder.styleProbeKey (cyclomatic 16) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:742— HTMLAttributedStringBuilder.styleProbeKey has cyclomatic complexity 16 (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: HTMLAttributedStringBuilder.userAgentDeclarations (cyclomatic 25) 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.
HTMLAttributedStringBuilder.resolveLength (cyclomatic 16) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2313— HTMLAttributedStringBuilder.resolveLength 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. This is NOT this file's highest cyclomatic complexity: HTMLAttributedStringBuilder.userAgentDeclarations (cyclomatic 25) 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.
HTMLAttributedStringBuilder.applyMarginShorthand (cyclomatic 16) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2349— HTMLAttributedStringBuilder.applyMarginShorthand 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. This is NOT this file's highest cyclomatic complexity: HTMLAttributedStringBuilder.userAgentDeclarations (cyclomatic 25) 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.
MathMLTableLatexConverter.latex (cyclomatic 16) Modules/Core/ReaderCore/CoreText/MathMLRendering.swift:145— MathMLTableLatexConverter.latex 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.
ReviewCardFullText.restoringCutComments (cyclomatic 16) Modules/Core/ReaderCore/CoreText/ReviewCardFullText.swift:31— ReviewCardFullText.restoringCutComments 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.
ReedenThemeImporter.applyReaderSchemas (cyclomatic 16) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:479— ReedenThemeImporter.applyReaderSchemas 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.
ReedenThemeImporter.highlightRules (cyclomatic 16) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:719— ReedenThemeImporter.highlightRules 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.
JSONPathEvaluator.tokenize (cyclomatic 16) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:52— JSONPathEvaluator.tokenize 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.
ModernRuleEngine.evaluateElements (cyclomatic 16) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:370— ModernRuleEngine.evaluateElements 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.
ModernRuleEngine.extractElementsWithOperators (cyclomatic 16) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1024— ModernRuleEngine.extractElementsWithOperators 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.
ExploreHomeRoot.home (cyclomatic 16) Modules/Features/Explore/Home/ExploreHome.swift:230— ExploreHomeRoot.home 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.
LegadoSharedJsLibrary.orderedKeys (cyclomatic 16) Modules/Core/RuleEngine/ModernParser/JS/LegadoSharedJsLibrary.swift:94— LegadoSharedJsLibrary.orderedKeys 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.
AnalyzeUrl.canonicalRequestURLString (cyclomatic 16) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:751— AnalyzeUrl.canonicalRequestURLString 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.
feedbackTriage.onFeedbackThreadCreated (cyclomatic 16) functions/src/feedbackTriage.ts:65— feedbackTriage.onFeedbackThreadCreated has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
identityToolkit.signInWithIdp (cyclomatic 16) gateway/src/identityToolkit.ts:170— identityToolkit.signInWithIdp 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.
_grabArticle (cognitive 272) Resources/Assets/Readability.js:1021— _grabArticle has cognitive complexity 272 (threshold 15). Drivers by points: if/else 62 (171 pts), loops 18 (66 pts), boolean chains 27, ternaries 3 (7 pts), other 1 (nesting depth added 161). Of this number, 250 points are the body's own statements and 22 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderView.buildBody (cognitive 154) Modules/Features/Reader/ReaderView.swift:1885— ReaderView.buildBody has cognitive complexity 154 (threshold 15). Drivers by points: if/else 81 (85 pts), ternaries 21 (37 pts), boolean chains 26, error handling 2 (4 pts), match/switch 2 (nesting depth added 22). 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.
HTMLTableRasterizer.renderPages (cognitive 148) Modules/Core/ReaderCore/CoreText/HTMLTableSupport.swift:461— HTMLTableRasterizer.renderPages has cognitive complexity 148 (threshold 15). Drivers by points: if/else 52 (94 pts), boolean chains 23, loops 11 (16 pts), ternaries 6 (12 pts), match/switch 1 (3 pts) (nesting depth added 55). Of this number, 106 points are the body's own statements and 42 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsoupDefaultExtractor.parseSingleRule (cognitive 124) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:499— JsoupDefaultExtractor.parseSingleRule has cognitive complexity 124 (threshold 15). Drivers by points: if/else 25 (75 pts), ternaries 5 (29 pts), loops 3 (10 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 84). 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.
CoreTextPaginator.extractImages (cognitive 117) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2554— CoreTextPaginator.extractImages has cognitive complexity 117 (threshold 15). Drivers by points: if/else 16 (54 pts), match/switch 4 (24 pts), ternaries 4 (24 pts), boolean chains 9, loops 3 (6 pts) (nesting depth added 81). 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.
HTMLAttributedStringBuilder.apply (cognitive 114) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1761— HTMLAttributedStringBuilder.apply has cognitive complexity 114 (threshold 15). Drivers by points: if/else 65 (77 pts), boolean chains 35, match/switch 1 (2 pts) (nesting depth added 13). 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.
RuleModuleValidator.validateFields (cognitive 108) Modules/Services/RuleModules/RuleModuleValidator.swift:69— RuleModuleValidator.validateFields has cognitive complexity 108 (threshold 15). Drivers by points: if/else 47 (79 pts), loops 7 (17 pts), boolean chains 12 (nesting depth added 42). Of this number, 107 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AIAgenticAssistant.answerQuestion (cognitive 102) Modules/Core/AI/AIAgenticAssistant+Question.swift:30— AIAgenticAssistant.answerQuestion has cognitive complexity 102 (threshold 15). Drivers by points: if/else 36 (50 pts), boolean chains 36, ternaries 7 (10 pts), loops 4 (5 pts), error handling 1 (nesting depth added 18). Of this number, 73 points are the body's own statements and 29 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaginator.computeLayout (cognitive 94) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1055— CoreTextPaginator.computeLayout has cognitive complexity 94 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 15 (26 pts), boolean chains 21, loops 3 (4 pts), match/switch 1 (4 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegadoRhinoNormalizer.normalize (cognitive 87) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:40— LegadoRhinoNormalizer.normalize has cognitive complexity 87 (threshold 15). Drivers by points: boolean chains 43, if/else 14 (31 pts), loops 9 (10 pts), ternaries 2 (3 pts) (nesting depth added 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.
ReaderStyleCSSCodec.apply (cognitive 84) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:422— ReaderStyleCSSCodec.apply has cognitive complexity 84 (threshold 15). Drivers by points: if/else 34 (61 pts), boolean chains 16, match/switch 4 (7 pts) (nesting depth added 30). 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.
JsoupDefaultExtractor.applyIndexFilter (cognitive 83) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:280— JsoupDefaultExtractor.applyIndexFilter has cognitive complexity 83 (threshold 15). Drivers by points: if/else 22 (54 pts), loops 7 (20 pts), boolean chains 6, match/switch 1 (3 pts) (nesting depth added 47). Of this number, 77 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.
SVGPathParser.execute (cognitive 82) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1613— SVGPathParser.execute has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 14 (42 pts), if/else 14 (35 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTMLSourceValidator.validate (cognitive 81) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:640— HTMLSourceValidator.validate has cognitive complexity 81 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 18, loops 7 (12 pts) (nesting depth added 35). Of this number, 75 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AICharacterMemoryService.execute (cognitive 80) Modules/Services/AI/AICharacterMemoryService.swift:134— AICharacterMemoryService.execute has cognitive complexity 80 (threshold 15). Drivers by points: if/else 19 (54 pts), ternaries 2 (10 pts), error handling 4 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterFetchManager.fetchChapter (cognitive 80) Modules/Services/Online/OnlineReadingPipeline.swift:319— ChapterFetchManager.fetchChapter has cognitive complexity 80 (threshold 15). Drivers by points: if/else 31 (52 pts), error handling 6 (9 pts), ternaries 4 (9 pts), boolean chains 7, loops 1 (3 pts) (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.
LegadoRhinoNormalizer.lex (cognitive 80) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:387— LegadoRhinoNormalizer.lex has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 19, loops 7 (19 pts), ternaries 1 (2 pts) (nesting depth added 35). Of this number, 66 points are the body's own statements and 14 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderViewportFragmentHost.update (cognitive 79) Modules/Features/Reader/ReaderViewportFragmentHost.swift:160— ReaderViewportFragmentHost.update has cognitive complexity 79 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 11 (13 pts), boolean chains 12, ternaries 4 (7 pts) (nesting depth added 27). Of this number, 72 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommentBubbleSVGRecognizer.parseSVG (cognitive 77) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:689— CommentBubbleSVGRecognizer.parseSVG has cognitive complexity 77 (threshold 15). Drivers by points: if/else 17 (30 pts), ternaries 10 (28 pts), boolean chains 11, loops 4 (8 pts) (nesting depth added 35). 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.
HTMLAttributedStringBuilder.resolvedStyle (cognitive 76) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1296— HTMLAttributedStringBuilder.resolvedStyle has cognitive complexity 76 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 7 (20 pts), boolean chains 13, ternaries 3 (5 pts) (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.
RuleModuleValidator.validate (cognitive 72) Modules/Services/RuleModules/RuleModuleValidator.swift:367— RuleModuleValidator.validate has cognitive complexity 72 (threshold 15). Drivers by points: if/else 35 (57 pts), loops 6 (8 pts), boolean chains 7 (nesting depth added 24). Of this number, 71 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextChunkAttachmentExtractor.extract (cognitive 69) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:11— CoreTextChunkAttachmentExtractor.extract has cognitive complexity 69 (threshold 15). Drivers by points: if/else 14 (34 pts), ternaries 4 (17 pts), match/switch 3 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeAttributedStringRenderer.renderBlock (cognitive 69) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:717— NodeAttributedStringRenderer.renderBlock has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (38 pts), boolean chains 26, match/switch 2 (4 pts), loops 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.
AIBookSummaryService.run (cognitive 67) Modules/Services/AI/AIBookSummaryService.swift:120— AIBookSummaryService.run has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 6 (14 pts), error handling 5 (11 pts), boolean chains 7 (nesting depth added 34). Of this number, 44 points are the body's own statements and 23 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer.lex (cognitive 67) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:140— Lexer.lex has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (47 pts), boolean chains 10, loops 4 (10 pts) (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.
RuleEngine.jsonGet (cognitive 66) Modules/Core/RuleEngine/RuleEngine.swift:1496— RuleEngine.jsonGet has cognitive complexity 66 (threshold 15). Drivers by points: if/else 17 (45 pts), ternaries 3 (10 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnlineBookView.loadTOC (cognitive 66) Modules/Features/BookDetail/OnlineBookView.swift:761— OnlineBookView.loadTOC has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (51 pts), boolean chains 9, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatementReader.readStatement (cognitive 66) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:324— StatementReader.readStatement has cognitive complexity 66 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 16, match/switch 2 (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.
CoreTextScrollEngine.loadChapter (cognitive 65) Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:551— CoreTextScrollEngine.loadChapter has cognitive complexity 65 (threshold 15). Drivers by points: if/else 21 (36 pts), ternaries 6 (14 pts), boolean chains 11, error handling 2, loops 1 (2 pts) (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.
RuleEngine.parseXPathSteps (cognitive 64) Modules/Core/RuleEngine/RuleEngine.swift:1079— RuleEngine.parseXPathSteps has cognitive complexity 64 (threshold 15). Drivers by points: if/else 12 (43 pts), loops 6 (16 pts), boolean chains 5 (nesting depth added 41). 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.
JSONPathEvaluator.resolveFilterPath (cognitive 64) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:470— JSONPathEvaluator.resolveFilterPath has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 4 (12 pts), boolean chains 11, ternaries 1 (4 pts) (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.
ruleEngine.routeExtractValue (cognitive 64) REDACTED:970— ruleEngine.routeExtractValue has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 16, ternaries 6 (10 pts), loops 2 (5 pts), error handling 2 (4 pts) (nesting depth added 19). Of this number, 53 points are the body's own statements and 11 belong to one function literal 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.
JSONPathEvaluator.apply (cognitive 62) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:216— JSONPathEvaluator.apply has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 3 (9 pts), ternaries 2 (9 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElementNode.asRenderableNode (cognitive 61) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:181— ElementNode.asRenderableNode has cognitive complexity 61 (threshold 15). Drivers by points: if/else 27 (39 pts), boolean chains 15, ternaries 2 (6 pts), match/switch 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.
NodeAttributedStringRenderer.render (cognitive 61) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:417— NodeAttributedStringRenderer.render has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (38 pts), ternaries 5 (10 pts), boolean chains 7, loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 28). 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.
CoreTextPageEngineView.updateUIViewController (cognitive 60) Modules/Features/Reader/CoreTextPagedView.swift:201— CoreTextPageEngineView.updateUIViewController has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (45 pts), ternaries 4 (10 pts), boolean chains 5 (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.
Coordinator.handleCoverPan (cognitive 60) Modules/Features/Reader/CoreTextPagedView.swift:2595— Coordinator.handleCoverPan has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (48 pts), ternaries 2 (6 pts), boolean chains 5, match/switch 1 (nesting depth added 31). 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.
EPUBStylesheetIngestion.collect (cognitive 60) Modules/Core/ReaderCore/BrowserLayout/EPUBStylesheetIngestion.swift:9— EPUBStylesheetIngestion.collect has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 5 (11 pts), error handling 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 37). Of this number, 49 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaginator.extractFrameBlockRenderables (cognitive 60) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2879— CoreTextPaginator.extractFrameBlockRenderables has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (38 pts), ternaries 5 (11 pts), loops 3 (4 pts), match/switch 1 (4 pts), boolean chains 3 (nesting depth added 26). Of this number, 56 points are the body's own statements and 4 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.
ReaderStyleCSSCodec.decodeChapterLayerDeclarations (cognitive 60) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:267— ReaderStyleCSSCodec.decodeChapterLayerDeclarations has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 5 (13 pts), boolean chains 9, loops 2 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalyzeUrl.normalizeLegadoOptionJSON (cognitive 60) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:938— AnalyzeUrl.normalizeLegadoOptionJSON has cognitive complexity 60 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 6 (17 pts), boolean chains 8, match/switch 3 (6 pts), ternaries 2 (5 pts) (nesting depth added 29). Of this number, 55 points are the body's own statements and 5 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.
ModernParserBridge.wireJSEngine (cognitive 58) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:420— ModernParserBridge.wireJSEngine has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (25 pts), boolean chains 17, ternaries 9 (13 pts), match/switch 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ruleEngine.routeExtractList (cognitive 58) REDACTED:911— ruleEngine.routeExtractList has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (31 pts), ternaries 5 (13 pts), loops 4 (12 pts), boolean chains 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.
HTMLParser.swift.matches (cognitive 57) Modules/Core/RuleEngine/HTMLParser.swift:290— HTMLParser.swift.matches has cognitive complexity 57 (threshold 15). Drivers by points: if/else 21 (46 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatementReader.skipExpression (cognitive 56) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:546— StatementReader.skipExpression has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (44 pts), boolean chains 11, loops 1 (nesting depth added 30). 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.
applyJsonToken (cognitive 55) REDACTED:728— applyJsonToken has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 4 (10 pts), ternaries 3 (10 pts), boolean chains 7 (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.
RSSXMLParserDelegate.handleArticleElementEnd (cognitive 54) Modules/Services/RSS/RSSFetcher.swift:335— RSSXMLParserDelegate.handleArticleElementEnd has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 14, ternaries 1 (3 pts), match/switch 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.
ICloudSyncManager.performSyncPass (cognitive 54) Modules/Services/iCloud/ICloudSyncManager.swift:414— ICloudSyncManager.performSyncPass has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 14, error handling 3 (7 pts), loops 2 (5 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.extractValueList (cognitive 53) Modules/Core/RuleEngine/RuleEngine.swift:798— RuleEngine.extractValueList has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 3 (10 pts), ternaries 4 (7 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPageView.drawBlockRenderables (cognitive 53) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1156— CoreTextPageView.drawBlockRenderables has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (37 pts), ternaries 3 (12 pts), boolean chains 3, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeAttributedStringRenderer.applyBlockStyle (cognitive 53) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1071— NodeAttributedStringRenderer.applyBlockStyle has cognitive complexity 53 (threshold 15). Drivers by points: if/else 23 (24 pts), boolean chains 15, ternaries 9 (12 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LegadoRhinoNormalizer.letReadsItsOwnName (cognitive 53) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:278— LegadoRhinoNormalizer.letReadsItsOwnName has cognitive complexity 53 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 24, loops 2 (3 pts) (nesting depth added 17). Of this number, 47 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTMLParser.swift.parseHTML (cognitive 53) Modules/Core/RuleEngine/HTMLParser.swift:338— HTMLParser.swift.parseHTML has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (44 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 32). Of this number, 52 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
RuleEngine.routeExtractList (cognitive 52) Modules/Core/RuleEngine/RuleEngine.swift:91— RuleEngine.routeExtractList has cognitive complexity 52 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (13 pts), ternaries 4 (12 pts), boolean chains 3, match/switch 1 (2 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.
ReaderTranslationLayout.splice (cognitive 51) Modules/Core/ReaderCore/Translation/ReaderTranslationLayout.swift:142— ReaderTranslationLayout.splice has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 11, ternaries 4 (6 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). Of this number, 44 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegadoRuleScope.declaredNames (cognitive 50) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:438— LegadoRuleScope.declaredNames has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (42 pts), boolean chains 7, loops 1 (nesting depth added 29). 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.
_getJSONLD (cognitive 50) Resources/Assets/Readability.js:1638— _getJSONLD has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 15, error handling 1 (2 pts), ternaries 1 (nesting depth added 16). Most of this is not in the body itself: 1 of the 50 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 1643, 1657, 1681, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CalibreProgressService.process (cognitive 49) Modules/Services/RemoteLibrary/CalibreProgressService.swift:123— CalibreProgressService.process has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (33 pts), error handling 3 (8 pts), boolean chains 7, loops 1 (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.
CommentBubbleSVGRecognizer.draw (cognitive 49) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1255— CommentBubbleSVGRecognizer.draw has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 3 (6 pts), ternaries 5 (6 pts), loops 2, boolean chains 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.
HTMLParser.swift.parseTagAttributes (cognitive 49) Modules/Core/RuleEngine/HTMLParser.swift:439— HTMLParser.swift.parseTagAttributes has cognitive complexity 49 (threshold 15). Drivers by points: loops 8 (19 pts), if/else 8 (18 pts), boolean chains 12 (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.
OpenAICompatibleProvider.generateDeepSeek (cognitive 48) Modules/Services/AI/OpenAICompatibleProvider.swift:208— OpenAICompatibleProvider.generateDeepSeek has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 2 (5 pts), error handling 4, boolean chains 2 (nesting depth added 27). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ReaderHTMLUtilities.promoteBreakSeparatedParagraphs (cognitive 47) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:267— ReaderHTMLUtilities.promoteBreakSeparatedParagraphs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 8 (18 pts), error handling 1 (nesting depth added 27). Of this number, 45 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextFontRegistrationService.registerUncached (cognitive 47) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:69— CoreTextFontRegistrationService.registerUncached has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 4 (10 pts), boolean chains 9, 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.
ReaderStyleCSSCodec.canonicalDeclarations (cognitive 47) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:575— ReaderStyleCSSCodec.canonicalDeclarations has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26 (35 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (3 pts), match/switch 1 (2 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.
BookStore.importEpub (cognitive 46) Modules/Services/LibraryStore/BookStore.swift:766— BookStore.importEpub has cognitive complexity 46 (threshold 15). Drivers by points: error handling 8 (20 pts), if/else 11 (19 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 22). Of this number, 37 points are the body's own statements and 9 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.
CoreTextPageEngine.preloadChapterInternal (cognitive 46) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:1150— CoreTextPageEngine.preloadChapterInternal has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 6 (17 pts), error handling 4, boolean chains 3 (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.
AIMemoryExtraction.validate (cognitive 45) Modules/Core/AI/AICharacterMemoryExtraction.swift:128— AIMemoryExtraction.validate has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 4 (9 pts), boolean chains 6, loops 3, error handling 1 (nesting depth added 16). Of this number, 35 points are the body's own statements and 10 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.
ReaderView.loadContent (cognitive 45) Modules/Features/Reader/ReaderView+PageBuilding.swift:362— ReaderView.loadContent has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 2 (5 pts), boolean chains 4 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteLibraryResourceClient.loadRequest (cognitive 45) Modules/Services/RemoteLibrary/RemoteLibraryCache.swift:76— RemoteLibraryResourceClient.loadRequest has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 13, match/switch 2 (5 pts), error handling 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.
HTMLParser.swift.parseSingleSelector (cognitive 45) Modules/Core/RuleEngine/HTMLParser.swift:114— HTMLParser.swift.parseSingleSelector has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 3 (8 pts), loops 4 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 21). Of this number, 40 points are the body's own statements and 5 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.
BookOriginSearchService.stream (cognitive 43) Modules/Services/Online/BookOriginSearchService.swift:52— BookOriginSearchService.stream has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 22). Of this number, 41 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayoutPageEngine.layoutBrowserChapter (cognitive 43) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:811— BrowserLayoutPageEngine.layoutBrowserChapter has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (34 pts), error handling 4, ternaries 1 (3 pts), boolean chains 2 (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.
EPUBStyleResolver.registerFontFaces (cognitive 43) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:110— EPUBStyleResolver.registerFontFaces has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 4, ternaries 1 (4 pts), loops 2 (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.
ChapterContentCleaner.cleanChapterContent (cognitive 42) Modules/Core/RuleEngine/ChapterContentCleaner.swift:4— ChapterContentCleaner.cleanChapterContent has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 12, loops 4 (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.
CustomHTTPProvider.evaluateArithmetic (cognitive 42) Modules/Core/TTS/TTSAudioProvider.swift:1121— CustomHTTPProvider.evaluateArithmetic has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (29 pts), loops 4 (7 pts), boolean chains 4, match/switch 1, ternaries 1 (nesting depth added 18). Of this number, 35 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteLibraryHTTPClient.stream (cognitive 41) Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:151— RemoteLibraryHTTPClient.stream has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 5, ternaries 1 (4 pts), match/switch 2 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterTitleAttributedBuilder.append (cognitive 41) Modules/Core/ReaderCore/CoreText/ChapterTitleAttributedBuilder.swift:29— ChapterTitleAttributedBuilder.append has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 3 (11 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 25). 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.
ReviewCardSVGMetrics.rewrittenTag (cognitive 41) Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:172— ReviewCardSVGMetrics.rewrittenTag has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 3 (7 pts), boolean chains 5, loops 1 (2 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.
OPDSFeedParserDelegate.parser (cognitive 40) Modules/Services/OPDS/OPDSClient.swift:378— OPDSFeedParserDelegate.parser has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 11, ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineDownloadManager.downloadChapter (cognitive 40) Modules/Services/Offline/OfflineDownloadManager.swift:453— OfflineDownloadManager.downloadChapter has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (33 pts), error handling 2 (4 pts), boolean chains 2, loops 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.
NodeAttributedStringRenderer.collapseAdjacentParagraphSpacing (cognitive 40) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2912— NodeAttributedStringRenderer.collapseAdjacentParagraphSpacing has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 8, ternaries 2 (8 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleAnalyzer.splitRule (cognitive 40) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:60— RuleAnalyzer.splitRule has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 8, match/switch 1 (3 pts), loops 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.
extractValueFromObject (cognitive 40) REDACTED:811— extractValueFromObject has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 7, ternaries 3 (5 pts), error handling 1 (2 pts), 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.
OPDSFeedParserDelegate.handleLink (cognitive 39) Modules/Services/OPDS/OPDSClient.swift:419— OPDSFeedParserDelegate.handleLink has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 13, ternaries 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.
HomeModel.build (cognitive 39) Modules/Services/Works/HomeModel.swift:128— HomeModel.build has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 7, loops 5 (7 pts), ternaries 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.
WebDAVIndexer.run (cognitive 39) Modules/Services/Works/WebDAVIndexer.swift:44— WebDAVIndexer.run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (6 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LottieTitleTemplateImporter.`import` (cognitive 39) Modules/Core/ReaderCore/Customization/LottieTitleTemplateImporter.swift:58— LottieTitleTemplateImporter.`import` has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, error handling 1 (4 pts), match/switch 1 (2 pts), loops 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.
MOBI6Converter.convert (cognitive 38) Modules/Core/MOBI/MOBI6Converter.swift:37— MOBI6Converter.convert has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 9, loops 4 (5 pts), ternaries 2 (nesting depth added 10). Of this number, 31 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextPageLinkExtractor.extractNextPageURL (cognitive 38) Modules/Core/RuleEngine/NextPageLinkExtractor.swift:4— NextPageLinkExtractor.extractNextPageURL has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 17, loops 1, ternaries 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.
BookSourceManagementModel.rebuildRows (cognitive 38) Modules/Features/BookSource/BookSourceManagementModel.swift:409— BookSourceManagementModel.rebuildRows has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (9 pts), ternaries 3 (8 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 20). Of this number, 31 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserTextInteractionController.editMenuInteraction (cognitive 38) Modules/Core/ReaderCore/BrowserLayout/BrowserTextInteractionController.swift:211— BrowserTextInteractionController.editMenuInteraction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 13, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JSONPathEvaluator.tokenize (cognitive 38) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:52— JSONPathEvaluator.tokenize has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 1, loops 1 (nesting depth added 19). 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.
parseSearchResultsJSON (cognitive 38) REDACTED:1101— parseSearchResultsJSON has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 29, if/else 3 (5 pts), ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
BookSourceHealthChecker.runStages (cognitive 37) Modules/Core/BookSource/BookSourceHealthChecker.swift:1046— BookSourceHealthChecker.runStages has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6, match/switch 3 (6 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.
TXTChapterParser.detectMappedTitleMatches (cognitive 37) Modules/Core/TXT/TXTChapterParser.swift:538— TXTChapterParser.detectMappedTitleMatches has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 6, loops 6, ternaries 3 (nesting depth added 7). Of this number, 31 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TXTReaderIndexMigrationService.complete (cognitive 37) Modules/Core/TXT/TXTReaderIndexMigrationService.swift:34— TXTReaderIndexMigrationService.complete has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 9, loops 1 (nesting depth added 8). Of this number, 29 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CacheManagementService.automaticCleanupCandidates (cognitive 37) Modules/Services/LibraryStore/CacheManagementService.swift:421— CacheManagementService.automaticCleanupCandidates has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 6 (11 pts), boolean chains 3 (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.
RSSFeedDiscovery.feedURLs (cognitive 37) Modules/Services/RSS/RSSUtilities.swift:30— RSSFeedDiscovery.feedURLs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 14, loops 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.
RSSArticleHTMLSanitizer.normalizeNodes (cognitive 37) Modules/Services/RSS/RSSUtilities.swift:599— RSSArticleHTMLSanitizer.normalizeNodes has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 4, loops 1 (nesting depth added 15). Of this number, 32 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkIndex.build (cognitive 37) Modules/Services/Works/WorkIndex.swift:184— WorkIndex.build has cognitive complexity 37 (threshold 15). Drivers by points: loops 17 (30 pts), if/else 2, match/switch 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 15). Of this number, 35 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
BrowserLayoutPageEngine.preloadChapter (cognitive 37) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:602— BrowserLayoutPageEngine.preloadChapter has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 5 (12 pts), boolean chains 5, error handling 1 (2 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.
DialogueBubbleScriptImporter.configLiteral (cognitive 37) Modules/Core/ReaderCore/Customization/DialogueBubbleScriptImporter.swift:169— DialogueBubbleScriptImporter.configLiteral has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
BookSourceFetcher.fetchChapterPackageInner (cognitive 36) Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:52— BookSourceFetcher.fetchChapterPackageInner has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 9, error handling 2 (3 pts), ternaries 1 (nesting depth added 4). Of this number, 29 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SharedImportPayloadClassifier.classify (cognitive 36) Modules/Core/BookSource/SharedImportQueueDrainer.swift:714— SharedImportPayloadClassifier.classify has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, ternaries 2 (7 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.
KF8Converter.convert (cognitive 36) Modules/Core/MOBI/KF8Converter.swift:52— KF8Converter.convert has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 8 (11 pts), boolean chains 5 (nesting depth added 11). Of this number, 33 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.
MOBIMarkupNormalizer.normalizeElement (cognitive 36) Modules/Core/MOBI/MOBIMarkupNormalizer.swift:50— MOBIMarkupNormalizer.normalizeElement has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 6, ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AuthorWorksModel.load (cognitive 36) Modules/Services/Works/AuthorWorks.swift:208— AuthorWorksModel.load has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NextInSeries.pick (cognitive 36) Modules/Services/Works/NextInSeries.swift:23— NextInSeries.pick has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 13, loops 6 (8 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.
CoreTextChunkSlicer.slice (cognitive 36) Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:54— CoreTextChunkSlicer.slice has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 8, loops 2 (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.
ModernParserBridge.parseExploreResults (cognitive 36) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2674— ModernParserBridge.parseExploreResults has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 6, loops 1 (3 pts), error handling 1 (2 pts), ternaries 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.
AIBookSummaryPlanner.plan (cognitive 35) Modules/Core/AI/AIBookSummary.swift:150— AIBookSummaryPlanner.plan has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, loops 4 (5 pts), ternaries 3 (4 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.
AIReadingConversation.send (cognitive 35) Modules/Services/AI/AIReadingConversation.swift:77— AIReadingConversation.send has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, ternaries 3 (5 pts), error handling 2, loops 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.
RSSXMLParser.parser (cognitive 35) Modules/Services/RSS/RSSFetcher.swift:1365— RSSXMLParser.parser has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 12, 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.
yuedu_appApp.init (cognitive 35) Targets/Yuedu/SharedApp/yuedu_appApp.swift:78— yuedu_appApp.init has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (22 pts), error handling 3 (7 pts), loops 3 (6 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.
MarkdownRenderableNodeConverter.convertBody (cognitive 35) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:148— MarkdownRenderableNodeConverter.convertBody has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 1, ternaries 1 (nesting depth added 16). Of this number, 31 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_fixLazyImages (cognitive 35) Resources/Assets/Readability.js:2338— _fixLazyImages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). None of this is in the body itself: all 35 points belong to one function literal inside it that branches (line 2341). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
BookSourceFetcher.searchOutcome (cognitive 34) Modules/Core/BookSource/BookSourceFetcher+Search.swift:151— BookSourceFetcher.searchOutcome has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 5, match/switch 2 (4 pts), error handling 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplaceRuleEngine.edits (cognitive 34) Modules/Core/Replace/ReplaceRuleEngine.swift:216— ReplaceRuleEngine.edits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 18). Of this number, 32 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.parseJsoupSegment (cognitive 34) Modules/Core/RuleEngine/RuleEngine.swift:331— RuleEngine.parseJsoupSegment has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 8, ternaries 2 (8 pts), match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AozoraMarkupParser.parse (cognitive 34) Modules/Core/TXT/AozoraMarkupParser.swift:68— AozoraMarkupParser.parse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 7, loops 4 (6 pts), match/switch 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 13). Of this number, 33 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TXTEncodingDetector.multibyteMatch (cognitive 34) Modules/Core/TXT/TXTEncodingDetector.swift:140— TXTEncodingDetector.multibyteMatch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (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.
BookStore.delete (cognitive 34) Modules/Services/LibraryStore/BookStore.swift:1575— BookStore.delete has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QiThemeImporter.applyAppearance (cognitive 34) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:203— QiThemeImporter.applyAppearance has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 9, loops 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
queryElements (cognitive 34) REDACTED:90— queryElements has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 8 (11 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (2 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.
MarkerSearch.find (cognitive 33) Modules/Core/ReaderCore/MarkupMarkerSearch.swift:62— MarkerSearch.find has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (12 pts), boolean chains 4 (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.
RuleEngine.sanitizeExtractedURL (cognitive 33) Modules/Core/RuleEngine/RuleEngine.swift:955— RuleEngine.sanitizeExtractedURL has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9, ternaries 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.
RSSFetcher.fetchItems (cognitive 33) Modules/Services/RSS/RSSFetcher.swift:1133— RSSFetcher.fetchItems has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 5, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegexHighlightEngine.cascade (cognitive 33) Modules/Core/ReaderCore/CoreText/RegexHighlightEngine.swift:240— RegexHighlightEngine.cascade has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QiThemeImporter.chapterTitleStyle (cognitive 33) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:796— QiThemeImporter.chapterTitleStyle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 9, 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.
JsoupDefaultExtractor.getResultLast (cognitive 33) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:386— JsoupDefaultExtractor.getResultLast has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (10 pts), ternaries 1 (3 pts), boolean chains 1, 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.
LegadoRuleScope.callerNames (cognitive 33) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:271— LegadoRuleScope.callerNames has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 9, loops 2 (nesting depth added 12). Of this number, 29 points are the body's own statements and 4 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.
LegadoSharedJsLibrary.orderedKeys (cognitive 33) Modules/Core/RuleEngine/ModernParser/JS/LegadoSharedJsLibrary.swift:94— LegadoSharedJsLibrary.orderedKeys has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (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.
AIAgenticAssistant.run (cognitive 32) Modules/Core/AI/AIAgenticAssistant.swift:80— AIAgenticAssistant.run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 4 (9 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 14). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
RuleEngine.applyIndexSpec (cognitive 32) Modules/Core/RuleEngine/RuleEngine.swift:468— RuleEngine.applyIndexSpec has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (10 pts), loops 3 (7 pts), boolean chains 3, match/switch 1 (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.
ReaderView.scrollBody (cognitive 32) Modules/Features/Reader/ReaderView+TXTVerticalScroll.swift:11— ReaderView.scrollBody has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, ternaries 3 (6 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.
BookStore.commitRefreshedList (cognitive 32) Modules/Services/LibraryStore/BookStore.swift:2578— BookStore.commitRefreshedList has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 15 (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.
OfflineChapterStore.persistMangaImages (cognitive 32) Modules/Services/Offline/OfflineChapterStore.swift:237— OfflineChapterStore.persistMangaImages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (8 pts), error handling 4 (6 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.
OfflineDownloadManager.runBook (cognitive 32) Modules/Services/Offline/OfflineDownloadManager.swift:379— OfflineDownloadManager.runBook has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 4, loops 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.
RemoteLibraryService.prepare (cognitive 32) Modules/Services/RemoteLibrary/RemoteLibraryService.swift:179— RemoteLibraryService.prepare has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, error handling 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneratedCoverTextLayout.glyphs (cognitive 32) Modules/SharedUI/Components/GeneratedBookCover.swift:124— GeneratedCoverTextLayout.glyphs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (6 pts), boolean chains 5, loops 2 (4 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.
GlobalSettings.writeAppearanceExtras (cognitive 32) Targets/Yuedu/SharedApp/AppearanceThemeExtrasApplier.swift:187— GlobalSettings.writeAppearanceExtras has cognitive complexity 32 (threshold 15). Drivers by points: if/else 24 (25 pts), ternaries 3 (6 pts), boolean chains 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.
HTMLAttributedStringBuilder.buildChildren (cognitive 32) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:760— HTMLAttributedStringBuilder.buildChildren has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, error handling 1 (3 pts), 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.
UniversalBookResourceAdapter.rewriteResourceReferences (cognitive 31) Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:160— UniversalBookResourceAdapter.rewriteResourceReferences has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 4 (5 pts), boolean chains 2 (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.
RelatedWorks.pick (cognitive 31) Modules/Services/Works/RelatedWorks.swift:22— RelatedWorks.pick has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (31 pts), loops 8 (11 pts), boolean chains 6 (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. This shape REPEATS in the file: one other method here (RelatedWorks.pick::addWorks) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SearchWorkResolver.resolve (cognitive 31) Modules/Services/Works/SearchWorkResolver.swift:121— SearchWorkResolver.resolve has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 8 (13 pts), ternaries 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.
GlobalSettings.init (cognitive 31) Targets/Yuedu/SharedApp/GlobalSettings.swift:2121— GlobalSettings.init has cognitive complexity 31 (threshold 15). Drivers by points: if/else 24, boolean chains 3, ternaries 3, match/switch 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.
ChapterTitleHTMLCodec.parseCanonical (cognitive 31) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:183— ChapterTitleHTMLCodec.parseCanonical has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 7 (10 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). 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.
LegadoBase64.androidDecode (cognitive 31) Modules/Core/RuleEngine/ModernParser/JS/LegadoBase64.swift:36— LegadoBase64.androidDecode has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), match/switch 2 (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.
LegadoRuleScope.seededNames (cognitive 31) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:353— LegadoRuleScope.seededNames has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 9, match/switch 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 28 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.
ReaderHTMLUtilities.reviewTarget (cognitive 30) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1837— ReaderHTMLUtilities.reviewTarget has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 7 (12 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.
TTSAudioPayload.looksLikeAudioContainer (cognitive 30) Modules/Core/TTS/TTSAudioProvider.swift:256— TTSAudioPayload.looksLikeAudioContainer has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 21, if/else 9. 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.
BookReaderContent.body (cognitive 30) Modules/Features/Reader/BookReaderView.swift:73— BookReaderContent.body has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, error handling 4, 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.
CoreTextCollectionScrollViewController.commitViewportGeometry (cognitive 30) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1924— CoreTextCollectionScrollViewController.commitViewportGeometry has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 9, 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.
ReaderBookSearchSession.run (cognitive 30) Modules/Features/Reader/ReaderBookSearchSession.swift:220— ReaderBookSearchSession.run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, error handling 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserPage.addressField (cognitive 30) Modules/Features/WebBrowser/BrowserView.swift:1053— BrowserPage.addressField has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 10 (13 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.
ChapterFetcher.looksLikeRejectedChapterPage (cognitive 30) Modules/Services/Online/ChapterFetcher.swift:888— ChapterFetcher.looksLikeRejectedChapterPage has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 27, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RuleModule.localized (cognitive 30) Modules/Services/RuleModules/RuleModule.swift:534— RuleModule.localized has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (6 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.
WebDAVPropfindParserDelegate.parser (cognitive 30) Modules/Services/WebDAV/WebDAVBrowseClient.swift:119— WebDAVPropfindParserDelegate.parser has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 4, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaginator.applyOrphanControl (cognitive 30) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2426— CoreTextPaginator.applyOrphanControl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 7, loops 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.
MarkdownInlineParser.parse (cognitive 30) Modules/Core/ReaderCore/CoreText/MarkdownAttributedStringBuilder.swift:391— MarkdownInlineParser.parse has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 12). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModernParserBridge.parseTOC (cognitive 30) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1363— ModernParserBridge.parseTOC has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 3 (9 pts), boolean chains 3, loops 2 (3 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.
CoreTextHorizontalLineDrawer.drawInlineBorderBoxes (cognitive 30) Modules/Core/ReaderCore/CoreText/CoreTextHorizontal/CoreTextHorizontalLineDrawer.swift:250— CoreTextHorizontalLineDrawer.drawInlineBorderBoxes has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (27 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.
legado-engine.getList (cognitive 30) REDACTED:127— legado-engine.getList has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, ternaries 3 (5 pts), error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 10). Of this number, 26 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookSourceFetcher.fetchWebContent (cognitive 29) Modules/Core/BookSource/BookSourceFetcher+WebContent.swift:10— BookSourceFetcher.fetchWebContent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 3 (8 pts), error handling 2 (3 pts), boolean chains 1, 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.
TXTChapterParser.enumerateMappedTitleLines (cognitive 29) Modules/Core/TXT/TXTChapterParser.swift:938— TXTChapterParser.enumerateMappedTitleLines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, ternaries 3 (5 pts), loops 2 (3 pts) (nesting depth added 9). Of this number, 24 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Multibyte.character (cognitive 29) Modules/Core/TXT/TXTEncodingDetector.swift:39— Multibyte.character has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 13, 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.
ReaderNavigationTransitionDriver.handleEdgePan (cognitive 29) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:280— ReaderNavigationTransitionDriver.handleEdgePan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 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.
Mapper.entry (cognitive 29) Modules/Services/OPDS/OPDS2FeedParser.swift:137— Mapper.entry has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, loops 3 (4 pts), match/switch 1 (3 pts), ternaries 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.
OfflineChapterStore.persistTextImages (cognitive 29) Modules/Services/Offline/OfflineChapterStore.swift:374— OfflineChapterStore.persistTextImages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (10 pts), boolean chains 3, error handling 1 (3 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.
ChapterFetcher.reattachStandaloneParagraphReviews (cognitive 29) Modules/Services/Online/ChapterFetcher.swift:404— ChapterFetcher.reattachStandaloneParagraphReviews has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, error handling 1 (2 pts), loops 2 (nesting depth added 7). Of this number, 25 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RSSXMLParser.parser (cognitive 29) Modules/Services/RSS/RSSFetcher.swift:1402— RSSXMLParser.parser has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 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.
RuleModuleValidator.validateScope (cognitive 29) Modules/Services/RuleModules/RuleModuleValidator.swift:697— RuleModuleValidator.validateScope has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 3 (7 pts), boolean chains 2 (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.
ReaderBackgroundMigration.migrateSavedBackgrounds (cognitive 29) Targets/Yuedu/SharedApp/ReaderBackgroundMigration.swift:48— ReaderBackgroundMigration.migrateSavedBackgrounds has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 3 (5 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.
CoreTextPageView.handleTap (cognitive 29) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1474— CoreTextPageView.handleTap has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 8 (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.
HTMLAttributedStringBuilder.resolveCalc (cognitive 29) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2450— HTMLAttributedStringBuilder.resolveCalc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (11 pts), boolean chains 3, loops 2 (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.
ReaderTextDecorationRenderer.paint (cognitive 29) Modules/Core/ReaderCore/CoreText/ReaderTextDecorationRenderer.swift:159— ReaderTextDecorationRenderer.paint has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 5 (16 pts), if/else 4 (7 pts), loops 2 (3 pts), match/switch 1 (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.
HighlightPackImporter.parseQiReader (cognitive 29) Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:174— HighlightPackImporter.parseQiReader has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (42 pts), boolean chains 10, error handling 4 (6 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (HighlightPackImporter.parseQiReader::style) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ReaderStyleDeclarationScanner.scan (cognitive 29) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:35— ReaderStyleDeclarationScanner.scan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 28 (47 pts), boolean chains 8, loops 3 (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. This shape REPEATS in the file: one other method here (ReaderStyleDeclarationScanner.scan::declaration) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
OrderedJSON.appendJSON (cognitive 29) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:115— OrderedJSON.appendJSON has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 2 (4 pts), boolean chains 2 (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.
KeyOrderScanner.walkObject (cognitive 29) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:297— KeyOrderScanner.walkObject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleAnalyzer.chompCodeBalanced (cognitive 29) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:282— RuleAnalyzer.chompCodeBalanced has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 5, loops 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.
AnalyzeUrl.parseOptions (cognitive 29) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:550— AnalyzeUrl.parseOptions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
UIImage.trimmingTransparentPixels (cognitive 29) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1813— UIImage.trimmingTransparentPixels has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (3 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.
errors.mapIdentityToolkitError (cognitive 29) gateway/src/errors.ts:96— errors.mapIdentityToolkitError has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18, boolean chains 10, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AIReadingEvidence.requestedChapters (cognitive 28) Modules/Core/AI/AIReadingEvidence.swift:53— AIReadingEvidence.requestedChapters has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (10 pts), ternaries 2 (4 pts), loops 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.
CalibreCFIMapper.match (cognitive 28) Modules/Core/EPUB/CalibreCFIMapper.swift:36— CalibreCFIMapper.match has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 9, loops 3 (nesting depth added 6). Of this number, 18 points are the body's own statements and 10 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.
PublicationSession.parseOPFMetadataXML (cognitive 28) Modules/Core/EPUB/PublicationSession.swift:1364— PublicationSession.parseOPFMetadataXML has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (25 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportedBookPresentationController.presentPending (cognitive 28) Modules/Features/Bookshelf/ImportedBookPresentation.swift:110— ImportedBookPresentationController.presentPending has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 8, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaintFragment.make (cognitive 28) Modules/Features/Reader/CoreTextPaintFragment.swift:17— CoreTextPaintFragment.make has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 4 (6 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.
ReaderView.applyChapterRefreshAction (cognitive 28) Modules/Features/Reader/ReaderView+OnlineChapterLoading.swift:158— ReaderView.applyChapterRefreshAction has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 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.
OfflineDownloadManager.reconcileInterruptedDownloads (cognitive 28) Modules/Services/Offline/OfflineDownloadManager.swift:232— OfflineDownloadManager.reconcileInterruptedDownloads has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 4 (7 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.
ChapterAlignment.alignedIndex (cognitive 28) Modules/Services/Online/ChapterAlignment.swift:35— ChapterAlignment.alignedIndex has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 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.
GlobalSettings.writeReadingSettings (cognitive 28) Targets/Yuedu/SharedApp/AppearanceThemeReadingApplier.swift:371— GlobalSettings.writeReadingSettings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 7). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModernRuleEngine.extractElementsWithOperators (cognitive 28) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1024— ModernRuleEngine.extractElementsWithOperators has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 4 (8 pts), boolean chains 6, 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.
JSCoreEngine.extractBytes (cognitive 28) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:818— JSCoreEngine.extractBytes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, ternaries 2 (4 pts), 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.
AIAnswerMarkdown.blocks (cognitive 27) Modules/Core/AI/AIAnswerMarkdown.swift:24— AIAnswerMarkdown.blocks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnlineBookContentInference.kind (cognitive 27) Modules/Core/BookSource/BookSource.swift:674— OnlineBookContentInference.kind has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 18, if/else 9. 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.
BookSourceDebugEngine.runTOC (cognitive 27) Modules/Core/BookSource/BookSourceDebugEngine.swift:146— BookSourceDebugEngine.runTOC has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 4 (7 pts), loops 1 (3 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PublicationSession.makeSession (cognitive 27) Modules/Core/EPUB/PublicationSession.swift:720— PublicationSession.makeSession has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, ternaries 2 (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.
AudiobookDetailView.body (cognitive 27) Modules/Features/BookDetail/AudiobookDetailView.swift:233— AudiobookDetailView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 7 (9 pts), boolean chains 3, 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.
OnlineBookView.body (cognitive 27) Modules/Features/BookDetail/OnlineBookView.swift:261— OnlineBookView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 3 (5 pts), boolean chains 2, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UserDetailView.body (cognitive 27) Modules/Features/Settings/UserDetailView.swift:40— UserDetailView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, ternaries 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.
OpenAICompatibleProvider.stream (cognitive 27) Modules/Services/AI/OpenAICompatibleProvider.swift:244— OpenAICompatibleProvider.stream has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (5 pts), error handling 4, match/switch 1 (2 pts) (nesting depth added 13). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
ReaderRenderSettings.refreshIntent (cognitive 27) Modules/Core/ReaderCore/ReaderRenderRefresh.swift:147— ReaderRenderSettings.refreshIntent has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 24, ternaries 2, if/else 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.
DiscoverViewModel.reload (cognitive 27) Modules/Services/Online/DiscoverViewModel.swift:489— DiscoverViewModel.reload has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), error handling 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.
ChapterComments.thread (cognitive 27) Modules/Services/Works/ChapterComments.swift:52— ChapterComments.thread has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (4 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.
CommentBubbleSVGRecognizer.parseTransform (cognitive 27) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1042— CommentBubbleSVGRecognizer.parseTransform has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5 (9 pts), match/switch 1 (2 pts), loops 1 (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.
EmbeddedTrueTypeFontIdentity.namespaced (cognitive 27) Modules/Core/ReaderCore/CoreText/EmbeddedTrueTypeFontIdentity.swift:6— EmbeddedTrueTypeFontIdentity.namespaced has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (5 pts), boolean chains 4 (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.
ReaderStyleDeclarationScanner.scan::declaration (cognitive 27) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:55— ReaderStyleDeclarationScanner.scan::declaration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ReaderStyleDeclarationScanner.scan) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
XPathExtractor.splitXPathAndAccessor (cognitive 27) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:413— XPathExtractor.splitXPathAndAccessor has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 9, loops 1, ternaries 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.
WebDAVProvider.fixedHTTPDate (cognitive 27) Modules/Services/Works/HomeSectionProviding.swift:277— WebDAVProvider.fixedHTTPDate has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, if/else 3 (4 pts), ternaries 3, loops 1 (nesting depth added 1). Of this number, 24 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
Lexer.skipNumber (cognitive 27) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:259— Lexer.skipNumber has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, loops 5 (9 pts), if/else 4 (5 pts), ternaries 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.
_unwrapNoscriptImages (cognitive 27) Resources/Assets/Readability.js:1898— _unwrapNoscriptImages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 14). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 1923, 1902). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
RuleEngine.routeExtractValue (cognitive 26) Modules/Core/RuleEngine/RuleEngine.swift:167— RuleEngine.routeExtractValue has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (3 pts), match/switch 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.
TXTChapterParser.skipLeadingWhitespaceBytes (cognitive 26) Modules/Core/TXT/TXTChapterParser.swift:750— TXTChapterParser.skipLeadingWhitespaceBytes has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (9 pts), loops 2 (3 pts), 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.
FixedPageReaderView.readerContent (cognitive 26) Modules/Features/FixedPageReader/FixedPageReaderView.swift:95— FixedPageReaderView.readerContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, ternaries 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.
RuleModuleRepositoryIndex.parse (cognitive 26) Modules/Services/RuleModules/RuleModuleRepository.swift:31— RuleModuleRepositoryIndex.parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataResolver.resolve (cognitive 26) Modules/Services/Works/MetadataResolver.swift:37— MetadataResolver.resolve has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, loops 3 (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.
CoreTextPageView.handleSelectionHandlePan (cognitive 26) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1682— CoreTextPageView.handleSelectionHandlePan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, match/switch 2 (5 pts), ternaries 1 (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.
CoreTextPaginator.standaloneImageRenderableRect (cognitive 26) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3355— CoreTextPaginator.standaloneImageRenderableRect has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 3 (8 pts), ternaries 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterLayout.appearanceUpdated (cognitive 26) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:374— ChapterLayout.appearanceUpdated has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 4, error handling 2, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DirtyHTMLParser.parse (cognitive 26) Modules/Core/ReaderCore/CoreText/DirtyHTMLParser.swift:9— DirtyHTMLParser.parse has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderStylePackage.validateManifest (cognitive 26) Modules/Core/ReaderCore/Customization/ReaderStylePackage.swift:332— ReaderStylePackage.validateManifest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, error handling 2 (4 pts), loops 3 (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.
RuleAnalyzer.splitRulePhase1 (cognitive 26) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:348— RuleAnalyzer.splitRulePhase1 has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (7 pts), ternaries 1 (2 pts), boolean chains 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.
SourceRule.makeUpRule (cognitive 26) Modules/Core/RuleEngine/ModernParser/SourceRule.swift:142— SourceRule.makeUpRule has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 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.
XPathExtractor.evaluateXPathForStrings (cognitive 26) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:369— XPathExtractor.evaluateXPathForStrings has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), ternaries 2 (5 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.
LegadoSymmetricCipher.commonCrypto (cognitive 26) Modules/Core/RuleEngine/ModernParser/JS/LegadoSymmetricCipher.swift:133— LegadoSymmetricCipher.commonCrypto has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, if/else 8 (10 pts), ternaries 3 (4 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
BrowserScrollTileCell.configure (cognitive 25) Modules/Features/Reader/BrowserScrollTileCell.swift:174— BrowserScrollTileCell.configure has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (8 pts), ternaries 2 (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.
Coordinator.handleChapterReady (cognitive 25) Modules/Features/Reader/CoreTextPagedView.swift:1564— Coordinator.handleChapterReady has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 10, ternaries 2 (4 pts) (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.
CustomizationImportOverview.appearanceItems (cognitive 25) Modules/Features/Settings/CustomizationImportOverview.swift:332— CustomizationImportOverview.appearanceItems has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, ternaries 2 (3 pts) (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.
HTTPResponseReader.advance (cognitive 25) Modules/Services/Network/SingleWriteHTTPExchange.swift:652— HTTPResponseReader.advance has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTTPResponseReader.readChunks (cognitive 25) Modules/Services/Network/SingleWriteHTTPExchange.swift:690— HTTPResponseReader.readChunks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 1, 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.
ChapterAlignment.numericValue (cognitive 25) Modules/Services/Online/ChapterAlignment.swift:199— ChapterAlignment.numericValue has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegadoSourceJSONParser.exportJSON (cognitive 25) Modules/Services/RSS/LegadoSourceJSONParser.swift:84— LegadoSourceJSONParser.exportJSON has cognitive complexity 25 (threshold 15). Drivers by points: if/else 25. 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.
WorkIndexService.compute (cognitive 25) Modules/Services/Works/WorkIndexService.swift:235— WorkIndexService.compute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, match/switch 1 (3 pts), ternaries 1 (3 pts), loops 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.
BrowserLayoutPageEngine.decideEngine (cognitive 25) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:711— BrowserLayoutPageEngine.decideEngine has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 3, error handling 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.
OnlineProviderAttributedStringBuilder.chapterFormatProbe (cognitive 25) Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:869— OnlineProviderAttributedStringBuilder.chapterFormatProbe has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 10). Of this number, 21 points are the body's own statements and 4 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.
ReaderDialogueBubbleMarker.plan (cognitive 25) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleMarker.swift:91— ReaderDialogueBubbleMarker.plan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderStyleAssetStore.importValidatedPackageAssets (cognitive 25) Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:430— ReaderStyleAssetStore.importValidatedPackageAssets has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 6 (8 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceRule.parseTemplateParameters (cognitive 25) Modules/Core/RuleEngine/ModernParser/SourceRule.swift:320— SourceRule.parseTemplateParameters has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, 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.
VideoPlayerView.body (cognitive 25) Modules/Features/Reader/Video/VideoPlayerView.swift:46— VideoPlayerView.body has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, 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.
RefreshPreparation.preparePaged (cognitive 24) Modules/Core/ReaderCore/EPUBPageRenderer.swift:185— RefreshPreparation.preparePaged has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), match/switch 3 (4 pts), boolean chains 3 (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.
CustomHTTPProvider.buildJSRequestOrThrow (cognitive 24) Modules/Core/TTS/TTSAudioProvider.swift:728— CustomHTTPProvider.buildJSRequestOrThrow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 6, 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.
TTSDialogueRoster.merge (cognitive 24) Modules/Core/TTS/TTSDialogueModel.swift:189— TTSDialogueRoster.merge has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (7 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.
TXTEncodingDetector.detect (cognitive 24) Modules/Core/TXT/TXTEncodingDetector.swift:80— TXTEncodingDetector.detect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, loops 2, ternaries 1 (2 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.
BookDetailScaffold.body (cognitive 24) Modules/Features/BookDetail/BookDetailComponents.swift:247— BookDetailScaffold.body has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (9 pts), boolean chains 3 (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.
CalibreWirelessView.body (cognitive 24) Modules/Features/Bookshelf/CalibreWirelessView.swift:16— CalibreWirelessView.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextCollectionScrollViewController.applyReadingPositionIfPossible (cognitive 24) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1256— CoreTextCollectionScrollViewController.applyReadingPositionIfPossible has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookReaderSettingsStore.migrateLegacyFixedPageReadingModes (cognitive 24) Modules/Services/LibraryStore/BookReaderSettingsStore.swift:117— BookReaderSettingsStore.migrateLegacyFixedPageReadingModes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineChapterStore.reconcileBook (cognitive 24) Modules/Services/Offline/OfflineChapterStore.swift:448— OfflineChapterStore.reconcileBook has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 2 (4 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.
ChapterFetchManager.fetchBrowserImportedChapter (cognitive 24) Modules/Services/Online/OnlineReadingPipeline.swift:825— ChapterFetchManager.fetchBrowserImportedChapter has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataFillRunner.fill (cognitive 24) Modules/Services/Works/MetadataFill.swift:222— MetadataFillRunner.fill has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RootTabBarTransitionCover.pageWillChange (cognitive 24) Modules/SharedUI/Adaptive/RootTabBarTransitionCover.swift:53— RootTabBarTransitionCover.pageWillChange has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 16, if/else 7, ternaries 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.
CoreTextPageView.editMenuInteraction (cognitive 24) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:421— CoreTextPageView.editMenuInteraction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, ternaries 6 (7 pts), boolean chains 4, loops 1 (2 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.
CoreTextPaginator.debugUnitDescription (cognitive 24) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2285— CoreTextPaginator.debugUnitDescription has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (21 pts), 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.
NodeAttributedStringRenderer.applyVerticalSealBreaks (cognitive 24) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:917— NodeAttributedStringRenderer.applyVerticalSealBreaks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, loops 3 (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.
ReviewCardTemplate.expanded (cognitive 24) Modules/Core/ReaderCore/CoreText/ReviewCardTemplate.swift:248— ReviewCardTemplate.expanded has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppearanceThemeExtras.isEmpty (cognitive 24) Modules/Core/ReaderCore/Customization/AppearanceThemeExtras.swift:246— AppearanceThemeExtras.isEmpty has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 24. 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.
auth.authRouter (cognitive 24) REDACTED:25— auth.authRouter has cognitive complexity 24 (threshold 15). Drivers by points: error handling 12, if/else 8 (9 pts), ternaries 2, boolean chains 1 (nesting depth added 1). None of this is in the body itself: all 24 points belong to 11 function literals inside it that branch (lines 160, 188, 92, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AIMemoryPlanner.plan (cognitive 23) Modules/Core/AI/AICharacterMemoryPlanner.swift:11— AIMemoryPlanner.plan has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (6 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 5). 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.
BookSource.legacySearchURLParts (cognitive 23) Modules/Core/BookSource/BookSourceURLRendering.swift:107— BookSource.legacySearchURLParts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 1, 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.
BookSourceDebugEngine.debugEntry (cognitive 23) Modules/Core/BookSource/BookSourceDebugEngine.swift:314— BookSourceDebugEngine.debugEntry has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (22 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FixedLayoutSpreadPairingBuilder.build (cognitive 23) Modules/Core/EPUB/PublicationSession.swift:92— FixedLayoutSpreadPairingBuilder.build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2, boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). Of this number, 20 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderHTMLUtilities.reviewMarkupDiagnostics (cognitive 23) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:839— ReaderHTMLUtilities.reviewMarkupDiagnostics has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (4 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.
ReaderHTMLUtilities.qidianReviewTarget (cognitive 23) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1917— ReaderHTMLUtilities.qidianReviewTarget has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 6 (7 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.parseXPathSegment (cognitive 23) Modules/Core/RuleEngine/RuleEngine.swift:1149— RuleEngine.parseXPathSegment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, 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.
OPDSFeedView.body (cognitive 23) Modules/Features/Bookshelf/OPDSImportView.swift:232— OPDSFeedView.body has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ReaderCardTransitionAnimator.interruptibleAnimator (cognitive 23) Modules/Features/Reader/ReaderCardTransitionAnimator.swift:119— ReaderCardTransitionAnimator.interruptibleAnimator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 7 (8 pts), boolean chains 5, 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.
AIBookContentAdapter.init (cognitive 23) Modules/Services/AI/AIBookContentAdapter.swift:21— AIBookContentAdapter.init has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (18 pts), boolean chains 2, if/else 2, 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.
AIRecommendationService.fillCovers (cognitive 23) Modules/Services/AI/AIRecommendationService.swift:270— AIRecommendationService.fillCovers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, match/switch 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.
CalibreWirelessService.connect (cognitive 23) Modules/Services/Calibre/CalibreWirelessService.swift:157— CalibreWirelessService.connect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (5 pts), boolean chains 1, error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookStore.rereadTXTHeaders (cognitive 23) Modules/Services/LibraryStore/BookStore.swift:3500— BookStore.rereadTXTHeaders has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, loops 3, error handling 1 (2 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookStore.mergeOnlineChapters (cognitive 23) Modules/Services/LibraryStore/BookStore.swift:3784— BookStore.mergeOnlineChapters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, loops 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.
HomeDefaultsLanguageSwap.apply (cognitive 23) Modules/Services/Works/HomeDefaultsLanguageSwap.swift:38— HomeDefaultsLanguageSwap.apply has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (8 pts), loops 1, ternaries 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
WebDAVIndexCoordinator.refreshStatuses (cognitive 23) Modules/Services/Works/WebDAVIndexCoordinator.swift:340— WebDAVIndexCoordinator.refreshStatuses has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (7 pts), boolean chains 5, match/switch 1 (2 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.
LanguageTag.init (cognitive 23) Modules/Services/Works/WorkMatchKey.swift:160— LanguageTag.init has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 6 (7 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.
SVGPathParser.numberEnd (cognitive 23) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1582— SVGPathParser.numberEnd has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 5). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaginator.computeExplicitBlockRenderableRect (cognitive 23) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3440— CoreTextPaginator.computeExplicitBlockRenderableRect has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 9, match/switch 1 (2 pts), ternaries 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.
CoreTextPaginator.makeBlockImageAttachment (cognitive 23) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3532— CoreTextPaginator.makeBlockImageAttachment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeAttributedStringRenderer.renderInlineImage (cognitive 23) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1447— NodeAttributedStringRenderer.renderInlineImage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReviewCardContent.comments (cognitive 23) Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:171— ReviewCardContent.comments has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JSONPathEvaluator.findComparison (cognitive 23) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:441— JSONPathEvaluator.findComparison has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 4, loops 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.
ModernRuleEngine.modeQualifiedRule (cognitive 23) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:766— ModernRuleEngine.modeQualifiedRule has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 5 (10 pts), match/switch 1 (nesting depth added 5). 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.
RuleAnalyzer.splitRulePhase2 (cognitive 23) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:420— RuleAnalyzer.splitRulePhase2 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (7 pts), ternaries 1 (2 pts), boolean chains 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.
SourceRule.extractPutDirectives (cognitive 23) Modules/Core/RuleEngine/ModernParser/SourceRule.swift:271— SourceRule.extractPutDirectives has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), ternaries 1 (4 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.
StatementReader.skipGroup (cognitive 23) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:494— StatementReader.skipGroup has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 1 (nesting depth added 15). 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.
ruleEngine.safeQuerySelectorAll (cognitive 23) REDACTED:74— ruleEngine.safeQuerySelectorAll has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (10 pts), error handling 3 (5 pts), boolean chains 4, if/else 4 (nesting depth added 7). Of this number, 21 points are the body's own statements and 2 belong to one function literal 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.
ruleEngine.splitTopLevel (cognitive 23) REDACTED:170— ruleEngine.splitTopLevel has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, ternaries 1 (2 pts), loops 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.
ruleEngine.getElementsBySegment (cognitive 23) REDACTED:566— ruleEngine.getElementsBySegment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1 (2 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.
AIMemoryExtraction.input (cognitive 22) Modules/Core/AI/AICharacterMemoryExtraction.swift:19— AIMemoryExtraction.input has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (7 pts), boolean chains 3 (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.
AIQuestionContext.safeHistory (cognitive 22) Modules/Core/AI/AIQuestionContext.swift:76— AIQuestionContext.safeHistory has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, loops 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.
BookSourceHealthChecker.runGroup (cognitive 22) Modules/Core/BookSource/BookSourceHealthChecker.swift:649— BookSourceHealthChecker.runGroup has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (6 pts), boolean chains 4, loops 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.
BookSourceStore.parseYDS (cognitive 22) Modules/Core/BookSource/BookSourceStore.swift:975— BookSourceStore.parseYDS has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MOBIIndex.entry (cognitive 22) Modules/Core/MOBI/MOBIIndex.swift:89— MOBIIndex.entry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (8 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.
ReaderPositionSentry.observeCommit (cognitive 22) Modules/Core/ReaderCore/ReaderPositionSentry.swift:243— ReaderPositionSentry.observeCommit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 4 (6 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.
WebNovelParser.parseTOC (cognitive 22) Modules/Core/RuleEngine/WebNovelParser.swift:53— WebNovelParser.parseTOC has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, 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.
TXTLocationMigration.position (cognitive 22) Modules/Core/TXT/TXTLocationMigration.swift:134— TXTLocationMigration.position has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 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.
BookDetailChapterSection.content (cognitive 22) Modules/Features/BookDetail/BookDetailComponents.swift:1842— BookDetailChapterSection.content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (8 pts), boolean chains 3, match/switch 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.
BookSourceFormLoginView.configureLegadoRuntime (cognitive 22) Modules/Features/BookSource/BookSourceFormLoginView.swift:812— BookSourceFormLoginView.configureLegadoRuntime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 1 (3 pts), boolean chains 2, loops 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.
HomeView.body (cognitive 22) Modules/Features/Bookshelf/HomeView.swift:598— HomeView.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, ternaries 3 (5 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.
RemoteLibraryManagementView.body (cognitive 22) Modules/Features/Bookshelf/RemoteLibraryManagementView.swift:19— RemoteLibraryManagementView.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AIDialogueCastService.startBatch (cognitive 22) Modules/Services/AI/AIDialogueCastService.swift:302— AIDialogueCastService.startBatch has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (6 pts), boolean chains 2, 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.
BookStore.commitTXTBookmarks (cognitive 22) Modules/Services/LibraryStore/BookStore.swift:3096— BookStore.commitTXTBookmarks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (4 pts), boolean chains 3, error handling 2 (3 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.
RSSXMLParserDelegate.parser (cognitive 22) Modules/Services/RSS/RSSFetcher.swift:254— RSSXMLParserDelegate.parser has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 10 (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.
FirestoreSyncMerge.merge (cognitive 22) Modules/Services/iCloud/FirestoreSyncManager.swift:704— FirestoreSyncMerge.merge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3, 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.
GlobalSettings.restoreReaderBackgrounds (cognitive 22) Targets/Yuedu/SharedApp/ReaderCustomBackgroundStore.swift:238— GlobalSettings.restoreReaderBackgrounds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts), 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.
yuedu_appApp.body (cognitive 22) Targets/Yuedu/SharedApp/yuedu_appApp.swift:233— yuedu_appApp.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, ternaries 2 (3 pts), 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.
BrowserLayoutPageEngine.pageViewController (cognitive 22) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1589— BrowserLayoutPageEngine.pageViewController has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 4 (8 pts), boolean chains 3, 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.
CoreTextPageView.renderPage (cognitive 22) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:746— CoreTextPageView.renderPage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 4 (5 pts), ternaries 3 (4 pts), boolean chains 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.
HTMLAttributedStringBuilder.applyMarginShorthand (cognitive 22) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:2349— HTMLAttributedStringBuilder.applyMarginShorthand has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 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.
ReaderDialogueBubbleMarker.apply (cognitive 22) Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleMarker.swift:184— ReaderDialogueBubbleMarker.apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (8 pts), loops 2 (3 pts), boolean chains 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.
SVGValidation.validateAttributes (cognitive 22) Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:625— SVGValidation.validateAttributes has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, 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.
ReaderStylePackage.importContents (cognitive 22) Modules/Core/ReaderCore/Customization/ReaderStylePackage.swift:208— ReaderStylePackage.importContents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 4 (5 pts), loops 3, 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.
ReedenThemeImporter.highlightRules (cognitive 22) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:719— ReedenThemeImporter.highlightRules has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, error handling 2 (5 pts), ternaries 2 (4 pts), loops 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.
ModernParserBridge.exploreItems (cognitive 22) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2407— ModernParserBridge.exploreItems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 4, ternaries 1 (2 pts) (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.
ModernRuleEngine.getStringList (cognitive 22) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:299— ModernRuleEngine.getStringList has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 2 (3 pts), boolean chains 2, loops 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.
OrderedJSON.javaDouble (cognitive 22) Modules/Core/RuleEngine/ModernParser/OrderedJSON.swift:202— OrderedJSON.javaDouble has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (6 pts), boolean chains 4, loops 2 (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.
ModuleListPage.content (cognitive 22) Modules/Features/Library/Modules/ModuleListPage.swift:38— ModuleListPage.content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (7 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.
AnalyzeUrl.javaAbsoluteURL (cognitive 22) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:687— AnalyzeUrl.javaAbsoluteURL has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 10 (11 pts) (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.
Data.startsWithASCII (cognitive 22) Modules/Services/RSS/RSSFetcher.swift:36— Data.startsWithASCII has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 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.
policy.sanitizePreferences (cognitive 22) gateway/src/policy.ts:146— policy.sanitizePreferences has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 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.
AIPublicationChunker.mergedSpans (cognitive 21) Modules/Core/AI/AIChunking.swift:239— AIPublicationChunker.mergedSpans has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5 (6 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
SourceAPIErrorLog.chapterTransportFailureMessage (cognitive 21) Modules/Core/BookSource/SourceAPIErrorLog.swift:199— SourceAPIErrorLog.chapterTransportFailureMessage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (6 pts) (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.
ReaderTOCSelection.currentChapter (cognitive 21) Modules/Core/ReaderCore/ReaderPageTypes.swift:16— ReaderTOCSelection.currentChapter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.routeExtractValue (cognitive 21) Modules/Core/RuleEngine/RuleEngine.swift:237— RuleEngine.routeExtractValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 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.
EdgeTTSWebSocketTransport.synthesize (cognitive 21) Modules/Core/TTS/EdgeTTSAudioProvider.swift:63— EdgeTTSWebSocketTransport.synthesize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 1, 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.
EdgeTTSProtocol.event (cognitive 21) REDACTED:135— EdgeTTSProtocol.event has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TTSAutoCast.assign (cognitive 21) Modules/Core/TTS/TTSAutoCast.swift:23— TTSAutoCast.assign has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, loops 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.
TTSChunkAudioPlayer.fillBufferQueue (cognitive 21) Modules/Core/TTS/TTSChunkAudioPlayer.swift:336— TTSChunkAudioPlayer.fillBufferQueue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), boolean chains 2, 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.
TXTMetadataProbe.introduction (cognitive 21) Modules/Core/TXT/TXTMetadataProbe.swift:97— TXTMetadataProbe.introduction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 1, ternaries 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.
RSSFeedView.body (cognitive 21) Modules/Features/RSS/RSSFeedView.swift:230— RSSFeedView.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (8 pts), boolean chains 4 (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.
CoreTextCollectionScrollViewController.update (cognitive 21) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:755— CoreTextCollectionScrollViewController.update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, 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.
ReaderNavigationTransitionDriver.schedulePendingReconciliation (cognitive 21) Modules/Features/Reader/ReaderNavigationTransitionDriver.swift:524— ReaderNavigationTransitionDriver.schedulePendingReconciliation has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), match/switch 2 (4 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.
ReaderSettingsExportSnapshot.make (cognitive 21) Modules/Features/Reader/ReaderSettingsImportService.swift:464— ReaderSettingsExportSnapshot.make has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 2 (4 pts), loops 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.
ReaderViewModel.startFetchTask (cognitive 21) Modules/Features/Reader/ReaderViewModel.swift:583— ReaderViewModel.startFetchTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AIChapterTranslationService.run (cognitive 21) Modules/Services/AI/AIChapterTranslationService.swift:149— AIChapterTranslationService.run has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 3 (6 pts), ternaries 1 (3 pts), boolean chains 2, error handling 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.
CalibreWireBuffer.nextFrame (cognitive 21) Modules/Services/Calibre/CalibreWirelessProtocol.swift:74— CalibreWireBuffer.nextFrame has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, error handling 1, 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.
BookStore.reconcileOfflineTaskMetadata (cognitive 21) Modules/Services/LibraryStore/BookStore.swift:2739— BookStore.reconcileOfflineTaskMetadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 2 (4 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.
HTMLResponseDecoder.decode (cognitive 21) Modules/Services/Network/HTMLResponseDecoder.swift:16— HTMLResponseDecoder.decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 2, ternaries 1 (nesting depth added 5). Of this number, 16 points are the body's own statements and 5 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AozoraCatalogStore.load (cognitive 21) Modules/Services/PublicLibrary/AozoraCatalogStore.swift:74— AozoraCatalogStore.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AozoraLibraryDownloadService.importWork (cognitive 21) Modules/Services/PublicLibrary/AozoraLibraryDownloadService.swift:65— AozoraLibraryDownloadService.importWork has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), error handling 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubscriptionStore.purchase (cognitive 21) Modules/Services/Subscription/SubscriptionStore.swift:411— SubscriptionStore.purchase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (5 pts), match/switch 1 (2 pts), boolean chains 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.
HomeModel.fetch (cognitive 21) Modules/Services/Works/HomeModel.swift:267— HomeModel.fetch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, error handling 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.
WorkIndex.editions (cognitive 21) Modules/Services/Works/WorkIndex.swift:293— WorkIndex.editions has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 2 (6 pts), ternaries 2 (6 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.
ReaderConfig.setupBindings (cognitive 21) Targets/Yuedu/SharedApp/GlobalSettings.swift:388— ReaderConfig.setupBindings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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.
CoreTextScrollEngine.chunkIndex (cognitive 21) Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:1103— CoreTextScrollEngine.chunkIndex has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, 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.
DialogueHighlighter.dialogueRanges (cognitive 21) Modules/Core/ReaderCore/CoreText/DialogueHighlighter.swift:119— DialogueHighlighter.dialogueRanges has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, 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.
RegexHighlightEngine.applyTextStyle (cognitive 21) Modules/Core/ReaderCore/CoreText/RegexHighlightEngine.swift:316— RegexHighlightEngine.applyTextStyle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (3 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.
ReaderStyleCSSCodec.parseGradient (cognitive 21) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:848— ReaderStyleCSSCodec.parseGradient has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleListMapping.items (cognitive 21) Modules/Core/RuleEngine/ModernParser/RuleListMapping.swift:87— RuleListMapping.items has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (4 pts), boolean chains 2, 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.
ExploreHomeRoot.home (cognitive 21) Modules/Features/Explore/Home/ExploreHome.swift:230— ExploreHomeRoot.home has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 5 (7 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.
HomeSectionForm.body (cognitive 21) Modules/Features/Explore/Home/HomeSectionForm.swift:216— HomeSectionForm.body has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (2 pts), boolean chains 1, match/switch 1, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
LegadoRuleScope.isAssigned (cognitive 21) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:416— LegadoRuleScope.isAssigned has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, if/else 5 (7 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ruleEngine.splitTrailingPutDirective (cognitive 21) REDACTED:220— ruleEngine.splitTrailingPutDirective has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, ternaries 1 (2 pts), loops 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.
_replaceBrs (cognitive 21) Resources/Assets/Readability.js:686— _replaceBrs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 10). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 687). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
parseTOCJSON (cognitive 21) REDACTED:1221— parseTOCJSON has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 19, error handling 1, if/else 1. Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1227, 1242). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AIRelationshipGraph.init (cognitive 20) Modules/Core/AI/AIRelationshipGraph.swift:38— AIRelationshipGraph.init has cognitive complexity 20 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 11). 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.
AISelfAssessmentStreamParser.finish (cognitive 20) Modules/Core/AI/AISelfAssessment.swift:116— AISelfAssessmentStreamParser.finish has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (7 pts), ternaries 1 (nesting depth added 1). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
AITextCoordinates.mappedRange (cognitive 20) Modules/Core/AI/AISourceSnapshot.swift:126— AITextCoordinates.mappedRange has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 4. 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.
FixedPageCropBordersProcessor.createCropRect (cognitive 20) Modules/Core/Comic/FixedPageCropBordersProcessor.swift:57— FixedPageCropBordersProcessor.createCropRect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, loops 2 (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.
KF8Converter.anchor (cognitive 20) Modules/Core/MOBI/KF8Converter.swift:239— KF8Converter.anchor has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (7 pts), boolean chains 5, if/else 3 (5 pts), 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.
MOBIFile.init (cognitive 20) Modules/Core/MOBI/MOBIFile.swift:40— MOBIFile.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, 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.
TXTChapterParser.decodeHTMLEntities (cognitive 20) Modules/Core/TXT/TXTChapterParser.swift:1058— TXTChapterParser.decodeHTMLEntities has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AIMemoryCardView.body (cognitive 20) Modules/Features/AI/AICharacterMemoryView.swift:306— AIMemoryCardView.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkDetailView.workPage (cognitive 20) Modules/Features/BookDetail/WorkDetailView.swift:292— WorkDetailView.workPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, error handling 1, match/switch 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.
WorkDetailView.libraryActions (cognitive 20) Modules/Features/BookDetail/WorkDetailView.swift:990— WorkDetailView.libraryActions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookGridCell.body (cognitive 20) Modules/Features/Bookshelf/HomeView.swift:2171— BookGridCell.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 7 (8 pts), boolean chains 4 (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.
CoreTextCollectionScrollViewController.handleTap (cognitive 20) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1465— CoreTextCollectionScrollViewController.handleTap has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7 (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.
CoreTextCollectionScrollViewController.resolveVisibleViewport (cognitive 20) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:2061— CoreTextCollectionScrollViewController.resolveVisibleViewport has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (6 pts), ternaries 4 (6 pts), 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.
CoreTextCollectionScrollViewController.scrollViewDidScroll (cognitive 20) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:2281— CoreTextCollectionScrollViewController.scrollViewDidScroll has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 9. 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.
ReaderChapterCommentDecorator.placements (cognitive 20) Modules/Features/Reader/ReaderChapterCommentDecorator.swift:113— ReaderChapterCommentDecorator.placements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, loops 2, ternaries 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
ReaderView.handleCoreTextPageChanged (cognitive 20) Modules/Features/Reader/ReaderView.swift:1179— ReaderView.handleCoreTextPageChanged has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderView.applyInitialProgressIfNeeded (cognitive 20) Modules/Features/Reader/ReaderView.swift:3413— ReaderView.applyInitialProgressIfNeeded has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (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.
CalibreWirelessService.handle (cognitive 20) Modules/Services/Calibre/CalibreWirelessService.swift:200— CalibreWirelessService.handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingleWriteHTTPExchange.requestBytes (cognitive 20) Modules/Services/Network/SingleWriteHTTPExchange.swift:393— SingleWriteHTTPExchange.requestBytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 7, loops 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.
SingleWriteHTTPExchange.decoded (cognitive 20) Modules/Services/Network/SingleWriteHTTPExchange.swift:506— SingleWriteHTTPExchange.decoded has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 2 (7 pts), error handling 2 (4 pts), boolean chains 3, match/switch 1 (3 pts), if/else 2, 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.
WebFetcher.buildRequest (cognitive 20) Modules/Services/Network/WebFetcher.swift:254— WebFetcher.buildRequest has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, 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.
LegadoRSSScraper.parseArticles (cognitive 20) Modules/Services/RSS/LegadoRSSScraper.swift:82— LegadoRSSScraper.parseArticles has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RSSFeedRefreshService.refreshEach (cognitive 20) Modules/Services/RSS/RSSFeedRefreshService.swift:21— RSSFeedRefreshService.refreshEach has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 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.
RemoteLibraryHTTPClient.validContentRange (cognitive 20) Modules/Services/RemoteLibrary/RemoteLibraryHTTPClient.swift:133— RemoteLibraryHTTPClient.validContentRange has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts) (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.
RemoteLibraryWritingService.updateMetadata (cognitive 20) Modules/Services/RemoteLibrary/RemoteLibraryWritingService.swift:154— RemoteLibraryWritingService.updateMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, 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.
QiThemeImportService.substituteMissingChapterTitleFonts (cognitive 20) Targets/Yuedu/SharedApp/QiThemeImportService.swift:470— QiThemeImportService.substituteMissingChapterTitleFonts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTMLStyledASTRenderableNodeConverter.mapChildren (cognitive 20) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:94— HTMLStyledASTRenderableNodeConverter.mapChildren has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 4 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeAttributedStringRenderer.applyInlineStyle (cognitive 20) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1254— NodeAttributedStringRenderer.applyInlineStyle has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, if/else 6, ternaries 3, match/switch 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.
SVGWebViewRasterizer.resolveSVGSize (cognitive 20) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:337— SVGWebViewRasterizer.resolveSVGSize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 2 (4 pts) (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.
SVGWebViewRasterizer.beginCapture (cognitive 20) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:518— SVGWebViewRasterizer.beginCapture has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (8 pts), ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
QiThemeImporter.extractArchive (cognitive 20) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:1072— QiThemeImporter.extractArchive has cognitive complexity 20 (threshold 15). Drivers by points: error handling 5 (7 pts), if/else 4 (7 pts), ternaries 1 (3 pts), loops 2, 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.
SVGValidation.validateYueduMarkers (cognitive 20) Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:664— SVGValidation.validateYueduMarkers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JSONPathEvaluator.splitFilter (cognitive 20) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:397— JSONPathEvaluator.splitFilter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonExtractor.extractList (cognitive 20) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:646— JsonExtractor.extractList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 pts), ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HomeSectionCards.body (cognitive 20) Modules/Features/Explore/Home/HomeSectionCards.swift:89— HomeSectionCards.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleModuleManifestSections.body (cognitive 20) Modules/Features/Library/Modules/RuleModuleImportSheet.swift:151— RuleModuleManifestSections.body has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 3, 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.
AnalyzeUrl.canonicalRequestURLString (cognitive 20) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:751— AnalyzeUrl.canonicalRequestURLString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, loops 2 (3 pts), 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.
ruleEngine.extractValueByJsoupDefaultFromElements (cognitive 20) REDACTED:623— ruleEngine.extractValueByJsoupDefaultFromElements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, 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.
_fixRelativeUris (cognitive 20) Resources/Assets/Readability.js:437— _fixRelativeUris has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (4 pts), boolean chains 3, error handling 1 (nesting depth added 6). None of this is in the body itself: all 20 points belong to 4 function items inside it that branch (a function literal at line 456, toAbsoluteURI, a function literal at line 492, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
_markDataTables (cognitive 20) Resources/Assets/Readability.js:2277— _markDataTables has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 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.
evaluateRuleLike (cognitive 20) REDACTED:394— evaluateRuleLike has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 16, if/else 4. 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.
parseTOC (cognitive 20) REDACTED:1175— parseTOC has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 4 (5 pts) (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1183, 1201, 1198, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
BookSourceStore.importSources (cognitive 19) Modules/Core/BookSource/BookSourceStore.swift:853— BookSourceStore.importSources has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), loops 2, 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.
ReaderHTMLUtilities.normalizeSingleQuotedJSON (cognitive 19) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1658— ReaderHTMLUtilities.normalizeSingleQuotedJSON has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, 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.
RuleEngine.isJsoupDefaultRule (cognitive 19) Modules/Core/RuleEngine/RuleEngine.swift:291— RuleEngine.isJsoupDefaultRule has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 1 (nesting depth added 4). 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.
RuleEngine.splitJSONPath (cognitive 19) Modules/Core/RuleEngine/RuleEngine.swift:1582— RuleEngine.splitJSONPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 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.
DensityIndex.init (cognitive 19) Modules/Core/RuleEngine/WebNovelParser.swift:209— DensityIndex.init has cognitive complexity 19 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (3 pts), match/switch 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.
TTSVoiceCandidates.make (cognitive 19) Modules/Core/TTS/TTSAutoCast.swift:84— TTSVoiceCandidates.make has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), loops 2 (5 pts), if/else 1 (4 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.
TTSPronunciationAnnotator.hints (cognitive 19) Modules/Core/TTS/TTSPronunciation.swift:183— TTSPronunciationAnnotator.hints has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (6 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.
ChangeSourceSearch.enrich (cognitive 19) Modules/Features/ChangeSource/ChangeSourceSearch.swift:851— ChangeSourceSearch.enrich has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, error handling 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.
ChangeSourceSearch.firstLoadable (cognitive 19) Modules/Features/ChangeSource/ChangeSourceSearch.swift:926— ChangeSourceSearch.firstLoadable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2, error handling 1, ternaries 1 (nesting depth added 5). Of this number, 12 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextCollectionScrollViewController.collectionView (cognitive 19) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:2174— CoreTextCollectionScrollViewController.collectionView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6 (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.
ReaderView.startTTSChapter (cognitive 19) Modules/Features/Reader/ReaderView+SourceChange.swift:1034— ReaderView.startTTSChapter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 1 (2 pts), ternaries 2 (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.
TXTTocRuleEditView.refreshPreview (cognitive 19) Modules/Features/Settings/TXTTocRuleEditView.swift:206— TXTTocRuleEditView.refreshPreview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3, match/switch 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BookStore.refreshOnlineBookMetadata (cognitive 19) Modules/Services/LibraryStore/BookStore.swift:2263— BookStore.refreshOnlineBookMetadata has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3, 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.
BookStore.snapshotForSync (cognitive 19) Modules/Services/LibraryStore/BookStore.swift:2882— BookStore.snapshotForSync has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, 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.
SingleWriteHTTPExchange.redirectRequest (cognitive 19) Modules/Services/Network/SingleWriteHTTPExchange.swift:461— SingleWriteHTTPExchange.redirectRequest has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), loops 1 (3 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DownloadLiveActivityController.flushPendingStates (cognitive 19) Modules/Services/Offline/DownloadLiveActivityController.swift:203— DownloadLiveActivityController.flushPendingStates has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RSSXMLParserDelegate.parser (cognitive 19) Modules/Services/RSS/RSSFetcher.swift:302— RSSXMLParserDelegate.parser has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, ternaries 1 (2 pts) (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.
AuthorShelf.adding (cognitive 19) Modules/Services/Works/AuthorShelf.swift:27— AuthorShelf.adding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3, match/switch 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 5). Of this number, 11 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImportedMetadataCapture.classify (cognitive 19) Modules/Services/Works/ImportedMetadataCapture.swift:142— ImportedMetadataCapture.classify has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 9 (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.
RelatedWorks.byAuthorKinds (cognitive 19) Modules/Services/Works/AuthorShelf.swift:84— RelatedWorks.byAuthorKinds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, match/switch 1 (2 pts), ternaries 1 (2 pts), loops 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.
CoreTextChunk.stringIndex (cognitive 19) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:370— CoreTextChunk.stringIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts), 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.
CoreTextPageView.drawBoxBackgroundImage (cognitive 19) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1260— CoreTextPageView.drawBoxBackgroundImage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 2 (7 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.
EmbeddedTrueTypeFontIdentity.rename (cognitive 19) Modules/Core/ReaderCore/CoreText/EmbeddedTrueTypeFontIdentity.swift:58— EmbeddedTrueTypeFontIdentity.rename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HTMLAttributedStringBuilder.collectStyles (cognitive 19) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:667— HTMLAttributedStringBuilder.collectStyles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), ternaries 2, 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.
ReaderDialogueSegmentation.segments (cognitive 19) Modules/Core/ReaderCore/CoreText/ReaderDialogueSegmentation.swift:35— ReaderDialogueSegmentation.segments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 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.
ReviewBubbleLineFit.squeezableBlanks (cognitive 19) Modules/Core/ReaderCore/CoreText/ReviewBubbleLineFit.swift:183— ReviewBubbleLineFit.squeezableBlanks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModernRuleEngine.splitSourceRule (cognitive 19) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:534— ModernRuleEngine.splitSourceRule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XPathExtractor.splitUnion (cognitive 19) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:470— XPathExtractor.splitUnion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, 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.
JSCoreEngine.configureContext (cognitive 19) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:947— JSCoreEngine.configureContext has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LegadoJSBridge.runAjaxBatch (cognitive 19) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1102— LegadoJSBridge.runAjaxBatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, match/switch 2 (3 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.
AnalyzeUrl.toURLRequest (cognitive 19) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:1326— AnalyzeUrl.toURLRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, 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.
Readability.Readability (cognitive 19) Resources/Assets/Readability.js:27— Readability.Readability has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (6 pts) (nesting depth added 1). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
legado-engine.getAttr (cognitive 19) REDACTED:55— legado-engine.getAttr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 3). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
index.auditTestFlightMembership (cognitive 19) functions/src/index.ts:256— index.auditTestFlightMembership has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (3 pts), 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.
identityToolkit.signInWithIdp (cognitive 19) gateway/src/identityToolkit.ts:170— identityToolkit.signInWithIdp has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 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.
feedback.feedbackRouter (cognitive 19) REDACTED:38— feedback.feedbackRouter has cognitive complexity 19 (threshold 15). Drivers by points: error handling 9, if/else 5 (6 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 2). None of this is in the body itself: all 19 points belong to 10 function literals inside it that branch (lines 170, 230, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
_getArticleTitle (cognitive 19) Resources/Assets/Readability.js:553— _getArticleTitle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, error handling 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.
_cleanConditionally::(anonymous)::shouldRemoveNode (cognitive 19) Resources/Assets/Readability.js:2561— _cleanConditionally::(anonymous)::shouldRemoveNode has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 9. 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.
AIReadingEvidence.collect (cognitive 18) Modules/Core/AI/AIReadingEvidence.swift:9— AIReadingEvidence.collect has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 2 (4 pts) (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.
OnlineBookContentInference.kind (cognitive 18) Modules/Core/BookSource/BookSource.swift:566— OnlineBookContentInference.kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), boolean chains 3 (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.
RuleEngine.parseIndexExpression (cognitive 18) Modules/Core/RuleEngine/RuleEngine.swift:412— RuleEngine.parseIndexExpression has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5, boolean chains 3 (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.
TXTChapterParser.splittingOverlongChapters (cognitive 18) Modules/Core/TXT/TXTChapterParser.swift:185— TXTChapterParser.splittingOverlongChapters has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), 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.
BookDetailIntroSection.body (cognitive 18) Modules/Features/BookDetail/BookDetailComponents.swift:1537— BookDetailIntroSection.body has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 5, if/else 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HomeView.shelfToolbar (cognitive 18) Modules/Features/Bookshelf/HomeView.swift:912— HomeView.shelfToolbar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (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.
Coordinator.handleInstantPan (cognitive 18) Modules/Features/Reader/CoreTextPagedView.swift:2540— Coordinator.handleInstantPan has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 3 (4 pts) (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.
ReaderView.jumpToChapter (cognitive 18) Modules/Features/Reader/ReaderView+Logic.swift:297— ReaderView.jumpToChapter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 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.
ReaderView.followTTSPlaybackHighlight (cognitive 18) Modules/Features/Reader/ReaderView+SourceChange.swift:798— ReaderView.followTTSPlaybackHighlight has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), ternaries 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.
BookSearchView.body (cognitive 18) Modules/Features/Search/BookSearchView.swift:333— BookSearchView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 5, ternaries 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.
BookStore.writeMetadata (cognitive 18) Modules/Services/LibraryStore/BookStore.swift:3295— BookStore.writeMetadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, error handling 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.
ConvertedBookRegenerator.prepare (cognitive 18) Modules/Services/LibraryStore/ConvertedBookRegenerator.swift:98— ConvertedBookRegenerator.prepare has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
HTMLTextExtractor.extractPreservingBlocks (cognitive 18) Modules/Services/LibraryStore/Models.swift:1359— HTMLTextExtractor.extractPreservingBlocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, 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.
ShelfWorkMerger.absorb (cognitive 18) Modules/Services/LibraryStore/ShelfWorkService.swift:231— ShelfWorkMerger.absorb has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), loops 2 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteLibraryService.probe (cognitive 18) Modules/Services/RemoteLibrary/RemoteLibraryService.swift:423— RemoteLibraryService.probe has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 5, ternaries 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.
ChapterTitleMatch.number (cognitive 18) Modules/Services/Works/ChapterTitleMatch.swift:39— ChapterTitleMatch.number has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserLayoutPageEngine.pageViewController (cognitive 18) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:1745— BrowserLayoutPageEngine.pageViewController has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 2 (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.
BrowserLayoutPageEngine.makeScrollChapter (cognitive 18) Modules/Core/ReaderCore/BrowserLayout/BrowserLayoutPageEngine.swift:2156— BrowserLayoutPageEngine.makeScrollChapter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, error handling 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.
ChapterTitleDesignRenderer.compile (cognitive 18) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:132— ChapterTitleDesignRenderer.compile has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 3, loops 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.
CoreTextPaginator.explicitRenderableText (cognitive 18) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3645— CoreTextPaginator.explicitRenderableText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 2, 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.
InteractionOverlayView.draw (cognitive 18) Modules/Core/ReaderCore/CoreText/InteractionOverlayView.swift:62— InteractionOverlayView.draw has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (6 pts), boolean chains 1 (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.
NodeAttributedStringRenderer.resolvedImageMetrics (cognitive 18) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2572— NodeAttributedStringRenderer.resolvedImageMetrics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 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.
BrowserScrollChapter.submit (cognitive 18) Modules/Core/ReaderCore/CoreText/ReaderScrollItem.swift:273— BrowserScrollChapter.submit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ReaderTextEmphasis.applyMarks (cognitive 18) Modules/Core/ReaderCore/CoreText/ReaderTextEmphasis.swift:42— ReaderTextEmphasis.applyMarks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (3 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.
ReviewCardFullText.restoringCutComments (cognitive 18) Modules/Core/ReaderCore/CoreText/ReviewCardFullText.swift:31— ReviewCardFullText.restoringCutComments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 2, ternaries 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.
QiThemeImporter.overlayLayout (cognitive 18) Modules/Core/ReaderCore/Customization/QiThemeImporter.swift:644— QiThemeImporter.overlayLayout has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 1 (2 pts), ternaries 1 (2 pts), 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.
ReaderStyleCSSCodec.splitTopLevel (cognitive 18) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:956— ReaderStyleCSSCodec.splitTopLevel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, 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.
JSONPathEvaluator.readBracketContent (cognitive 18) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:125— JSONPathEvaluator.readBracketContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 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.
JSONPathEvaluator.parseBracket (cognitive 18) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:148— JSONPathEvaluator.parseBracket has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (8 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.
ModernParserBridge.reviewSummaryIdentifiers (cognitive 18) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:919— ModernParserBridge.reviewSummaryIdentifiers has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
ModernParserBridge.parseBookInfo (cognitive 18) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1255— ModernParserBridge.parseBookInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 3 (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.
ModernRuleEngine.evaluateElements (cognitive 18) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:370— ModernRuleEngine.evaluateElements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (5 pts), boolean chains 2, match/switch 1 (2 pts), 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.
CoreTextHorizontalLineDrawer.drawLines (cognitive 18) Modules/Core/ReaderCore/CoreText/CoreTextHorizontal/CoreTextHorizontalLineDrawer.swift:39— CoreTextHorizontalLineDrawer.drawLines has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2, 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.
JSCoreEngine.setResult (cognitive 18) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2129— JSCoreEngine.setResult has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7 (8 pts), ternaries 1 (2 pts) (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.
JSCoreEngine.bindGlobals (cognitive 18) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2230— JSCoreEngine.bindGlobals has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 1 (3 pts), loops 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.
JSCoreEngine.extractString (cognitive 18) Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2345— JSCoreEngine.extractString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 8 (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.
StatementReader.readSwitchBody (cognitive 18) Modules/Core/RuleEngine/ModernParser/JS/LegadoCompletionValue.swift:436— StatementReader.readSwitchBody has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 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.
LegadoJSBridge.htmlFormat (cognitive 18) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:2794— LegadoJSBridge.htmlFormat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 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.
ruleEngine.extractValueByCss (cognitive 18) REDACTED:659— ruleEngine.extractValueByCss has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, error handling 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.
parseJsoupSegment (cognitive 18) REDACTED:540— parseJsoupSegment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2 (4 pts), boolean chains 2 (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.
BookSourceFetcher.fetchTOCPackage (cognitive 17) Modules/Core/BookSource/BookSourceFetcher+TOC.swift:113— BookSourceFetcher.fetchTOCPackage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 4, error handling 1 (2 pts), ternaries 1 (2 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.
MangaChapterParser.attributeValue (cognitive 17) Modules/Core/Comic/MangaChapter.swift:162— MangaChapterParser.attributeValue has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), loops 3 (4 pts) (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.
EPUBClockValueParser.seconds (cognitive 17) Modules/Core/EPUB/EPUBMediaOverlay.swift:33— EPUBClockValueParser.seconds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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.
PalmDOCDecompressor.decompress (cognitive 17) Modules/Core/MOBI/PalmDOCDecompressor.swift:12— PalmDOCDecompressor.decompress has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), match/switch 1 (2 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.
RuleEngine.extractContentValue (cognitive 17) Modules/Core/RuleEngine/RuleEngine.swift:761— RuleEngine.extractContentValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.extractJSONValue (cognitive 17) Modules/Core/RuleEngine/RuleEngine.swift:1432— RuleEngine.extractJSONValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 1 (2 pts) (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.
WebNovelParser.extractNextPageURL (cognitive 17) Modules/Core/RuleEngine/WebNovelParser.swift:278— WebNovelParser.extractNextPageURL has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TTSChunkDecoder.fileTypeHint (cognitive 17) Modules/Core/TTS/TTSChunkDecoder.swift:140— TTSChunkDecoder.fileTypeHint has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 5. 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.
TXTChapterParser.parseChapterIndexes (cognitive 17) Modules/Core/TXT/TXTChapterParser.swift:70— TXTChapterParser.parseChapterIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), loops 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. This shape REPEATS in the file: one other method here (TXTChapterParser.parseMappedChapterIndexes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TXTChapterParser.parseMappedChapterIndexes (cognitive 17) Modules/Core/TXT/TXTChapterParser.swift:123— TXTChapterParser.parseMappedChapterIndexes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), loops 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. This shape REPEATS in the file: one other method here (TXTChapterParser.parseChapterIndexes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TXTLocationMigration.anchor (cognitive 17) Modules/Core/TXT/TXTLocationMigration.swift:63— TXTLocationMigration.anchor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1 (2 pts), ternaries 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.
AICharacterMemoryView.body (cognitive 17) Modules/Features/AI/AICharacterMemoryView.swift:58— AICharacterMemoryView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3, ternaries 2, boolean chains 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.
FixedPageReaderViewController.prefetchAroundChapters (cognitive 17) Modules/Features/FixedPageReader/FixedPageReaderViewController.swift:754— FixedPageReaderViewController.prefetchAroundChapters has cognitive complexity 17 (threshold 15). Drivers by points: error handling 2 (6 pts), boolean chains 4, loops 2 (4 pts), if/else 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.
ChapterTitleInspectorView.contentSection (cognitive 17) Modules/Features/Reader/ChapterTitleInspectorView.swift:96— ChapterTitleInspectorView.contentSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (17 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.
Coordinator.bindEngineCallbacks (cognitive 17) Modules/Features/Reader/CoreTextPagedView.swift:1240— Coordinator.bindEngineCallbacks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 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.
ReaderBarRenderer.measure (cognitive 17) Modules/Features/Reader/ReaderBarRenderer.swift:175— ReaderBarRenderer.measure has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderCardTransitionAnimator.forceSettleStalledTransition (cognitive 17) Modules/Features/Reader/ReaderCardTransitionAnimator.swift:350— ReaderCardTransitionAnimator.forceSettleStalledTransition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (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.
ReaderView.gatherAIBookText (cognitive 17) Modules/Features/Reader/ReaderView+SourceChange.swift:1641— ReaderView.gatherAIBookText has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (5 pts), error handling 2, 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.
ReaderViewModel.ensureChapterReady (cognitive 17) Modules/Features/Reader/ReaderViewModel.swift:153— ReaderViewModel.ensureChapterReady has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 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.
DownloadManagementView.activeDownloadsSection (cognitive 17) Modules/Features/Settings/DownloadManagementView.swift:121— DownloadManagementView.activeDownloadsSection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (8 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.
AIRecommendationService.cover (cognitive 17) Modules/Services/AI/AIRecommendationService.swift:322— AIRecommendationService.cover has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 1 (2 pts), loops 1, ternaries 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.
BookStore.importLocalAudiobook (cognitive 17) Modules/Services/LibraryStore/BookStore.swift:645— BookStore.importLocalAudiobook has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (5 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OPDSBrowseModel.load (cognitive 17) Modules/Services/OPDS/OPDSBrowseModel.swift:40— OPDSBrowseModel.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterCacheRepository.loadChapterPackageSync (cognitive 17) Modules/Services/Online/ChapterCacheRepository.swift:269— ChapterCacheRepository.loadChapterPackageSync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterFetcher.buildRenderableNormalizedHTML (cognitive 17) Modules/Services/Online/ChapterFetcher.swift:67— ChapterFetcher.buildRenderableNormalizedHTML has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 4, boolean chains 3, ternaries 3 (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.
RemoteLibraryWritingService.upload (cognitive 17) Modules/Services/RemoteLibrary/RemoteLibraryWritingService.swift:98— RemoteLibraryWritingService.upload has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleReviewProvider.records (cognitive 17) Modules/Services/RuleModules/ModuleReviewProvider.swift:79— ModuleReviewProvider.records has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8 (nesting depth added 3). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleModuleRepositoryModel.install (cognitive 17) Modules/Services/RuleModules/RuleModuleRepository.swift:283— RuleModuleRepositoryModel.install has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 1 (2 pts), match/switch 1 (2 pts), boolean chains 1, 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.
RuleModuleValidator.validateStore (cognitive 17) Modules/Services/RuleModules/RuleModuleValidator.swift:491— RuleModuleValidator.validateStore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, loops 2 (3 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.
SubscriptionStore.refreshEntitlements (cognitive 17) Modules/Services/Subscription/SubscriptionStore.swift:537— SubscriptionStore.refreshEntitlements has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1, ternaries 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.
HomePageStore.load (cognitive 17) Modules/Services/Works/HomePageStore.swift:455— HomePageStore.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 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.
RelatedWorks.byAuthors (cognitive 17) Modules/Services/Works/AuthorWorks.swift:121— RelatedWorks.byAuthors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContentView.rootTabItemLabel (cognitive 17) Targets/Yuedu/SharedApp/ContentView.swift:381— ContentView.rootTabItemLabel has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (7 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.
GlobalSettings.restoreBundleOwnLook (cognitive 17) Targets/Yuedu/SharedApp/GlobalSettings.swift:3724— GlobalSettings.restoreBundleOwnLook has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 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.
QiThemeImportService.apply (cognitive 17) Targets/Yuedu/SharedApp/QiThemeImportService.swift:68— QiThemeImportService.apply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, error handling 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.
CSSValueTokens.split (cognitive 17) Modules/Core/ReaderCore/CoreText/CSSPropertyApplier.swift:512— CSSValueTokens.split has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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.
ChapterDocumentStore.document (cognitive 17) Modules/Core/ReaderCore/CoreText/ChapterDocument.swift:97— ChapterDocumentStore.document has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2, error handling 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.
CommentBubbleSVGRecognizer.recognizeUncached (cognitive 17) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:349— CommentBubbleSVGRecognizer.recognizeUncached has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CommentBubbleSVGRecognizer.declaredFont (cognitive 17) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1460— CommentBubbleSVGRecognizer.declaredFont has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 2 (4 pts), match/switch 1 (2 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.
CoreTextChunkSlicer.sliceVertical (cognitive 17) Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:395— CoreTextChunkSlicer.sliceVertical has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoreTextPaginator.logLayoutFormatProbe (cognitive 17) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:1485— CoreTextPaginator.logLayoutFormatProbe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (5 pts), boolean chains 4, loops 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.
CoreTextPaginator.markCombinedUprightCells (cognitive 17) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2091— CoreTextPaginator.markCombinedUprightCells has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 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.
ElementNode.rubySegments (cognitive 17) Modules/Core/ReaderCore/CoreText/HTMLStyledASTRenderableNodeConverter.swift:378— ElementNode.rubySegments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 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.
NodeAttributedStringRenderer.relaxParagraphsContainingTallRuns (cognitive 17) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2233— NodeAttributedStringRenderer.relaxParagraphsContainingTallRuns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, loops 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.
OnlineChapterTitleDeduplicator.titleUpdate (cognitive 17) Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:70— OnlineChapterTitleDeduplicator.titleUpdate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 2 (3 pts) (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.
ReviewCardContent.extract (cognitive 17) Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:38— ReviewCardContent.extract has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 1 (2 pts), ternaries 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.
ReviewCardTemplate.serialize (cognitive 17) Modules/Core/ReaderCore/CoreText/ReviewCardTemplate.swift:350— ReviewCardTemplate.serialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ReaderBatterySVGRasterRequestValidator.validate (cognitive 17) Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:22— ReaderBatterySVGRasterRequestValidator.validate has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, if/else 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReaderStyleAssetStore.prepareImage (cognitive 17) Modules/Core/ReaderCore/Customization/ReaderStyleAssetStore.swift:662— ReaderStyleAssetStore.prepareImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 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.
ReedenThemeImporter.appendUnmappedAppearanceNotes (cognitive 17) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:968— ReedenThemeImporter.appendUnmappedAppearanceNotes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, boolean chains 8. 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.
JSONPathEvaluator.parseQuotedKeys (cognitive 17) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:193— JSONPathEvaluator.parseQuotedKeys has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 3 (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.
JsoupDefaultExtractor.getStringList (cognitive 17) Modules/Core/RuleEngine/ModernParser/JsoupDefaultExtractor.swift:164— JsoupDefaultExtractor.getStringList has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModernRuleEngine.extractJsoupElements (cognitive 17) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1091— ModernRuleEngine.extractJsoupElements has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleAnalyzer.chompRuleBalanced (cognitive 17) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:316— RuleAnalyzer.chompRuleBalanced has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, 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.
HomeListCardPage.body (cognitive 17) Modules/Features/Explore/Home/HomeSectionForm.swift:709— HomeListCardPage.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 1 (3 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.
FixedPageWebtoonViewController.scrollViewDidScroll (cognitive 17) Modules/Features/FixedPageReader/Webtoon/FixedPageWebtoonViewController.swift:555— FixedPageWebtoonViewController.scrollViewDidScroll has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5 (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.
LegadoRhinoNormalizer.functionBodyBraces (cognitive 17) Modules/Core/RuleEngine/ModernParser/JS/LegadoRhinoNormalizer.swift:253— LegadoRhinoNormalizer.functionBodyBraces has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 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.
LegadoRuleScope.destructuredTargets (cognitive 17) Modules/Core/RuleEngine/ModernParser/JS/LegadoRuleScope.swift:480— LegadoRuleScope.destructuredTargets has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), ternaries 2 (3 pts), 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.
AnalyzeUrl.encodeParams (cognitive 17) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:1154— AnalyzeUrl.encodeParams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 4). Of this number, 12 points are the body's own statements and 5 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.
HTMLParser.swift.decodeHTMLEntities (cognitive 17) Modules/Core/RuleEngine/HTMLParser.swift:497— HTMLParser.swift.decodeHTMLEntities has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 2 (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.
reauth.verifyReauthentication (cognitive 17) gateway/src/reauth.ts:24— reauth.verifyReauthentication has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AIWordLookup.context (cognitive 16) Modules/Core/AI/AIWordLookup.swift:23— AIWordLookup.context has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
OnlineBookContentInference.kind (cognitive 16) Modules/Core/BookSource/BookSource.swift:639— OnlineBookContentInference.kind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceAPIErrorLog.chapterErrorEnvelopeMessage (cognitive 16) Modules/Core/BookSource/SourceAPIErrorLog.swift:158— SourceAPIErrorLog.chapterErrorEnvelopeMessage has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MOBIEPUBWriter.packageDocument (cognitive 16) Modules/Core/MOBI/MOBIEPUBWriter.swift:96— MOBIEPUBWriter.packageDocument has cognitive complexity 16 (threshold 15). Drivers by points: loops 6, if/else 3 (4 pts), ternaries 3 (4 pts), boolean chains 2 (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.
ReaderHTMLUtilities.normalizeQidianGodReviewImage (cognitive 16) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1538— ReaderHTMLUtilities.normalizeQidianGodReviewImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, loops 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.
ReaderHTMLUtilities.splitLegadoArguments (cognitive 16) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2083— ReaderHTMLUtilities.splitLegadoArguments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 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.
JSONFileReadingPositionStore.applySyncItems (cognitive 16) Modules/Core/ReaderCore/ReadingPositionStore.swift:144— JSONFileReadingPositionStore.applySyncItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), error handling 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleEngine.applyXPathStep (cognitive 16) Modules/Core/RuleEngine/RuleEngine.swift:1204— RuleEngine.applyXPathStep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, match/switch 1 (3 pts), loops 1, ternaries 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.
AudiobookPlayer.loadCurrentChapter (cognitive 16) Modules/Core/TTS/AudiobookPlayer.swift:781— AudiobookPlayer.loadCurrentChapter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 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.
HTTPTTSEngine.downloadChunk (cognitive 16) Modules/Core/TTS/HTTPTTSEngine.swift:472— HTTPTTSEngine.downloadChunk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, error handling 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.
Result.paragraphs (cognitive 16) Modules/Core/TXT/AozoraMarkupParser.swift:46— Result.paragraphs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), 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.
OnlineBookView.openReader (cognitive 16) Modules/Features/BookDetail/OnlineBookView.swift:1085— OnlineBookView.openReader has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. 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.
HomeView.openBook (cognitive 16) Modules/Features/Bookshelf/HomeView.swift:357— HomeView.openBook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RSSSmartFeedView.body (cognitive 16) Modules/Features/RSS/RSSFeedView.swift:49— RSSSmartFeedView.body has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 3 (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.
BrowserChapterBackdropView.showPages (cognitive 16) Modules/Features/Reader/BrowserChapterBackdropView.swift:66— BrowserChapterBackdropView.showPages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
CoreTextCollectionScrollViewController.handleLongPress (cognitive 16) Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:1611— CoreTextCollectionScrollViewController.handleLongPress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, match/switch 1 (nesting depth added 4). 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.
EPUBBackgroundAudioCoordinator.parseBackgroundAudio (cognitive 16) Modules/Features/Reader/EPUBBackgroundAudioCoordinator.swift:96— EPUBBackgroundAudioCoordinator.parseBackgroundAudio has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, 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.
ReaderBookSearchMatcher.ranges (cognitive 16) Modules/Features/Reader/ReaderBookSearchMatcher.swift:58— ReaderBookSearchMatcher.ranges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 1 (2 pts), error handling 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.
ReaderSettingsView.fontSelector (cognitive 16) Modules/Features/Reader/ReaderSettingsView.swift:314— ReaderSettingsView.fontSelector has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (7 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadingStatsView.dailyMinutes (cognitive 16) Modules/Features/Stats/ReadingStatsView.swift:189— ReadingStatsView.dailyMinutes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AIBookshelfOrganizerModel.start (cognitive 16) Modules/Services/AI/AIBookshelfOrganizerModel.swift:35— AIBookshelfOrganizerModel.start has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (5 pts), if/else 2 (5 pts), loops 2 (5 pts), 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.
ShelfWorkService.add (cognitive 16) Modules/Services/LibraryStore/ShelfWorkService.swift:378— ShelfWorkService.add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 1 (3 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.
Mapper.applyFeedLink (cognitive 16) Modules/Services/OPDS/OPDS2FeedParser.swift:98— Mapper.applyFeedLink has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 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.
DownloadActivityDebugHarness.startIfRequested (cognitive 16) Modules/Services/Offline/DownloadActivityDebugHarness.swift:19— DownloadActivityDebugHarness.startIfRequested has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (5 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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.
ChapterFetcher.fetchPaginatedContent (cognitive 16) Modules/Services/Online/ChapterFetcher.swift:609— ChapterFetcher.fetchPaginatedContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchAggregator.runSearch (cognitive 16) Modules/Services/Online/SearchAggregator.swift:614— SearchAggregator.runSearch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 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.
SearchResultCoverURLPolicy.normalizedString (cognitive 16) Modules/Services/Online/SearchResultCoverURLPolicy.swift:12— SearchResultCoverURLPolicy.normalizedString has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 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.
AtomXMLParserDelegate.handleArticleElementEnd (cognitive 16) Modules/Services/RSS/RSSFetcher.swift:613— AtomXMLParserDelegate.handleArticleElementEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RSSXMLParser.handleFeedElementEnd (cognitive 16) Modules/Services/RSS/RSSFetcher.swift:1430— RSSXMLParser.handleFeedElementEnd has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 1 (nesting depth added 4). 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.
RSSSource.normalizedWebURL (cognitive 16) Modules/Services/RSS/RSSModels.swift:186— RSSSource.normalizedWebURL has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ModuleProvider.entry (cognitive 16) Modules/Services/RuleModules/ModuleProvider.swift:259— ModuleProvider.entry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 4. Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
HomeListCardPhotoID.giveListsTheirCardsPhoto (cognitive 16) Modules/Services/Works/HomeConfigurationPhotos.swift:210— HomeListCardPhotoID.giveListsTheirCardsPhoto has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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.
RelatedWorks.pick::addWorks (cognitive 16) Modules/Services/Works/RelatedWorks.swift:65— RelatedWorks.pick::addWorks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 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. This shape REPEATS in the file: one other method here (RelatedWorks.pick) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
CollectionSummary.cards (cognitive 16) Modules/Services/Works/HomeListCards.swift:241— CollectionSummary.cards has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (2 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.
WebDAVIndexCoordinator.evaluate (cognitive 16) Modules/Services/Works/WebDAVIndexCoordinator.swift:189— WebDAVIndexCoordinator.evaluate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6 (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.
HighlightLineSpans.paint (cognitive 16) Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:165— HighlightLineSpans.paint has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 3 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChapterTitleCanvasPainter.draw (cognitive 16) Modules/Core/ReaderCore/CoreText/ChapterTitleDesignRenderer.swift:450— ChapterTitleCanvasPainter.draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CoreTextPaginator.extractInlineAnnotations (cognitive 16) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2800— CoreTextPaginator.extractInlineAnnotations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
ChapterTitleHTMLCodec.decodeContent (cognitive 16) Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:327— ChapterTitleHTMLCodec.decodeContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 5). 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.
HighlightPackImporter.parseQiReader::style (cognitive 16) Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:267— HighlightPackImporter.parseQiReader::style 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. This shape REPEATS in the file: one other method here (HighlightPackImporter.parseQiReader) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SVGValidation.validateReferences (cognitive 16) Modules/Core/ReaderCore/Customization/ReaderBatterySVGTemplate.swift:719— SVGValidation.validateReferences has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReedenThemeImporter.applyReaderSchemas (cognitive 16) Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:479— ReedenThemeImporter.applyReaderSchemas has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CookieStore.get (cognitive 16) Modules/Core/RuleEngine/ModernParser/CookieStore.swift:50— CookieStore.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 2 (4 pts), boolean chains 3, 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.
JSONPathEvaluator.stringify (cognitive 16) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:588— JSONPathEvaluator.stringify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 1 (3 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.
JsonExtractor.extractValue (cognitive 16) Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:686— JsonExtractor.extractValue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), boolean chains 1, ternaries 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.
ModernParserBridge.parseChapterResult (cognitive 16) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1580— ModernParserBridge.parseChapterResult has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, ternaries 2 (4 pts), boolean chains 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.
ModernRuleEngine.evaluateString (cognitive 16) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:203— ModernRuleEngine.evaluateString has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), boolean chains 2, 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.
RuleAnalyzer.consumeToAny (cognitive 16) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:236— RuleAnalyzer.consumeToAny has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 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.
XPathExtractor.evaluateXPathForItems (cognitive 16) Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:288— XPathExtractor.evaluateXPathForItems has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 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.
RuleModuleRepositoryView.toolbar (cognitive 16) Modules/Features/Library/Modules/RuleModuleRepositoryView.swift:205— RuleModuleRepositoryView.toolbar has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoPlayerView.panned (cognitive 16) Modules/Features/Reader/Video/VideoPlayerView.swift:171— VideoPlayerView.panned has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LegadoJSBridge.chapterNumber (cognitive 16) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:2662— LegadoJSBridge.chapterNumber has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1, match/switch 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.
AnalyzeUrl.stripJs (cognitive 16) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:244— AnalyzeUrl.stripJs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 pts), loops 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.
AnalyzeUrl.escapingControlCharactersInJSONStrings (cognitive 16) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:1041— AnalyzeUrl.escapingControlCharactersInJSONStrings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ruleEngine.evaluateTemplateExpression (cognitive 16) REDACTED:307— ruleEngine.evaluateTemplateExpression has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 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.
ruleEngine.getAttr (cognitive 16) REDACTED:508— ruleEngine.getAttr has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 6. 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.
ruleEngine.parseChapterPayload (cognitive 16) REDACTED:1251— ruleEngine.parseChapterPayload has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 3, error handling 1 (2 pts) (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.
_getArticleMetadata (cognitive 16) Resources/Assets/Readability.js:1763— _getArticleMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Near-duplicate member pair (68 shared lines) Modules/Features/BookDetail/AudiobookDetailView.swift:233— Modules/Features/BookDetail/AudiobookDetailView.swift:233-423 | Modules/Features/BookDetail/OnlineBookView.swift:261-471 — These two members are variants of one another: 68 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.
Near-duplicate member pair (42 shared lines) Modules/Features/Reader/ReaderCommentCardSettingsView.swift:13— Modules/Features/Reader/ReaderCommentCardSettingsView.swift:13-97 | Modules/Features/Reader/ReaderParagraphBubbleSettingsView.swift:12-101 — These two members are variants of one another: 42 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· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1083— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1083-1090 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2346-2353 | Modules/Core/ReaderCore/CoreText/EPUBAttributedStringBuilder.swift:437-445 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:732-740 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2554-2562 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:432-439 — 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· Edited copy of a member (83 corresponding lines) · ×1
Edited copy of a member (83 corresponding lines) Modules/Features/BookSource/BookSourceListView.swift:672— Modules/Features/BookSource/BookSourceListView.swift:672-767 | Modules/Features/Settings/TTSSettingsView.swift:443-525 — These two members are one piece of code written twice and then edited apart: 83 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 (51 corresponding lines) · ×1
Edited copy of a member (51 corresponding lines) Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:27— Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:27-81 | Modules/Core/ReaderCore/CoreText/EPUBMediaPlaceholderRenderer.swift:184-234 — These two members are one piece of code written twice and then edited apart: 51 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 (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) Modules/Services/LibraryStore/BookStore.swift:504— Modules/Services/LibraryStore/BookStore.swift:504-568 | Modules/Services/LibraryStore/BookStore.swift:575-641 — These two members are one piece of code written twice and then edited apart: 65 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 copies of one member (3 members, 42+ corresponding lines) · ×1
Edited copies of one member (3 members, 42+ corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3170— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3170-3211 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3213-3256 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3281-3325 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 42 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) Modules/Core/RuleEngine/RuleEngine.swift:167— Modules/Core/RuleEngine/RuleEngine.swift:167-234 | Modules/Core/RuleEngine/RuleEngine.swift:237-285 — These two members are one piece of code written twice and then edited apart: 49 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1973— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:1973-2025 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2027-2095 — These two members are one piece of code written twice and then edited apart: 53 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) Modules/Core/ReaderCore/EPUBPageRenderer.swift:658— Modules/Core/ReaderCore/EPUBPageRenderer.swift:658-718 | Modules/Core/ReaderCore/EPUBPageRenderer.swift:720-788 — These two members are one piece of code written twice and then edited apart: 61 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) Modules/Features/BookSource/BookSourceAddFlow.swift:472— Modules/Features/BookSource/BookSourceAddFlow.swift:472-524 | Modules/Features/Settings/TTSSettingsView.swift:527-576 — These two members are one piece of code written twice and then edited apart: 50 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 (64 corresponding lines) · ×1
Edited copy of a member (64 corresponding lines) Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1552— Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1552-1618 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:1620-1683 — These two members are one piece of code written twice and then edited apart: 64 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:817— Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:817-864 | Modules/Core/ReaderCore/CoreText/CoreTextPageEngine.swift:936-972 — These two members are one piece of code written twice and then edited apart: 37 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 (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:968— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:968-1010 | Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:1057-1085 — These two members are one piece of code written twice and then edited apart: 29 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) Modules/Features/BookDetail/ChangeCoverView.swift:103— Modules/Features/BookDetail/ChangeCoverView.swift:103-142 | Modules/Features/BookDetail/OnlineCoverSearchView.swift:55-90 — These two members are one piece of code written twice and then edited apart: 36 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 copies of one member (5 members, 11+ corresponding lines) · ×1
Edited copies of one member (5 members, 11+ corresponding lines) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1384— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1384-1396 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3754-3764 | Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:991-1001 | Modules/Features/Reader/NineSliceGuideEditor.swift:106-117 | Modules/Features/Reader/ReaderBarRenderer.swift:370-380 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) Modules/Core/ReaderCore/Customization/ReadingSettingsScope.swift:49— Modules/Core/ReaderCore/Customization/ReadingSettingsScope.swift:49-72 | Modules/Core/ReaderCore/Customization/ReadingSettingsScope.swift:78-99 | Modules/Features/Settings/CustomizationImportOverview.swift:27-46 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 12+ corresponding lines) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) Modules/Features/BookDetail/BookDetailModuleRelatedSection.swift:11— Modules/Features/BookDetail/BookDetailModuleRelatedSection.swift:11-23 | Modules/Features/BookDetail/BookDetailSeriesSection.swift:43-54 | Modules/Features/BookDetail/BookDetailShelfGenreViews.swift:12-25 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) Modules/Features/Bookshelf/HomeView.swift:1061— Modules/Features/Bookshelf/HomeView.swift:1061-1084 | Modules/Features/Onboarding/OnboardingView.swift:118-143 — 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· Edited copies of one member (3 members, 17+ corresponding lines) · ×1
Edited copies of one member (3 members, 17+ corresponding lines) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1336— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1336-1352 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1359-1375 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1384-1401 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 15+ corresponding lines) · ×1
Edited copies of one member (6 members, 15+ corresponding lines) Modules/Core/BookSource/BookSourceFetcher+TOC.swift:95— Modules/Core/BookSource/BookSourceFetcher+TOC.swift:95-109 | Modules/Core/BookSource/BookSourceHealthChecker.swift:168-183 | Targets/Yuedu/SharedApp/AppDependencies.swift:107-124 | Targets/Yuedu/SharedApp/AppDependencies.swift:127-142 | Targets/Yuedu/SharedApp/AppDependencies.swift:302-319 | Targets/Yuedu/SharedApp/AppDependencies.swift:321-339 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:213— Modules/Core/ReaderCore/Customization/AppearancePageBackground.swift:213-222 | Modules/Features/Reader/ReaderChromeCustomization.swift:200-214 | Targets/Yuedu/SharedApp/DefaultCoverLibrary.swift:43-52 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4109-4118 | Targets/Yuedu/SharedApp/GlobalSettings.swift:4234-4243 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 4+ corresponding lines) · ×1
Edited copies of one member (8 members, 4+ corresponding lines) Targets/Yuedu/SharedApp/AppLogger.swift:41— Targets/Yuedu/SharedApp/AppLogger.swift:41-44 | Targets/Yuedu/SharedApp/AppLogger.swift:46-49 | Targets/Yuedu/SharedApp/AppLogger.swift:51-54 | Targets/Yuedu/SharedApp/AppLogger.swift:56-59 | Targets/Yuedu/SharedApp/AppLogger.swift:64-67 | Targets/Yuedu/SharedApp/AppLogger.swift:69-72 | Targets/Yuedu/SharedApp/AppLogger.swift:74-77 | Targets/Yuedu/SharedApp/AppLogger.swift:79-82 — These 8 members are one piece of code written 8 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 6+ corresponding lines) · ×1
Edited copies of one member (4 members, 6+ corresponding lines) Modules/Core/ReaderCore/CoreText/MathMLRendering.swift:99— Modules/Core/ReaderCore/CoreText/MathMLRendering.swift:99-104 | Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:889-894 | Modules/Features/Reader/ReaderView+SourceChange.swift:1452-1464 | Modules/Services/RSS/RSSUtilities.swift:435-441 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 7+ corresponding lines) · ×1
Edited copies of one member (4 members, 7+ corresponding lines) Modules/Features/Reader/ChapterTitleDesignerModel.swift:74— Modules/Features/Reader/ChapterTitleDesignerModel.swift:74-80 | Modules/Features/Reader/ChapterTitleDesignerModel.swift:82-88 | Modules/Features/Reader/ChapterTitleDesignerModel.swift:200-208 | Modules/Features/Reader/ChapterTitleDesignerModel.swift:210-217 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) Modules/Core/Comic/MangaChapter.swift:310— Modules/Core/Comic/MangaChapter.swift:310-313 | Modules/Core/ReaderCore/CoreText/OnlineImageLoader.swift:148-151 | Modules/Core/ReaderCore/CoreText/ReaderWebEmbed.swift:93-96 | Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:627-631 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) Modules/Features/Explore/DiscoverPageSettingsSheet.swift:255— Modules/Features/Explore/DiscoverPageSettingsSheet.swift:255-265 | Modules/Features/RSS/RSSListView.swift:937-947 | Modules/SharedUI/Adaptive/SoftScrollEdgeStyle.swift:34-44 | Modules/SharedUI/Components/RootTabTitle.swift:190-200 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 1+ corresponding lines) · ×1
Edited copies of one member (3 members, 1+ corresponding lines) Modules/Features/AI/AIBookCharactersView.swift:133— Modules/Features/AI/AIBookCharactersView.swift:133-133 | Modules/Features/AI/AICharacterMemoryView.swift:397-399 | Modules/Features/AI/AIStatusView.swift:120-122 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 1 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2637— Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2637-2639 | Modules/Core/TTS/TTSAudioProvider.swift:1029-1031 | Modules/Services/Online/ChapterFetcher.swift:827-832 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (1 corresponding lines) · ×1
Edited copy of a member (1 corresponding lines) Modules/Features/BookDetail/BookDetailComponents.swift:1193— Modules/Features/BookDetail/BookDetailComponents.swift:1193-1193 | Modules/Features/Explore/Home/HomeBookCard.swift:178-180 — These two members are one piece of code written twice and then edited apart: 1 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.
Duplicated block (39–40 lines × 2) Modules/Features/WebBrowser/BrowserView.swift:196— Modules/Features/WebBrowser/BrowserView.swift:196-235 | Modules/Features/WebBrowser/BrowserView.swift:257-295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/WebBrowser/BrowserView.swift:196` it does not close everything it opens, so those 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 (33 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:827— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:827-859 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:951-983 — both copies are in the same file, so extract the 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, `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:860` calls `debugVerticalLog` and `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:984` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27 lines × 2) Modules/Core/EPUB/PublicationSession.swift:1175— Modules/Core/EPUB/PublicationSession.swift:1175-1201 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:275-301 — 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 `Modules/Core/EPUB/PublicationSession.swift:1175` 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 (25–27 lines × 2) Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2384— Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:2384-2408 | Modules/Services/RSS/RSSUtilities.swift:761-787 — 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 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 (26–27 lines × 2) Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:816— Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:816-842 | Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:885-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:816` 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 (23–27 lines × 2) Modules/Features/BookDetail/ChangeCoverView.swift:103— Modules/Features/BookDetail/ChangeCoverView.swift:103-129 | Modules/Features/BookDetail/OnlineCoverSearchView.swift:55-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/BookDetail/ChangeCoverView.swift:103` it does not close everything it opens, so those exact lines 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–26 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:490— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:490-515 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:475-498 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:490` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (4–26 lines × 3) Modules/Core/EPUB/EPUBBookParser.swift:66— Modules/Core/EPUB/EPUBBookParser.swift:66-69 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:68-93 | Modules/Services/Online/BookContentProviderAdapters.swift:67-92 — 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 `Modules/Core/EPUB/EPUBBookParser.swift:66` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (25 lines × 2) Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:948— Modules/Core/ReaderCore/CoreText/OnlineProviderAttributedStringBuilder.swift:948-972 | Modules/Core/ReaderCore/CoreText/TXTLazyAttributedStringBuilder.swift:91-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (23–24 lines × 2) Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:392— Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:392-415 | Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:441-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/ModernParser/RuleAnalyzer.swift:392` 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) Modules/Features/RSS/RSSFeedView.swift:119— Modules/Features/RSS/RSSFeedView.swift:119-142 | Modules/Features/RSS/RSSFeedView.swift:349-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/RSS/RSSFeedView.swift:119` 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 (32 lines × 2) Modules/Core/RuleEngine/RuleEngine.swift:578— Modules/Core/RuleEngine/RuleEngine.swift:578-609 | Modules/Core/RuleEngine/RuleEngine.swift:619-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/RuleEngine/RuleEngine.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–21 lines × 4) Modules/Services/Network/WebViewFetcher.swift:217— Modules/Services/Network/WebViewFetcher.swift:217-237 | Modules/Services/Network/WebViewFetcher.swift:273-289 | Modules/Services/Network/WebViewFetcher.swift:356-373 | Modules/Services/Network/WebViewFetcher.swift:520-536 — 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 `Modules/Services/Network/WebViewFetcher.swift:217` 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 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 (21 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:861— Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:861-881 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:984-1004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:861` it does not close everything it opens, so those 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, `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:860` calls `debugVerticalLog` and `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:983` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20–21 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:316— Modules/Features/BookDetail/AudiobookDetailView.swift:316-336 | Modules/Features/BookDetail/VideoDetailView.swift:219-238 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:316` 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.
Duplicated block (17–21 lines × 2) Modules/Services/Network/WebViewFetcher.swift:244— Modules/Services/Network/WebViewFetcher.swift:244-264 | Modules/Services/Network/WebViewFetcher.swift:297-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Network/WebViewFetcher.swift:244` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 2) Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:328— Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:328-347 | Modules/Core/ReaderCore/Customization/ReedenThemeImporter.swift:775-794 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/ReaderCore/Customization/HighlightPackImporter.swift:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–19 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2295— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2295-2312 | Modules/Features/Reader/CoreTextCollectionScrollViewController.swift:675-693 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2295` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:310— Modules/Features/BookDetail/AudiobookDetailView.swift:310-327 | Modules/Features/BookDetail/OnlineBookView.swift:346-363 | Modules/Features/BookDetail/VideoDetailView.swift:213-230 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:310` 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–18 lines × 2) Modules/Features/Reader/TTS/TTSRoleCastView.swift:628— Modules/Features/Reader/TTS/TTSRoleCastView.swift:628-645 | Modules/Features/Settings/TTSCloudVoiceSettingsView.swift:208-223 — 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 `Modules/Features/Reader/TTS/TTSRoleCastView.swift:628` 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–18 lines × 2) Modules/Features/Settings/ReplaceRuleListView.swift:98— Modules/Features/Settings/ReplaceRuleListView.swift:98-115 | Modules/Features/Settings/TXTTocRuleListView.swift:74-81 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Settings/ReplaceRuleListView.swift:98` 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 (15–16 lines × 4) Modules/Features/RSS/RSSListView.swift:1177— Modules/Features/RSS/RSSListView.swift:1177-1192 | Modules/Features/RSS/RSSListView.swift:1451-1466 | Modules/Features/RSS/RSSListView.swift:1557-1571 | Modules/Features/RSS/RSSListView.swift:1658-1672 — 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 `Modules/Features/RSS/RSSListView.swift:1177` 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–16 lines × 3) Modules/Core/EPUB/PublicationSession.swift:1189— Modules/Core/EPUB/PublicationSession.swift:1189-1204 | Modules/Features/Reader/ChapterTitleStyleSettingsView.swift:169-177 | Modules/Services/LibraryStore/UniversalBookResourceAdapter.swift:289-304 — 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 `Modules/Core/EPUB/PublicationSession.swift:1189` 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 × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:338— Modules/Features/BookDetail/AudiobookDetailView.swift:338-353 | Modules/Features/BookDetail/OnlineBookView.swift:374-389 | Modules/Features/BookDetail/VideoDetailView.swift:601-616 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.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.
Duplicated block (7–16 lines × 2) Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:17— Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:17-23 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:653-668 — 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 `Modules/Core/ReaderCore/BrowserLayout/BrowserReaderAttributes.swift:17` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–16 lines × 2) Modules/Features/BookSource/BookSourceDebugView.swift:184— Modules/Features/BookSource/BookSourceDebugView.swift:184-197 | Modules/Features/Settings/DiagnosticsRowViews.swift:68-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookSource/BookSourceDebugView.swift:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) Modules/Features/Reader/ReaderDownloadOptionsView.swift:470— Modules/Features/Reader/ReaderDownloadOptionsView.swift:470-484 | Modules/Features/Settings/DownloadManagementView.swift:422-437 — 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 `Modules/Features/Settings/DownloadManagementView.swift:422` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:621— Modules/Features/BookDetail/AudiobookDetailView.swift:621-635 | Modules/Features/BookDetail/OnlineBookView.swift:684-698 | Modules/Features/BookDetail/VideoDetailView.swift:637-650 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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–15 lines × 3) Modules/Features/BookDetail/AudiobookDetailView.swift:749— Modules/Features/BookDetail/AudiobookDetailView.swift:749-760 | Modules/Features/BookDetail/OnlineBookView.swift:969-983 | Modules/Features/BookDetail/VideoDetailView.swift:832-839 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:749` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) Modules/Features/BookSource/BookSourceDebugView.swift:74— Modules/Features/BookSource/BookSourceDebugView.swift:74-88 | Modules/Features/Settings/BackupSyncView.swift:31-45 | Modules/Features/Settings/LanServerView.swift:80-94 — 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 `Modules/Features/BookSource/BookSourceDebugView.swift:74` 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, `Modules/Features/BookSource/BookSourceDebugView.swift:90` calls `accessibilityHidden` and `Modules/Features/Settings/BackupSyncView.swift:47` 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–15 lines × 2) Modules/Core/BookSource/BookSourceFetcher+BookInfo.swift:71— Modules/Core/BookSource/BookSourceFetcher+BookInfo.swift:71-80 | Modules/Core/BookSource/BookSourceFetcher+TOC.swift:198-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/BookSource/BookSourceFetcher+BookInfo.swift:71` it does not close everything it opens, so those exact lines 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–15 lines × 2) Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2016— Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2016-2022 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2075-2089 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2075` 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–15 lines × 2) Modules/Features/BookDetail/AudiobookDetailView.swift:697— Modules/Features/BookDetail/AudiobookDetailView.swift:697-707 | Modules/Features/BookDetail/OnlineBookView.swift:916-930 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:697` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–14 lines × 4) Modules/Features/BookSource/BookSourceCheckView.swift:69— Modules/Features/BookSource/BookSourceCheckView.swift:69-80 | Modules/Features/BookSource/BookSourceRuleDebugView.swift:129-142 | Modules/Features/BookSource/SourceImportJSONEditor.swift:62-73 | Modules/Features/Settings/TXTTocRuleEditView.swift:118-125 — 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 `Modules/Features/BookSource/BookSourceCheckView.swift:69` 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–14 lines × 3) Modules/Core/EPUB/PublicationSession.swift:1811— Modules/Core/EPUB/PublicationSession.swift:1811-1824 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:316-327 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:343-353 — 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 `Modules/Core/EPUB/PublicationSession.swift:1811` 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 (9–14 lines × 3) Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:70— Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:70-83 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:123-136 | Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:963-971 — 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 `Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.swift:70` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–14 lines × 2) Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:233— Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:233-246 | Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:390-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/BookSource/BookSourceFetcher+Chapter.swift:233` 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. 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 (9–14 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:452— Modules/Core/ReaderCore/CoreText/CoreTextChunk.swift:452-460 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2025-2038 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 (12–14 lines × 2) Modules/Core/TTS/TTSAudioProvider.swift:785— Modules/Core/TTS/TTSAudioProvider.swift:785-798 | Modules/Core/TTS/TTSLoginScript.swift:105-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/TTS/TTSAudioProvider.swift:785` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Core/TTS/TTSAudioProvider.swift:784` calls `merge` and `Modules/Core/TTS/TTSLoginScript.swift:104` 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 (2–14 lines × 4) Modules/Features/BookDetail/AudiobookDetailView.swift:925— Modules/Features/BookDetail/AudiobookDetailView.swift:925-938 | Modules/Features/BookDetail/OnlineBookView.swift:1152-1161 | Modules/Features/BookDetail/OnlineBookView.swift:1172-1173 | Modules/Features/BookDetail/VideoDetailView.swift:910-923 — before extracting anything, compare `Modules/Features/BookDetail/AudiobookDetailView.swift` and `Modules/Features/BookDetail/OnlineBookView.swift` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 248 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 `Modules/Features/BookDetail/AudiobookDetailView.swift:925` 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 (1–14 lines × 3) Modules/Services/Works/AuthorShelf.swift:111— Modules/Services/Works/AuthorShelf.swift:111-111 | Modules/Services/Works/AuthorWorks.swift:133-146 | Modules/Services/Works/ShelfGenres.swift:16-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `Modules/Services/Works/AuthorShelf.swift:111` 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.
Duplicated block (13 lines × 4) Modules/Features/BookSource/BookSourceCheckOptionsView.swift:78— Modules/Features/BookSource/BookSourceCheckOptionsView.swift:78-90 | Modules/Features/BookSource/BookSourceInfoSheet.swift:106-118 | Modules/Features/Settings/BackupSyncView.swift:38-50 | Modules/Features/Settings/CacheManagementView.swift:168-180 — 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 `Modules/Features/BookSource/BookSourceCheckOptionsView.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Features/BookSource/BookSourceCheckOptionsView.swift:77` calls `scrollIndicators` and `Modules/Features/BookSource/BookSourceInfoSheet.swift:105` 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–13 lines × 3) Modules/Features/BookSource/BookSourceAddFlow.swift:403— Modules/Features/BookSource/BookSourceAddFlow.swift:403-414 | Modules/Features/BookSource/BookSourceAddFlow.swift:472-483 | Modules/Features/Settings/TTSSettingsView.swift:527-539 — 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 `Modules/Features/BookSource/BookSourceAddFlow.swift:403` it does not close everything it opens, so those exact lines 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–13 lines × 2) Modules/Core/BookSource/SharedImportQueueDrainer.swift:690— Modules/Core/BookSource/SharedImportQueueDrainer.swift:690-700 | Modules/Core/BookSource/SharedImportQueueDrainer.swift:728-740 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/BookSource/SharedImportQueueDrainer.swift:690` it does not close everything it opens, so those 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, `Modules/Core/BookSource/SharedImportQueueDrainer.swift:687` calls `readSample` and `Modules/Core/BookSource/SharedImportQueueDrainer.swift:726` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 5) Modules/Features/BookSource/BookSourceCheckOptionsView.swift:78— Modules/Features/BookSource/BookSourceCheckOptionsView.swift:78-89 | Modules/Features/BookSource/BookSourceCheckView.swift:68-79 | Modules/Features/BookSource/BookSourceInfoSheet.swift:106-117 | Modules/Features/Settings/BackupSyncView.swift:38-49 | Modules/Features/Settings/CacheManagementView.swift:168-179 — 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 `Modules/Features/BookSource/BookSourceCheckOptionsView.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Features/BookSource/BookSourceCheckOptionsView.swift:77` calls `scrollIndicators` and `Modules/Features/BookSource/BookSourceInfoSheet.swift:105` 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 × 4) Modules/Features/BookSource/BookSourceDebugView.swift:78— Modules/Features/BookSource/BookSourceDebugView.swift:78-89 | Modules/Features/Settings/BackupSyncView.swift:35-46 | Modules/Features/Settings/CacheManagementView.swift:165-176 | Modules/Features/Settings/LanServerView.swift:84-95 — before extracting anything, compare `Modules/Features/Settings/BackupSyncView.swift` and `Modules/Features/Settings/CacheManagementView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookSource/BookSourceDebugView.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Modules/Features/BookSource/BookSourceDebugView.swift:90` calls `accessibilityHidden` and `Modules/Features/Settings/BackupSyncView.swift:47` 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 (11–12 lines × 3) Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:398— Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:398-409 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:446-456 | Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:558-568 — 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 `Modules/Core/ReaderCore/CoreText/EPUBStyleResolver.swift:398` it does not close everything it opens, so those exact lines 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 × 3) Modules/Services/Network/WebViewFetcher.swift:251— Modules/Services/Network/WebViewFetcher.swift:251-265 | Modules/Services/Network/WebViewFetcher.swift:303-314 | Modules/Services/Network/WebViewFetcher.swift:609-622 — 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 `Modules/Services/Network/WebViewFetcher.swift:251` 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–12 lines × 2) Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:147— Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:147-158 | Modules/Core/RuleEngine/ModernParser/XPathExtractor.swift:448-457 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Core/RuleEngine/ModernParser/CssExtractor.swift:147` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–12 lines × 2) Modules/Features/Reader/ReaderView+SourceChange.swift:382— Modules/Features/Reader/ReaderView+SourceChange.swift:382-393 | Modules/Features/Reader/ReaderView+SourceChange.swift:570-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/Reader/ReaderView+SourceChange.swift:382` it does not close everything it opens, so those exact lines 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 × 4) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:254— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:254-264 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:317-327 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:380-390 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:437-447 — 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.
Duplicated block (8–11 lines × 2) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1418— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1418-1425 | Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:2253-2263 — both copies are in the same file, so extract the 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. 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–11 lines × 2) Modules/Features/Subscription/PaywallMemberPage.swift:72— Modules/Features/Subscription/PaywallMemberPage.swift:72-78 | Modules/Features/Subscription/PaywallView.swift:147-157 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `Modules/Features/Subscription/PaywallMemberPage.swift:72` 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 (10 lines × 5) Modules/Core/RuleEngine/JSRuleEngineRunner.swift:253— Modules/Core/RuleEngine/JSRuleEngineRunner.swift:253-262 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:316-325 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:379-388 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:436-445 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:468-477 — all 5 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, `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:314` calls `ruleBookInfoToDict` and `Modules/Core/RuleEngine/JSRuleEngineRunner.swift:466` 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–10 lines × 2) Modules/Features/Reader/TTS/AudiobookView.swift:1125— Modules/Features/Reader/TTS/AudiobookView.swift:1125-1130 | Modules/Features/Stats/ReadingStatsView.swift:63-72 — 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 `Modules/Features/Reader/TTS/AudiobookView.swift:1125` 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 (4–9 lines × 3) Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:173— Modules/Core/ReaderCore/CoreText/ChapterOutline.swift:173-181 | Modules/Core/ReaderCore/CoreText/CoreTextChunkSlicer.swift:813-820 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3562-3565 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `Modules/Core/ReaderCore/CoreText/ChapterOutline.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. 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 (7–9 lines × 2) Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:212— Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:212-220 | Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:841-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:212` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–9 lines × 2) Modules/SharedUI/Components/BookCoverImage.swift:300— Modules/SharedUI/Components/BookCoverImage.swift:300-305 | Modules/SharedUI/Components/GeneratedBookCover.swift:677-685 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/SharedUI/Components/BookCoverImage.swift:300` 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 (4–8 lines × 4) Modules/Core/EPUB/EPUBBookParser.swift:95— Modules/Core/EPUB/EPUBBookParser.swift:95-98 | Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:155-158 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:96-103 | Modules/Services/Online/BookContentProviderAdapters.swift:95-102 — 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 `Modules/Core/EPUB/EPUBBookParser.swift:95` 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 after the matched lines, `Modules/Core/EPUB/EPUBBookParser.swift:98` calls `trimmingCharacters` and `Modules/Services/LibraryStore/UniversalBookInterfaces.swift:103` 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 (7–8 lines × 2) Modules/Services/LibraryStore/UniversalBookInterfaces.swift:125— Modules/Services/LibraryStore/UniversalBookInterfaces.swift:125-131 | Modules/Services/LibraryStore/UniversalBookInterfaces.swift:139-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 `Modules/Services/LibraryStore/UniversalBookInterfaces.swift:125` 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, `Modules/Services/LibraryStore/UniversalBookInterfaces.swift:124` calls `parseUnifiedChapters`, `content`, `makeTableOfContents` and `Modules/Services/LibraryStore/UniversalBookInterfaces.swift:139` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–7 lines × 4) Modules/Features/AI/AIBookshelfOrganizerView.swift:61— Modules/Features/AI/AIBookshelfOrganizerView.swift:61-66 | Modules/Features/AI/AICustomPromptListView.swift:15-20 | Modules/Features/Library/Modules/AIRecommendationModuleView.swift:31-36 | Modules/Features/Reader/ReaderBatterySVGImportView.swift:162-168 — 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 `Modules/Features/AI/AIBookshelfOrganizerView.swift:61` it does not close everything it opens, so those 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 (3–7 lines × 4) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1390— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1390-1396 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3758-3764 | Modules/Core/ReaderCore/CoreText/CoreTextScrollEngine.swift:995-1001 | Modules/Features/Reader/ReaderBarRenderer.swift:372-374 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1390` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3757` calls `CGSize`, `CGRect` and `Modules/Features/Reader/ReaderBarRenderer.swift:372` 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–13 lines × 3) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3201— Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3201-3209 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3242-3254 | Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3311-3323 — 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, `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3198` calls `handler`, `bodyOnly` and `Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3242` 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 (3–7 lines × 3) Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:376— Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:376-378 | Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:433-439 | Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:451-457 — 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 `Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:376` it does not close everything it opens, so those 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 (6–7 lines × 2) Modules/Features/BookSource/BookSourceListView.swift:889— Modules/Features/BookSource/BookSourceListView.swift:889-895 | Modules/Features/Bookshelf/HomeView.swift:1881-1886 — 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 `Modules/Features/BookSource/BookSourceListView.swift:889` it does not close everything it opens, so those exact lines 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–6 lines × 2) Modules/Features/BookSource/BookSourceFormLoginView.swift:977— Modules/Features/BookSource/BookSourceFormLoginView.swift:977-981 | Modules/Features/BookSource/BookSourceFormLoginView.swift:1039-1044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Features/BookSource/BookSourceFormLoginView.swift:1039` it does not close everything it opens, so those 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 (5 lines × 6) Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1086— Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1086-1090 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2349-2353 | Modules/Core/ReaderCore/CoreText/EPUBAttributedStringBuilder.swift:441-445 | Modules/Core/ReaderCore/CoreText/HTMLAttributedStringBuilder.swift:736-740 | Modules/Core/ReaderCore/CoreText/NodeAttributedStringRenderer.swift:2558-2562 | Modules/Core/ReaderCore/CoreText/RunDelegateProvider.swift:435-439 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 6 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Core/ReaderCore/CoreText/CoreTextPageView.swift:1086` 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 `limit` to `Int` in one and `Int = 80` 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 (6 lines × 5) Modules/Services/Works/Providers/ShelfProvider.swift:141— Modules/Services/Works/Providers/ShelfProvider.swift:141-146 | Modules/Services/Works/Providers/ShelfProvider.swift:163-168 | Modules/Services/Works/Providers/ShelfProvider.swift:200-205 | Modules/Services/Works/Providers/ShelfProvider.swift:220-225 | Modules/Services/Works/Providers/ShelfProvider.swift:245-250 — all 5 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–9 lines × 3) Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:28— Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:28-34 | Modules/Features/Reader/ReaderBookmarkToast.swift:35-43 | Modules/Features/Reader/ReaderBookmarkToast.swift:58-65 — 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 `Modules/Features/Reader/ReaderAutoChangeSourceBanner.swift:28` 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 (3–5 lines × 6) Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:85— Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:85-89 | Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:128-130 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2664-2668 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:2703-2705 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3402-3404 | Modules/Core/ReaderCore/CoreText/CoreTextPaginator.swift:3483-3485 — 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 `Modules/Core/ReaderCore/CoreText/CoreTextChunkAttachmentExtractor.swift:85` it does not close everything it opens, so those 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 (4–5 lines × 3) Modules/Core/RuleEngine/RuleEngine.swift:1302— Modules/Core/RuleEngine/RuleEngine.swift:1302-1305 | Modules/Features/WebBrowser/BrowserView.swift:503-507 | Modules/Features/WebBrowser/BrowserView.swift:529-533 — 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 `Modules/Core/RuleEngine/RuleEngine.swift:1302` 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 (3–5 lines × 3) Modules/Services/RuleModules/ModuleProvider.swift:161— Modules/Services/RuleModules/ModuleProvider.swift:161-165 | Modules/Services/RuleModules/ModuleWorkDetail.swift:17-21 | Modules/Services/RuleModules/ModuleWorkDetail.swift:61-63 — 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 `Modules/Services/RuleModules/ModuleProvider.swift:161` 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 (18 lines × 2) Modules/Services/Offline/DownloadActivityAttributes.swift:30— Modules/Services/Offline/DownloadActivityAttributes.swift:30-47 | Widget/DownloadActivityAttributes.swift:30-69 — before extracting anything, compare `Modules/Services/Offline/DownloadActivityAttributes.swift` and `Widget/DownloadActivityAttributes.swift` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Modules/Services/Offline/DownloadActivityAttributes.swift:30` 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 (5 lines × 12) Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:355— Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:355-359 | Modules/Core/ReaderCore/CoreText/SVGWebViewRasterizer.swift:690-694 | Modules/Core/RuleEngine/JSRuleEngineRunner.swift:498-502 | Modules/Core/RuleEngine/ModernParser/JS/LegadoHeadlessWebView.swift:243-247 | Modules/Features/BookDetail/BookIntroRichView.swift:189-193 | Modules/Features/BookSource/JsBridgeBrowserView.swift:687-691 | Modules/Features/RSS/RSSArticleReaderView.swift:344-348 | Modules/Features/Reader/ReaderWebEmbedManager.swift:118-122 | Modules/Features/WebBrowser/BrowserView.swift:441-445 | Modules/Features/WebBrowser/BrowserView.swift:669-673 | Modules/Services/Network/WebViewFetcher.swift:841-845 | Modules/SharedUI/Components/SourceLoginWebView.swift:208-212 — there are 12 copies across 11 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 12 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Modules/Features/WebBrowser/BrowserView.swift:436` calls `URL`, `load`, `URLRequest` and `Modules/SharedUI/Components/SourceLoginWebView.swift:204` 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 (7 lines × 5) Modules/Services/iCloud/ICloudSyncManager.swift:125— Modules/Services/iCloud/ICloudSyncManager.swift:125-131 | Targets/Yuedu/SharedApp/GlobalSettings.swift:783-789 | Targets/Yuedu/SharedApp/GlobalSettings.swift:950-959 | Targets/Yuedu/SharedApp/GlobalSettings.swift:975-984 | Targets/Yuedu/SharedApp/GlobalSettings.swift:1219-1225 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 4) Modules/Services/RuleModules/RuleModuleValidator.swift:322— Modules/Services/RuleModules/RuleModuleValidator.swift:322-331 | Modules/Services/RuleModules/RuleModuleValidator.swift:528-537 | Modules/Services/RuleModules/RuleModuleValidator.swift:567-576 | Modules/Services/RuleModules/RuleModuleValidator.swift:621-630 — 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.
Coverage not measured — Swift suite — Coverage NOT MEASURED: the Swift half could not be measured — llvm-cov's export for Packages/CLexbor carried no production source rows. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
P12 · CI test-gate honesty· Test suite runs only after the merge · ×1
Test suite runs only after the merge — `REDACTED` run(s) the test suite, but no workflow that runs tests is triggered by a pull request (or a merge queue) — so the suite reports on code that is already on the default branch. A red build there blocks nothing and the only remedy is a revert. Add the pull-request trigger to the workflow that runs your suite so the gate applies before the merge, not after it.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Outbound HTTP without resilience gateway/scripts/integration-auth.mjs:43— `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) gateway/src/identityToolkit.ts:68— gateway/src/identityToolkit.ts:68 · gateway/src/identityToolkit.ts:259 — the two spans are one implementation copied and then locally edited — 248 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (12 lines × 3 locations) gateway/src/callableProxy.ts:61— gateway/src/callableProxy.ts:61 · gateway/src/identityToolkit.ts:72 · gateway/src/identityToolkit.ts:263 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) REDACTED:126— REDACTED:126 · REDACTED:153 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 7 locations) gateway/src/routes/account.ts:51— gateway/src/routes/account.ts:51 · REDACTED:209 · gateway/src/routes/avatar.ts:95 · REDACTED:250 · +3 more site(s) not listed — the 7 copies are spread across 6 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 3 locations) gateway/src/reauth.ts:114— gateway/src/reauth.ts:114 · REDACTED:221 · gateway/src/routes/subscription.ts:109 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Complex function _grabArticle (cyclomatic 106, cognitive 250) Resources/Assets/Readability.js:1021— _grabArticle has cyclomatic complexity 106 and cognitive complexity 250; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function routeExtractValue (cyclomatic 47, cognitive 56) REDACTED:970— routeExtractValue has cyclomatic complexity 47 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseSearchResultsJSON (cyclomatic 37, cognitive 38) REDACTED:1101— parseSearchResultsJSON has cyclomatic complexity 37 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function mapIdentityToolkitError (cyclomatic 36, cognitive 29) gateway/src/errors.ts:96— mapIdentityToolkitError has cyclomatic complexity 36 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function extractValueFromObject (cyclomatic 33, cognitive 40) REDACTED:811— extractValueFromObject has cyclomatic complexity 33 and cognitive complexity 40; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 32, cognitive 46) Resources/Assets/Readability.js:1643— (anonymous) has cyclomatic complexity 32 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function routeExtractList (cyclomatic 29, cognitive 58) REDACTED:911— routeExtractList has cyclomatic complexity 29 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyJsonToken (cyclomatic 26, cognitive 55) REDACTED:728— applyJsonToken has cyclomatic complexity 26 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 25, cognitive 23) functions/src/feedbackTriage.ts:65— (anonymous) has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function shouldRemoveNode (cyclomatic 25, cognitive 19) Resources/Assets/Readability.js:2561— shouldRemoveNode has cyclomatic complexity 25 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 24, cognitive 35) Resources/Assets/Readability.js:2341— (anonymous) has cyclomatic complexity 24 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function queryElements (cyclomatic 23, cognitive 34) REDACTED:90— queryElements has cyclomatic complexity 23 and cognitive complexity 34; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 38) Resources/Assets/Readability.js:2450— (anonymous) has cyclomatic complexity 22 and cognitive complexity 38; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function evaluateRuleLike (cyclomatic 22, cognitive 20) REDACTED:394— evaluateRuleLike has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function evaluateTemplateExpression (cyclomatic 20, cognitive 16) REDACTED:307— evaluateTemplateExpression has cyclomatic complexity 20 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getList (cyclomatic 19, cognitive 26) REDACTED:127— getList has cyclomatic complexity 19 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function splitTopLevel (cyclomatic 19, cognitive 23) REDACTED:170— splitTopLevel has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 19, cognitive 17) REDACTED:1227— (anonymous) has cyclomatic complexity 19 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function sanitizePreferences (cyclomatic 18, cognitive 23) gateway/src/policy.ts:146— sanitizePreferences has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getAttr (cyclomatic 18, cognitive 17) REDACTED:55— getAttr has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getAttr (cyclomatic 18, cognitive 16) REDACTED:508— getAttr has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function safeQuerySelectorAll (cyclomatic 16, cognitive 21) REDACTED:74— safeQuerySelectorAll has cyclomatic complexity 16 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function signInWithIdp (cyclomatic 16, cognitive 19) gateway/src/identityToolkit.ts:170— signInWithIdp has cyclomatic complexity 16 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function extractValueByJsoupDefaultFromElements (cyclomatic 16, cognitive 18) REDACTED:623— extractValueByJsoupDefaultFromElements has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Readability (cyclomatic 16, cognitive 16) Resources/Assets/Readability.js:27— Readability has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function splitTrailingPutDirective (cyclomatic 15, cognitive 21) REDACTED:220— splitTrailingPutDirective has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _getArticleTitle (cyclomatic 15, cognitive 19) Resources/Assets/Readability.js:553— _getArticleTitle has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function verifyReauthentication (cyclomatic 15, cognitive 19) gateway/src/reauth.ts:24— verifyReauthentication has cyclomatic complexity 15 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseChapterPayload (cyclomatic 15, cognitive 14) REDACTED:1251— parseChapterPayload has cyclomatic complexity 15 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getElementsBySegment (cyclomatic 14, cognitive 23) REDACTED:566— getElementsBySegment has cyclomatic complexity 14 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseJsoupSegment (cyclomatic 14, cognitive 18) REDACTED:540— parseJsoupSegment has cyclomatic complexity 14 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseSearchResults (cyclomatic 14, cognitive 14) REDACTED:1076— parseSearchResults has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function refreshSession (cyclomatic 14, cognitive 14) gateway/src/identityToolkit.ts:247— refreshSession has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function getString (cyclomatic 14, cognitive 12) REDACTED:358— getString has cyclomatic complexity 14 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _markDataTables (cyclomatic 13, cognitive 20) Resources/Assets/Readability.js:2277— _markDataTables has cyclomatic complexity 13 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function extractValueByCss (cyclomatic 13, cognitive 18) REDACTED:659— extractValueByCss has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function applyTocFormat (cyclomatic 13, cognitive 15) REDACTED:439— applyTocFormat has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function buildsUnderReview (cyclomatic 13, cognitive 15) functions/src/reviewBuildPolicy.ts:49— buildsUnderReview has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 13, cognitive 11) gateway/src/routes/profile.ts:26— (anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function shouldApplyTransaction (cyclomatic 13, cognitive 9) functions/src/transactionUpdatePolicy.ts:8— shouldApplyTransaction has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· Resources/Assets/Readability.js · ×1
Resources/Assets/Readability.js: 2500 lines of code Resources/Assets/Readability.js:1— Resources/Assets/Readability.js has 2500 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 1220 lines of code REDACTED:1— REDACTED has 1220 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
functions/src/index.ts: 639 lines of code functions/src/index.ts:1— functions/src/index.ts has 639 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
Dead file (~2792 LoC) Resources/Assets/Readability.js— no import path from any entry point (11 application, 1 tooling, 17 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~242 LoC) REDACTED— no import path from any entry point (11 application, 1 tooling, 17 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Duplicated predicate functions/src/feedbackPush.ts:33— `before === undefined || after === undefined` appears character-identically in 2 files — functions/src/feedbackPush.ts, functions/src/feedbackStatusSync.ts. 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 gateway/src/errors.ts:81— `error === null || typeof error !== "object"` appears character-identically in 2 files — gateway/src/errors.ts, REDACTED. 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 gateway/src/auth.ts:37— `match === null || match[1] === undefined` appears character-identically in 2 files — gateway/src/auth.ts, REDACTED. 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 gateway/src/callableProxy.ts:73— `parsed === null || typeof parsed !== "object"` appears character-identically in 2 files — gateway/src/callableProxy.ts, gateway/src/identityToolkit.ts. 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 functions/src/index.ts:322— `typeof value !== "string" || value.length === 0 || value.length > maxLength` appears character-identically in 2 files — functions/src/index.ts, gateway/src/policy.ts. 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 gateway/src/feedbackPolicy.ts:427— `value !== null && typeof value === "object" && !Array.isArray(value)` appears character-identically in 3 files — gateway/src/feedbackPolicy.ts, REDACTED, gateway/src/routes/profile.ts. 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 gateway/src/reauth.ts:115— `value === null || typeof value !== "object" || Array.isArray(value)` appears character-identically in 3 files — gateway/src/reauth.ts, REDACTED, gateway/src/routes/subscription.ts. 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 Modules/Core/AI/AIReadingEvidence.swift:75— `$0.isASCII && ($0.isLetter || $0.isNumber)` appears character-identically in 3 files — Modules/Core/AI/AIReadingEvidence.swift, Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift, Modules/Services/RuleModules/RuleModuleValidator.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 Modules/Services/LibraryStore/ShelfVersionSwitch.swift:120— `$0.kind == carried.kind && $0.hasSameStableLocation(as: carried)` appears character-identically in 2 files — Modules/Services/LibraryStore/ShelfVersionSwitch.swift, Modules/Services/LibraryStore/ShelfWorkService.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 Modules/Features/BookDetail/AudiobookDetailView.swift:605— `$0.sourceId == currentBook.sourceId && $0.bookUrl == currentBook.bookUrl` appears character-identically in 3 files — Modules/Features/BookDetail/AudiobookDetailView.swift, Modules/Features/BookDetail/OnlineBookView.swift, Modules/Features/BookDetail/VideoDetailView.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 Modules/Services/RuleModules/RuleModuleClient+Comments.swift:83— `(!names.contains("id") || has(item.id)) && (!names.contains("url") || has(item.bookUrl))` appears character-identically in 3 files — Modules/Services/RuleModules/RuleModuleClient+Comments.swift, Modules/Services/RuleModules/RuleModuleClient+Detail.swift, Modules/Services/RuleModules/RuleModuleClient+Reviews.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 Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:779— `(body.hasPrefix("\"") && body.hasSuffix("\"")) || (body.hasPrefix("'") && body.hasSuffix("'"))` appears character-identically in 2 files — Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift, Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.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 Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:861— `(value.hasPrefix("\"") && value.hasSuffix("\"")) || (value.hasPrefix("'") && value.hasSuffix("'"))` appears character-identically in 2 files — Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift, Modules/Core/ReaderCore/Customization/ReaderStyleCSSCodec.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 Modules/Core/TTS/AudiobookResourcePreloader.swift:53— `Task.isCancelled || error is CancellationError` appears character-identically in 2 files — Modules/Core/TTS/AudiobookResourcePreloader.swift, Modules/Services/Calibre/CalibreWirelessService.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 Modules/Services/Works/NextInSeries.swift:55— `authors.isEmpty || entry.authorKeys.isEmpty || !authors.isDisjoint(with: entry.authorKeys)` appears character-identically in 2 files — Modules/Services/Works/NextInSeries.swift, Modules/Services/Works/SeriesWorks.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 Modules/Services/LibraryStore/ChapterRenumbering.swift:53— `book.audioChapterIndex == 0 && book.audioTimeSeconds == 0` appears character-identically in 2 files — Modules/Services/LibraryStore/ChapterRenumbering.swift, Modules/Services/LibraryStore/ReadingChapterPlace.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 Modules/Services/LibraryStore/ChapterRenumbering.swift:50— `book.mangaChapterIndex == 0 && book.mangaPage == 0 && book.currentPosition == 0` appears character-identically in 2 files — Modules/Services/LibraryStore/ChapterRenumbering.swift, Modules/Services/LibraryStore/ReadingChapterPlace.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 Modules/Features/Bookshelf/HomeView.swift:475— `book.resolvedPipelineKind == .manga || book.resolvedPipelineKind == .fixedPage` appears character-identically in 3 files — Modules/Features/Bookshelf/HomeView.swift, Modules/Features/FixedPageReader/FixedPageReaderViewController.swift, Modules/Services/LibraryStore/BookStore.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 Modules/Features/Explore/Home/HomeChartCards.swift:55— `cards.isEmpty && redactionReasons.contains(.placeholder)` appears character-identically in 2 files — Modules/Features/Explore/Home/HomeChartCards.swift, Modules/Features/Explore/Home/HomeGroupedShelves.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 Modules/Services/Subscription/SubscriptionICloudMirror.swift:225— `ckError.code == .unknownItem || ckError.code == .zoneNotFound` appears character-identically in 2 files — Modules/Services/Subscription/SubscriptionICloudMirror.swift, Modules/Services/iCloud/ICloudSyncManager.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 Modules/Features/Explore/ExploreTileButtonStyle.swift:12— `configuration.isPressed && !reduceMotion` appears character-identically in 3 files — Modules/Features/Explore/ExploreTileButtonStyle.swift, Modules/Features/Reader/ReaderQuickThemePanelView.swift, Modules/SharedUI/Components/LoginFormGrid.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 Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift:637— `content is NSDictionary || content is NSArray` appears character-identically in 2 files — Modules/Core/RuleEngine/ModernParser/JsonExtractor.swift, Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.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 Modules/Core/AI/AIAgenticAssistant+Question.swift:193— `context.action == .question || context.customPrompt?.context == .book` appears character-identically in 2 files — Modules/Core/AI/AIAgenticAssistant+Question.swift, Modules/Core/AI/AIReadingEvidence.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 Modules/Core/BookSource/SharedImportQueueDrainer.swift:905— `dictionary["pattern"] != nil || dictionary["regex"] != nil || dictionary["replaceRegex"] != nil` appears character-identically in 2 files — Modules/Core/BookSource/SharedImportQueueDrainer.swift, Modules/Core/Replace/ReplaceRuleStore.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 Modules/Features/Reader/ReaderView+OnlineChapterLoading.swift:177— `epubRenderer.engine != nil || epubRenderer.scrollEngine != nil` appears character-identically in 2 files — Modules/Features/Reader/ReaderView+OnlineChapterLoading.swift, Modules/Features/Reader/ReaderView+PageBuilding.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.
Silent fallback default in catch Modules/Core/AI/AIRAGPipeline.swift:114— `parse` 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 Modules/Core/EPUB/EPUBMediaOverlay.swift:103— `parBlocks` 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 Modules/Core/EPUB/EPUBMediaOverlay.swift:131— `attributes` 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 Modules/Core/EPUB/PublicationSession.swift:1458— `opfIdentifiers` 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 Modules/Core/EPUB/PublicationSession.swift:1495— `parseSpineMetadata` 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 Modules/Core/EPUB/PublicationSession.swift:1545— `parseSpineReferences` 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 Modules/Core/EPUB/PublicationSession.swift:1649— `manifestItemsByID` 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 Modules/Core/EPUB/PublicationSession.swift:1685— `metaElements` 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 Modules/Core/EPUB/PublicationSession.swift:1712— `attributes` 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 Modules/Core/RuleEngine/WebNovelParser.swift:54— `parseTOC` 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 Modules/Core/RuleEngine/WebNovelParser.swift:279— `extractNextPageURL` 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 Modules/Core/TTS/TTSAudioProvider.swift:356— `urlLikeMatches` 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 Modules/Services/Diagnostics/DiagnosticLog.swift:505— `readEntries` 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 Modules/Services/LibraryStore/BookStore.swift:356— `content` 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 Modules/Services/RSS/RSSUtilities.swift:251— `htmlIconURLs` 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 Modules/Core/ReaderCore/BrowserLayout/EPUBBrowserLayoutResourceAdapter.swift:108— `prefetchImages` 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 Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:1007— `parseGroupSpans` 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 Modules/Core/ReaderCore/CoreText/EPUBAttributedStringBuilder.swift:93— `chapterDataSize` 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 Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:320— `textRuns` 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 Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:332— `textRuns` 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 Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:202— `html` 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 Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:203— `outerHtml` 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 Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:204— `text` 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 Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:221— `attr` 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 Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:223— `absUrl` 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.
Hand-rolled JSON/XML parsing via regex REDACTED:59— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Features/Bookshelf/AddBookView.swift:309— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/RuleEngine/NextPageLinkExtractor.swift:30— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/RuleEngine/ModernParser/ModernRuleEngine.swift:112— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/RuleEngine/ModernParser/URL/AnalyzeUrl.swift:149— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1314— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:1315— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/ReaderCore/ReaderHTMLUtilities.swift:1558— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:195— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/ReaderCore/CoreText/CommentBubbleSVGRecognizer.swift:832— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/ReaderCore/CoreText/ReviewCardContent.swift:321— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/ReaderCore/CoreText/ReviewCardSVGMetrics.swift:310— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/EPUB/EPUBMediaOverlay.swift:102— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex Modules/Core/EPUB/PublicationSession.swift:1684— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Services/RSS/RSSModels.swift:267— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/TTS/TTSAudioProvider.swift:741— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:967— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:999— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:1137— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/RuleEngine/ModernParser/Login/LoginManager.swift:434— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via string slicing Modules/Core/RuleEngine/ModernParser/JS/JSCoreEngine.swift:2338— A JSON key or XML tag is located in the text and the value cut out around it — a reordered, re-spaced or differently-typed document (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
Fat interface: LegadoJSBridgeExport (105 requirements) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:394— `LegadoJSBridgeExport` declares 105 requirements: `ajax`, `axja`, `ajaxAll`, `ajaxTestAll`, `connect`, `connectWithOptions`, `head`, `headWithOptions`, `post`, `postWithOptions`, `httpExecute`, `httpGet`, `importScript`, `readFile`, `readTxtFile`, `deleteFile`, `downloadFile`, `cacheFile`, `webView`, `webViewGetSource`, `webViewGetOverrideUrl`, `getCookie`, `getCookieValue`, `removeCookie`, `getWebViewUA`, `put`, `get`, `getString`, `getStringList`, `setContent`, `getElements`, `getElementValue`, `newAnalyzeRule`, `digestBytes`, `sleepMillis`, `makeStrResponse`, `getUserAgent`, `getVerificationCode`, `startBrowser`, `startBrowserAwait`, and 65 more. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: LegadoStrResponseExport (21 requirements) Modules/Core/RuleEngine/ModernParser/JS/LegadoJSBridge.swift:3591— `LegadoStrResponseExport` declares 21 requirements: `raw`, `callTime`, `request`, `header`, `hasHeader`, `cookie`, `contentType`, `isRedirect`, `priorResponse`, `body`, `bodyBytes`, `cookies`, `jsHeaders`, `code`, `message`, `statusCode`, `statusMessage`, `url`, `urlString`, `isSuccessful`, `toString`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: LegadoJsoupElementExport (40 requirements) Modules/Core/RuleEngine/ModernParser/JS/LegadoJsoupBridge.swift:17— `LegadoJsoupElementExport` declares 40 requirements: `isJsoupNode`, `select`, `children`, `parent`, `body`, `html`, `outerHtml`, `text`, `ownText`, `wholeText`, `data`, `attr`, `absUrl`, `hasAttr`, `attributeList`, `tagName`, `id`, `className`, `title`, `matches`, `nextElementSibling`, `previousElementSibling`, `firstElementSibling`, `lastElementSibling`, `siblingElements`, `elementSiblingIndex`, `parents`, `closest`, `isSameNode`, `cloneElement`, `remove`, `setAttr`, `removeAttr`, `setText`, `setHtml`, `appendHtml`, `prependHtml`, `beforeHtml`, `afterHtml`, `empty`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: LegadoSourceBridgeExport (22 requirements) Modules/Core/RuleEngine/ModernParser/JS/LegadoSourceBridge.swift:16— `LegadoSourceBridgeExport` declares 22 requirements: `getVariable`, `setVariable`, `putVariable`, `jsGetLoginInfo`, `putLoginInfo`, `getLoginInfoMap`, `removeLoginInfo`, `putLoginHeader`, `jsGetLoginHeader`, `getLoginHeaderMap`, `removeLoginHeader`, `getHeaderMap`, `login`, `put`, `get`, `evalJS`, `getKey`, `getTag`, `getSource`, `refreshExplore`, `refreshJSLib`, `putConcurrent`. Counted over its method requirements (members with no body), once per name; a default supplied by a protocol extension is not counted, because no conformer is forced to write it. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
redundant comment Resources/Assets/Readability.js:2531— "For embed with <object> tag, check inner HTML as well." repeats the code it sits on: 6 of its 7 words (embed, object, tag, check, inner, html) are already in `if (`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment Resources/Assets/Readability.js:2738— "Unwrap image from noscript" repeats the code it sits on: 3 of its 3 words (unwrap, image, noscript) are already in `this._unwrapNoscriptImages(this._doc);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
No ADRs found Yuedu-Reader.xcodeproj/project.pbxproj:1— 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/`. ADRs are expected here because `Yuedu-Reader.xcodeproj/project.pbxproj` makes this repository a deployable product (line 1).
D21 · Naming Consistency· `resolvedHREF` spells `HREF` where 89 names in the project spell it `Href` · ×1
`resolvedHREF` spells `HREF` where 89 names in the project spell it `Href` Modules/Core/EPUB/PublicationSession.swift:1122— 89 of 91 names in project repository spell the token `Href` (89 of 91; unit: names in project repository containing `Href`). Peers: AozoraXHTMLWriter.stylesheetHref (Modules/Core/Aozora/AozoraXHTMLWriter.swift:153); UnifiedChapter.sourceHref (Modules/Core/EPUB/BookParsing.swift:10); EPUBMediaOverlayFragment.textHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:5); EPUBMediaOverlayFragment.audioHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:7); EPUBMediaOverlay.chapterHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:18). Rename to `resolvedHref`. [rule N6]
D21 · Naming Consistency· `normalizedHREF` spells `HREF` where 89 names in the project spell it `Href` · ×1
`normalizedHREF` spells `HREF` where 89 names in the project spell it `Href` Modules/Core/EPUB/PublicationSession.swift:1942— 89 of 91 names in project repository spell the token `Href` (89 of 91; unit: names in project repository containing `Href`). Peers: AozoraXHTMLWriter.stylesheetHref (Modules/Core/Aozora/AozoraXHTMLWriter.swift:153); UnifiedChapter.sourceHref (Modules/Core/EPUB/BookParsing.swift:10); EPUBMediaOverlayFragment.textHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:5); EPUBMediaOverlayFragment.audioHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:7); EPUBMediaOverlay.chapterHref (Modules/Core/EPUB/EPUBMediaOverlay.swift:18). Rename to `normalizedHref`. [rule N6]
D21 · Naming Consistency· `replaceEMLengths` spells `EM` where 39 names in the project spell it `Em` · ×1
`replaceEMLengths` spells `EM` where 39 names in the project spell it `Em` Modules/Core/ReaderCore/Customization/ChapterTitleHTMLCodec.swift:506— 39 of 40 names in project repository spell the token `Em` (39 of 40; unit: names in project repository containing `Em`). Peers: BrowserChapterAdditions.bubbleWidthEm (Modules/Core/ReaderCore/BrowserLayout/BrowserChapterAdditions.swift:121); ReaderDialogueBubbleRenderer.tailLipEm (Modules/Core/ReaderCore/CoreText/ReaderDialogueBubbleRenderer.swift:15); ReaderDialogueBubbleDecoration.sizeEm (Modules/Core/ReaderCore/Customization/ReaderDialogueBubbleDecoration.swift:92); ReaderDialogueBubbleDecoration.offsetXEm (Modules/Core/ReaderCore/Customization/ReaderDialogueBubbleDecoration.swift:93); ReaderDialogueBubbleDecoration.offsetYEm (Modules/Core/ReaderCore/Customization/ReaderDialogueBubbleDecoration.swift:94). Rename to `replaceEmLengths`. [rule N6]
D21 · Naming Consistency· `currentEpubPage` spells `Epub` where 22 names in the project spell it `EPUB` · ×1
`currentEpubPage` spells `Epub` where 22 names in the project spell it `EPUB` Modules/Core/ReaderCore/EPUBPageRenderer.swift:491— 22 of 24 names in project repository spell the token `EPUB` (22 of 24; unit: names in project repository containing `EPUB`). Peers: repository.AozoraEPUBManifest (Modules/Core/Aozora/AozoraEPUBWriter.swift:6); repository.AozoraEPUBWriter (Modules/Core/Aozora/AozoraEPUBWriter.swift:37); repository.FixedLayoutEPUBPageProviderError (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:15); repository.FixedLayoutEPUBPageProvider (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:32); repository.FixedLayoutEPUBRenderer (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:46). Rename to `currentEPUBPage`. [rule N6]
D21 · Naming Consistency· `isJsonArrayOrObject` spells `Json` where 95 names in the project spell it `JSON` · ×1
`isJsonArrayOrObject` spells `Json` where 95 names in the project spell it `JSON` Modules/Core/RuleEngine/ModernParser/ModernParserBridge.swift:2655— 95 of 96 names in project repository spell the token `JSON` (95 of 96; unit: names in project repository containing `JSON`). Peers: OnlineBookContentInference.kind(fromJSONObject) (Modules/Core/BookSource/BookSource.swift:639); BookSource.importEditableJSON (Modules/Core/BookSource/BookSourceImportOptions.swift:126); BookSource.importParse(editedJSON) (Modules/Core/BookSource/BookSourceImportOptions.swift:136); BookSourceStore.importFromJSON (Modules/Core/BookSource/BookSourceStore.swift:735); BookSourceStore.exportToJSON (Modules/Core/BookSource/BookSourceStore.swift:1086). Rename to `isJSONArrayOrObject`. [rule N6]
D21 · Naming Consistency· `importEpub` spells `Epub` where 22 names in the project spell it `EPUB` · ×1
`importEpub` spells `Epub` where 22 names in the project spell it `EPUB` Modules/Services/LibraryStore/BookStore.swift:766— 22 of 24 names in project repository spell the token `EPUB` (22 of 24; unit: names in project repository containing `EPUB`). Peers: repository.AozoraEPUBManifest (Modules/Core/Aozora/AozoraEPUBWriter.swift:6); repository.AozoraEPUBWriter (Modules/Core/Aozora/AozoraEPUBWriter.swift:37); repository.FixedLayoutEPUBPageProviderError (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:15); repository.FixedLayoutEPUBPageProvider (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:32); repository.FixedLayoutEPUBRenderer (Modules/Core/EPUB/FixedLayoutEPUBPageProvider.swift:46). Rename to `importEPUB`. [rule N6]
D21 · Naming Consistency· `containsNormalizedTextASCII` spells `ASCII` where 33 names in the project spell it `Ascii` · ×1
`containsNormalizedTextASCII` spells `ASCII` where 33 names in the project spell it `Ascii` Packages/SwiftSoup/Sources/Element.swift:2286— 33 of 35 names in project Packages~SwiftSoup spell the token `Ascii` (33 of 35; unit: names in project Packages~SwiftSoup containing `Ascii`). Peers: Attributes.containsAsciiUppercase (Packages/SwiftSoup/Sources/Attributes.swift:1307); Attributes.containsAsciiUppercase (Packages/SwiftSoup/Sources/Attributes.swift:1318); CharacterReader.consumeAsciiScalar (Packages/SwiftSoup/Sources/CharacterReader.swift:211); CharacterReader.advanceAscii (Packages/SwiftSoup/Sources/CharacterReader.swift:275); CharacterReader.containsAsciiTransformed (Packages/SwiftSoup/Sources/CharacterReader.swift:860). Rename to `containsNormalizedTextAscii`. [rule N6]
D21 · Naming Consistency· `containsOwnTextASCII` spells `ASCII` where 33 names in the project spell it `Ascii` · ×1
`containsOwnTextASCII` spells `ASCII` where 33 names in the project spell it `Ascii` Packages/SwiftSoup/Sources/Element.swift:2331— 33 of 35 names in project Packages~SwiftSoup spell the token `Ascii` (33 of 35; unit: names in project Packages~SwiftSoup containing `Ascii`). Peers: Attributes.containsAsciiUppercase (Packages/SwiftSoup/Sources/Attributes.swift:1307); Attributes.containsAsciiUppercase (Packages/SwiftSoup/Sources/Attributes.swift:1318); CharacterReader.consumeAsciiScalar (Packages/SwiftSoup/Sources/CharacterReader.swift:211); CharacterReader.advanceAscii (Packages/SwiftSoup/Sources/CharacterReader.swift:275); CharacterReader.containsAsciiTransformed (Packages/SwiftSoup/Sources/CharacterReader.swift:860). Rename to `containsOwnTextAscii`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion Yuedu-Reader.xcodeproj/project.pbxproj:1— `(repository root)` (341946 LoC, 3940 module-visible types across 95 directories) overshoots its size bounds. 1 of 7 build unit(s) (SwiftPM, Xcode, npm) overshoot their size bounds, lowering Project Cohesion to 7.1/10. 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
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.
Logging is not universal — Only 3/4 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `gateway`.
No SAST REDACTED:5— 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 2 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.
No dependency-update automation functions/package.json:12— `functions/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code· Unused export 'assertServiceAccountPathReadable' · ×1
Unused export 'assertServiceAccountPathReadable' gateway/src/config.ts:106— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'USER_SUBCOLLECTIONS' · ×1
Unused export 'USER_SUBCOLLECTIONS' gateway/src/deletion.ts:9— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PROFILE_FORBIDDEN_KEYS' · ×1
Unused export 'PROFILE_FORBIDDEN_KEYS' gateway/src/policy.ts:92— Nothing imports this binding — it is safe to review for removal.
Security headers incomplete scripts/trends/deploy/Caddyfile:12— Set: Referrer-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options. Missing: Content-Security-Policy — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−0.5 on this card.)
Null assertions (`!`) override strict null checking — ~0.2 `!` null assertions per 1k TypeScript source lines — 1 assertion(s) across the 6404 source line(s) of the 43 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: functions/src/index.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Subsumed condition operand Modules/Services/RSS/LegadoRSSScraper.swift:315— `trimmed.hasPrefix("//")` can never decide this `||` — every value satisfying `trimmed.hasPrefix("//")` also satisfies `trimmed.hasPrefix("/")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Skipped (documented): allSources Tests/iOS/yuedu appTests/AllBookSourcesLiveRegressionTests.swift:41— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): corpus Tests/iOS/yuedu appTests/AozoraMarkupParserEquivalenceTests.swift:49— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): benchmarkLeavingForegroundWithTesterSizedShelf Tests/iOS/yuedu appTests/BookChapterStorageTests.swift:218— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): auditRealSourcePack Tests/iOS/yuedu appTests/BookSourceCompatibilityAuditTests.swift:59— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): dumpSources Tests/iOS/yuedu appTests/BookSourceDiagnosticDumpTests.swift:42— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): realCorpusThroughput Tests/iOS/yuedu appTests/BookSourceHealthCheckerPerformanceTests.swift:69— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): openManagementList Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:37— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): managementInteractions Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:83— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): bulkStoreWrites Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:128— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): saveAndLoad Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:152— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): validateLargeLibrary Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:187— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): validatePassingLibrary Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:216— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): openLibraryAtLaunch Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:249— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): readLibrary Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:268— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): buildShelfCovers Tests/iOS/yuedu appTests/BookSourceManagementScaleTests.swift:317— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): productionHongwuScannerAudit Tests/iOS/yuedu appTests/BrowserAutoSupportedSubsetCorrectnessGateTests.swift:79— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): decodedUnicodeArchiveEntryCanBeReadForCensus Tests/iOS/yuedu appTests/BrowserLayoutCapabilityCensusTests.swift:1121— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): generateCapabilityCensus Tests/iOS/yuedu appTests/BrowserLayoutCapabilityCensusTests.swift:1143— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): dumpNestedBoxGeometry Tests/iOS/yuedu appTests/BrowserLayoutDebugDumpTests.swift:8— Skipped with a documented reason — a deferral, not lazy debt: debug dump: writes /tmp artifacts for a human to read and asserts nothing. Enable manually when you need the dump; it must not run in the suite, where a bad fixture aborts the whole test process.
Skipped (documented): isolatedLayoutIsStable Tests/iOS/yuedu appTests/BrowserLayoutDeterminismTests.swift:42— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): loopResultMatchesIsolated Tests/iOS/yuedu appTests/BrowserLayoutDeterminismTests.swift:57— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): prefixLengthChangesResult Tests/iOS/yuedu appTests/BrowserLayoutDeterminismTests.swift:75— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): allSuspectsStableAlone Tests/iOS/yuedu appTests/BrowserLayoutDeterminismTests.swift:91— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): originalGalleryPaintsSixPurpleBadgesInPagedAndContinuousFlow Tests/iOS/yuedu appTests/BrowserLayoutInlineDecorationTests.swift:100— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Skipped (documented): corpusGeometryMatchesImmutablePRE Tests/iOS/yuedu appTests/BrowserLayoutInlineFormattingContextCorpusTests.swift:188— Skipped with a documented reason — a deferral, not lazy debt: conditionally enabled — runs only when its .enabled(if:) condition holds
Outdated: abseil-cpp-binary — `abseil-cpp-binary` is resolved at 1.2024072200.0, but 1.2025051202.0 is the newest release tagged on https://github.com/google/abseil-cpp-binary.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 abseil-cpp-binary` reaches this one with no change to Package.swift.
Outdated: app-check — `app-check` is resolved at 11.2.0, but 11.3.2 is the newest release tagged on https://github.com/google/app-check.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 app-check` reaches this one with no change to Package.swift.
Outdated: cryptoswift — `cryptoswift` is resolved at 1.9.0, but 1.10.0 is the newest release tagged on https://github.com/krzyzanowskim/CryptoSwift.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 cryptoswift` reaches this one with no change to Package.swift.
Outdated: firebase-ios-sdk — `firebase-ios-sdk` is resolved at 12.14.0, but 12.19.3 is the newest release tagged on https://github.com/firebase/firebase-ios-sdk within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update firebase-ios-sdk` reaches this one with no change to Package.swift.
Outdated: fuzi — `fuzi` is resolved at 4.0.0, but 4.0.1 is the newest release tagged on https://github.com/readium/Fuzi.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 fuzi` reaches this one with no change to Package.swift.
Outdated: google-ads-on-device-conversion-ios-sdk — `google-ads-on-device-conversion-ios-sdk` is resolved at 3.6.0, but 3.8.0 is the newest release tagged on https://github.com/googleads/google-ads-on-device-conversion-ios-sdk within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update google-ads-on-device-conversion-ios-sdk` reaches this one with no change to Package.swift.
Outdated: googleappmeasurement — `googleappmeasurement` is resolved at 12.14.0, but 12.19.2 is the newest release tagged on https://github.com/google/GoogleAppMeasurement.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 googleappmeasurement` reaches this one with no change to Package.swift.
Outdated: googledatatransport — `googledatatransport` is resolved at 10.1.0, but 10.1.1 is the newest release tagged on https://github.com/google/GoogleDataTransport.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 googledatatransport` reaches this one with no change to Package.swift.
Outdated: googlesignin-ios — `googlesignin-ios` is resolved at 10.0.0, but 10.1.0 is the newest release tagged on https://github.com/google/GoogleSignIn-iOS within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update googlesignin-ios` reaches this one with no change to Package.swift.
Outdated: googleutilities — `googleutilities` is resolved at 8.1.0, but 8.1.5 is the newest release tagged on https://github.com/google/GoogleUtilities.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 googleutilities` reaches this one with no change to Package.swift.
Outdated: grpc-binary — `grpc-binary` is resolved at 1.69.1, but 1.83.1 is the newest release tagged on https://github.com/google/grpc-binary.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 grpc-binary` reaches this one with no change to Package.swift.
Outdated: iosmath — `iosmath` is resolved at 2.3.1, but 2.5.0 is the newest release tagged on https://github.com/kostub/iosMath.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 iosmath` reaches this one with no change to Package.swift.
Outdated: nanopb — `nanopb` is resolved at 2.30910.0, but 2.30910.1 is the newest release tagged on https://github.com/firebase/nanopb.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 nanopb` reaches this one with no change to Package.swift.
Outdated: promises — `promises` is resolved at 2.4.0, but 2.4.1 is the newest release tagged on https://github.com/google/promises.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 promises` reaches this one with no change to Package.swift.
Outdated: sqlite.swift — `sqlite.swift` is resolved at 0.16.0, but 0.17.0 is the newest release tagged on https://github.com/stephencelis/SQLite.swift.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 sqlite.swift` reaches this one with no change to Package.swift.
Outdated: swift-toolkit — `swift-toolkit` is resolved at 3.8.0, but 3.11.1 is the newest release tagged on https://github.com/readium/swift-toolkit.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 swift-toolkit` reaches this one with no change to Package.swift.
Outdated: zipfoundation — `zipfoundation` is resolved at 3.0.1, but 3.0.2 is the newest release tagged on https://github.com/readium/ZIPFoundation.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 zipfoundation` reaches this one with no change to Package.swift.
doc comments repeat the names Resources/Assets/Readability.js:25— 6 of 48 documented parameters and 1 of 44 summaries in `.` only repeat the member or parameter name (e.g. "The options object." for `options`). 18 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
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.
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 390 file(s) — `Modules/Core/AI/AIAgenticAssistant+Question.swift`, `Modules/Core/AI/AIAnswerMarkdown.swift`, `Modules/Core/AI/AIDialogueAttribution.swift`, `Modules/Core/AI/AIReadingEvidence.swift`, `Modules/Core/Aozora/AozoraChapterPlanner.swift`, … (+385 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
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.
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.
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.
Run 01a1eaab-87b1-7875-bb94-70e62e04fc8c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 67 · Warnings: 2681 · Recommendations: 135 · Info: 146 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 18:01 UTC.
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.