Public report of agalwood/Motrix, published 13 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.3). 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, 13 November 2026, 16:33 UTC · Survey ID cd_7fbab72a5ede49669ace4164c72c530b
agalwood/Motrix
Measured 13 November 2026, 16:30 UTC, at code version 7830f80
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 2 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 263,819 lines of product code in 5 projects, tests not counted · Estimated rebuild effort: about 3.6 person-years · Weakest lens: Production Readiness, 38
Findings by how serious they are
39 critical1621 serious313 minor
5 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
13 November 2026, 16:30 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.
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 ▸
88of 88 dimensions measured by tools.
1955of 1973 findings point to an exact file and line, so you can open each one in the code. The other 18 concern the repository as a whole, such as missing documentation.
88dimensions across 7 lenses, read from 263,819 lines of product code in 5 projects.
agalwood/Motrix falls short of our standard for production because two passwords or keys sit in the current code and it has uses of packages that aren't listed. It scores 49 out of 100 and is rated Weak, and 28 of its 39 critical findings are security problems.
Production Readiness, at 38, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 10 points. Making the four tests that check nothing check their results comes next, worth about 8 points. Raising Production Readiness to 70 would lift the score to about 58.
Nine passwords or keys in the code's history and two in the code are open to anyone who can read the repository. Six secrets can leak from the build pipeline, and four weaknesses in the code could be used by an attacker. Replacing each exposed password or key, limiting each secret to its own step and fixing the weaknesses the scanner points to would close these risks. Hashing passwords with a password-hashing function such as Argon2, bcrypt or PBKDF2 would fix the three places where passwords are scrambled with a fast general-purpose hash, and setting a waiting period for automatic updates would deal with the two automatic dependency updates that take new releases at once. The five uses of packages that aren't listed need adding to the project's list of dependencies.
The product code is 263,819 lines, about €520,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 38 to 70, the lowest score rated Strong, the score would rise from 49 to about 58.
Code composition: what the lines of code are
Product code 47%Tests 53%
New since the last survey: 329 findings
These 329 critical or serious findings weren't in the previous survey, on 24 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 924 findings
These 924 critical or serious findings were in the previous survey, on 24 October 2026, and are gone from this one. The first 100 are listed here.
€170,000 to €870,000, for 2,892 to 9,175 hours of work, about 3.6 person-years for 2 to 7 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 49. 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: 263,819 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 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED.
Raises the score by about 10 points · Low effort · REDACTED Scanning
2
Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with community-plugin-install.test.ts, native-messaging-installer.test.ts, app-deep-links.spec.ts.
Raises the score by about 8 points · Low effort · Test Quality
3
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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 €520,000 to build again, about 3.6 person-years of work. Its weakest lens is Production Readiness, at 38 (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.
If you do one thing first · First action
Resolve the 2 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 10 points for low effort, because it clears the 2 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.1 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 469,732 lines over the last 90 days, which is about 1,905,024 lines a year. At that pace, the extra work comes to an estimated 232.1 to 1392.7 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.
914 modules, with 1503 dependencies between them. 2 loops run through 4 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 874 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.
src.core.bridge.web-socket-bridge-server uses src.shared.protocol.bridge, so a change to src.shared.protocol.bridge can break src.core.bridge.web-socket-bridge-server, while a change to src.core.bridge.web-socket-bridge-server can't break src.shared.protocol.bridge.
Position
Below the diagonal: src.core.bridge.web-socket-bridge-server uses a module listed above it, which is the healthy direction.
src.core.plugin.plugin-registry uses src.shared.types.plugin, so a change to src.shared.types.plugin can break src.core.plugin.plugin-registry, while a change to src.core.plugin.plugin-registry can't break src.shared.types.plugin.
Position
Below the diagonal: src.core.plugin.plugin-registry uses a module listed above it, which is the healthy direction.
src.core.settings.settings-manager uses src.shared.types.settings, so a change to src.shared.types.settings can break src.core.settings.settings-manager, while a change to src.core.settings.settings-manager can't break src.shared.types.settings.
Position
Below the diagonal: src.core.settings.settings-manager uses a module listed above it, which is the healthy direction.
src.core.task.task-manager uses src.shared.types.task, so a change to src.shared.types.task can break src.core.task.task-manager, while a change to src.core.task.task-manager can't break src.shared.types.task.
Position
Below the diagonal: src.core.task.task-manager uses a module listed above it, which is the healthy direction.
src.renderer.hooks uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.renderer.hooks, while a change to src.renderer.hooks can't break src.shared.types.task-activity.
Position
Below the diagonal: src.renderer.hooks uses a module listed above it, which is the healthy direction.
src.renderer.lib uses src.shared.types.plugin, so a change to src.shared.types.plugin can break src.renderer.lib, while a change to src.renderer.lib can't break src.shared.types.plugin.
Position
Below the diagonal: src.renderer.lib uses a module listed above it, which is the healthy direction.
src.renderer.lib uses src.shared.types.task, so a change to src.shared.types.task can break src.renderer.lib, while a change to src.renderer.lib can't break src.shared.types.task.
Position
Below the diagonal: src.renderer.lib uses a module listed above it, which is the healthy direction.
src.renderer.routes.dashboard.layout.dashboard-registry uses src.shared.types.settings, so a change to src.shared.types.settings can break src.renderer.routes.dashboard.layout.dashboard-registry, while a change to src.renderer.routes.dashboard.layout.dashboard-registry can't break src.shared.types.settings.
Position
Below the diagonal: src.renderer.routes.dashboard.layout.dashboard-registry uses a module listed above it, which is the healthy direction.
src.renderer.routes.downloads.inspector uses src.shared.types.task, so a change to src.shared.types.task can break src.renderer.routes.downloads.inspector, while a change to src.renderer.routes.downloads.inspector can't break src.shared.types.task.
Position
Below the diagonal: src.renderer.routes.downloads.inspector uses a module listed above it, which is the healthy direction.
src.shared.types.task-occurrence uses src.shared.types.task, so a change to src.shared.types.task can break src.shared.types.task-occurrence, while a change to src.shared.types.task-occurrence can't break src.shared.types.task.
Position
Below the diagonal: src.shared.types.task-occurrence uses a module listed above it, which is the healthy direction.
src.core.bridge uses src.shared.errors, so a change to src.shared.errors can break src.core.bridge, while a change to src.core.bridge can't break src.shared.errors.
Position
Below the diagonal: src.core.bridge uses a module listed above it, which is the healthy direction.
src.core.bridge uses src.shared.protocol.bridge, so a change to src.shared.protocol.bridge can break src.core.bridge, while a change to src.core.bridge can't break src.shared.protocol.bridge.
Position
Below the diagonal: src.core.bridge uses a module listed above it, which is the healthy direction.
src.core.bridge uses src.core.bridge.web-socket-bridge-server, so a change to src.core.bridge.web-socket-bridge-server can break src.core.bridge, while a change to src.core.bridge can't break src.core.bridge.web-socket-bridge-server.
Position
Below the diagonal: src.core.bridge uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.core.engine.aria2.aria2-rpc-client, so a change to src.core.engine.aria2.aria2-rpc-client can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.core.engine.aria2.aria2-rpc-client.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.main.bridge.native-messaging-installer, so a change to src.main.bridge.native-messaging-installer can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.main.bridge.native-messaging-installer.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.shared.errors, so a change to src.shared.errors can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.shared.errors.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.shared.types.settings, so a change to src.shared.types.settings can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.shared.types.settings.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.shared.types.task, so a change to src.shared.types.task can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.shared.types.task.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.aria2 uses src.shared.types.task-occurrence, so a change to src.shared.types.task-occurrence can break src.core.engine.aria2, while a change to src.core.engine.aria2 can't break src.shared.types.task-occurrence.
Position
Below the diagonal: src.core.engine.aria2 uses a module listed above it, which is the healthy direction.
src.core.engine.engine-supervisor uses src.core.engine.aria2.aria2-rpc-client, so a change to src.core.engine.aria2.aria2-rpc-client can break src.core.engine.engine-supervisor, while a change to src.core.engine.engine-supervisor can't break src.core.engine.aria2.aria2-rpc-client.
Position
Below the diagonal: src.core.engine.engine-supervisor uses a module listed above it, which is the healthy direction.
src.core.engine.engine-supervisor uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.core.engine.engine-supervisor, while a change to src.core.engine.engine-supervisor can't break src.core.events.event-bus.
Position
Below the diagonal: src.core.engine.engine-supervisor uses a module listed above it, which is the healthy direction.
src.core.engine.engine-supervisor uses src.shared.types.settings, so a change to src.shared.types.settings can break src.core.engine.engine-supervisor, while a change to src.core.engine.engine-supervisor can't break src.shared.types.settings.
Position
Below the diagonal: src.core.engine.engine-supervisor uses a module listed above it, which is the healthy direction.
src.core.engine.engine-supervisor uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.core.engine.engine-supervisor, while a change to src.core.engine.engine-supervisor can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.core.engine.engine-supervisor uses a module listed above it, which is the healthy direction.
src.core.plugin.host.plugin-host uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.core.plugin.host.plugin-host, while a change to src.core.plugin.host.plugin-host can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.core.plugin.host.plugin-host uses a module listed above it, which is the healthy direction.
src.core.plugin.host.plugin-host uses src.shared.errors, so a change to src.shared.errors can break src.core.plugin.host.plugin-host, while a change to src.core.plugin.host.plugin-host can't break src.shared.errors.
Position
Below the diagonal: src.core.plugin.host.plugin-host uses a module listed above it, which is the healthy direction.
src.core.plugin.host.plugin-host uses src.shared.types.plugin, so a change to src.shared.types.plugin can break src.core.plugin.host.plugin-host, while a change to src.core.plugin.host.plugin-host can't break src.shared.types.plugin.
Position
Below the diagonal: src.core.plugin.host.plugin-host uses a module listed above it, which is the healthy direction.
src.core.plugin.host.plugin-host uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.core.plugin.host.plugin-host, while a change to src.core.plugin.host.plugin-host can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.core.plugin.host.plugin-host uses a module listed above it, which is the healthy direction.
src.core.plugin.install.plugin-installer uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.core.plugin.install.plugin-installer, while a change to src.core.plugin.install.plugin-installer can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.core.plugin.install.plugin-installer uses a module listed above it, which is the healthy direction.
src.core.plugin.install.plugin-installer uses src.shared.types.plugin, so a change to src.shared.types.plugin can break src.core.plugin.install.plugin-installer, while a change to src.core.plugin.install.plugin-installer can't break src.shared.types.plugin.
Position
Below the diagonal: src.core.plugin.install.plugin-installer uses a module listed above it, which is the healthy direction.
src.core.plugin.install.plugin-installer uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.core.plugin.install.plugin-installer, while a change to src.core.plugin.install.plugin-installer can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.core.plugin.install.plugin-installer uses a module listed above it, which is the healthy direction.
src.core.session.motrix-database uses src.shared.types.task, so a change to src.shared.types.task can break src.core.session.motrix-database, while a change to src.core.session.motrix-database can't break src.shared.types.task.
Position
Below the diagonal: src.core.session.motrix-database uses a module listed above it, which is the healthy direction.
src.core.session.motrix-database uses src.shared.types.task-occurrence, so a change to src.shared.types.task-occurrence can break src.core.session.motrix-database, while a change to src.core.session.motrix-database can't break src.shared.types.task-occurrence.
Position
Below the diagonal: src.core.session.motrix-database uses a module listed above it, which is the healthy direction.
src.core.task.actions uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.core.task.actions, while a change to src.core.task.actions can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.core.task.actions uses a module listed above it, which is the healthy direction.
src.core.task.actions uses src.shared.types.task, so a change to src.shared.types.task can break src.core.task.actions, while a change to src.core.task.actions can't break src.shared.types.task.
Position
Below the diagonal: src.core.task.actions uses a module listed above it, which is the healthy direction.
src.core.task.actions uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.core.task.actions, while a change to src.core.task.actions can't break src.shared.types.task-activity.
Position
Below the diagonal: src.core.task.actions uses a module listed above it, which is the healthy direction.
src.core.task.actions uses src.shared.types.task-occurrence, so a change to src.shared.types.task-occurrence can break src.core.task.actions, while a change to src.core.task.actions can't break src.shared.types.task-occurrence.
Position
Below the diagonal: src.core.task.actions uses a module listed above it, which is the healthy direction.
src.core.tracker.tracker-manager uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.core.tracker.tracker-manager, while a change to src.core.tracker.tracker-manager can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.core.tracker.tracker-manager uses a module listed above it, which is the healthy direction.
src.core.tracker.tracker-manager uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.core.tracker.tracker-manager, while a change to src.core.tracker.tracker-manager can't break src.core.events.event-bus.
Position
Below the diagonal: src.core.tracker.tracker-manager uses a module listed above it, which is the healthy direction.
src.core.tracker.tracker-manager uses src.shared.types.settings, so a change to src.shared.types.settings can break src.core.tracker.tracker-manager, while a change to src.core.tracker.tracker-manager can't break src.shared.types.settings.
Position
Below the diagonal: src.core.tracker.tracker-manager uses a module listed above it, which is the healthy direction.
src.core.tracker.tracker-manager uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.core.tracker.tracker-manager, while a change to src.core.tracker.tracker-manager can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.core.tracker.tracker-manager uses a module listed above it, which is the healthy direction.
src.core.tracker.tracker-manager uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.core.tracker.tracker-manager, while a change to src.core.tracker.tracker-manager can't break src.core.task.task-manager.
Position
Below the diagonal: src.core.tracker.tracker-manager uses a module listed above it, which is the healthy direction.
src.main.platform uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.main.platform, while a change to src.main.platform can't break src.core.events.event-bus.
Position
Below the diagonal: src.main.platform uses a module listed above it, which is the healthy direction.
src.main.platform uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.main.platform, while a change to src.main.platform can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.main.platform uses a module listed above it, which is the healthy direction.
src.core.plugin.hooks.hook-orchestrator uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.core.plugin.hooks.hook-orchestrator, while a change to src.core.plugin.hooks.hook-orchestrator can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.core.plugin.hooks.hook-orchestrator uses a module listed above it, which is the healthy direction.
src.core.plugin.hooks.hook-orchestrator uses src.core.plugin.host.plugin-host, so a change to src.core.plugin.host.plugin-host can break src.core.plugin.hooks.hook-orchestrator, while a change to src.core.plugin.hooks.hook-orchestrator can't break src.core.plugin.host.plugin-host.
Position
Below the diagonal: src.core.plugin.hooks.hook-orchestrator uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.core.engine.aria2.aria2-rpc-client, so a change to src.core.engine.aria2.aria2-rpc-client can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.core.engine.aria2.aria2-rpc-client.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.shared.types.task, so a change to src.shared.types.task can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.shared.types.task.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.core.task.task-manager.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.shared.types.task-occurrence, so a change to src.shared.types.task-occurrence can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.shared.types.task-occurrence.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.session.session-manager uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.core.session.session-manager, while a change to src.core.session.session-manager can't break src.core.session.motrix-database.
Position
Below the diagonal: src.core.session.session-manager uses a module listed above it, which is the healthy direction.
src.core.task uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.core.task, while a change to src.core.task can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
src.core.task uses src.shared.errors, so a change to src.shared.errors can break src.core.task, while a change to src.core.task can't break src.shared.errors.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in src.core.task uses a type in src.shared.types.task. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
src.core.task uses src.shared.types.task, so a change to src.shared.types.task can break src.core.task, while a change to src.core.task can't break src.shared.types.task.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
src.core.task uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.core.task, while a change to src.core.task can't break src.shared.types.task-activity.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
src.core.task uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.core.task, while a change to src.core.task can't break src.core.task.task-manager.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
src.core.task uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.core.task, while a change to src.core.task can't break src.core.session.motrix-database.
Position
Below the diagonal: src.core.task uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.core.engine.aria2.aria2-rpc-client, so a change to src.core.engine.aria2.aria2-rpc-client can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.core.engine.aria2.aria2-rpc-client.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.core.events.event-bus.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.shared.errors, so a change to src.shared.errors can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.shared.errors.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.shared.types.task, so a change to src.shared.types.task can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.shared.types.task.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.shared.types.task-activity.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.core.task.task-manager.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.core.torrent.magnet-tracker uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.core.torrent.magnet-tracker, while a change to src.core.torrent.magnet-tracker can't break src.core.session.motrix-database.
Position
Below the diagonal: src.core.torrent.magnet-tracker uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.task.task-manager.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.engine.engine-supervisor, so a change to src.core.engine.engine-supervisor can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.engine.engine-supervisor.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.session.motrix-database.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.main.ipc.queries uses src.core.tracker.tracker-manager, so a change to src.core.tracker.tracker-manager can break src.main.ipc.queries, while a change to src.main.ipc.queries can't break src.core.tracker.tracker-manager.
Position
Below the diagonal: src.main.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.task.task-manager.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.engine.engine-supervisor, so a change to src.core.engine.engine-supervisor can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.engine.engine-supervisor.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.session.motrix-database.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.server.ipc.queries uses src.core.tracker.tracker-manager, so a change to src.core.tracker.tracker-manager can break src.server.ipc.queries, while a change to src.server.ipc.queries can't break src.core.tracker.tracker-manager.
Position
Below the diagonal: src.server.ipc.queries uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.shared.types.task, so a change to src.shared.types.task can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.shared.types.task.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.shared.types.task-occurrence, so a change to src.shared.types.task-occurrence can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.shared.types.task-occurrence.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.plugin.host.plugin-host, so a change to src.core.plugin.host.plugin-host can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.plugin.host.plugin-host.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.plugin.install.plugin-installer, so a change to src.core.plugin.install.plugin-installer can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.plugin.install.plugin-installer.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.plugin.hooks.hook-orchestrator, so a change to src.core.plugin.hooks.hook-orchestrator can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.plugin.hooks.hook-orchestrator.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.core.plugin.runtime.runtime-factory uses src.core.session.session-manager, so a change to src.core.session.session-manager can break src.core.plugin.runtime.runtime-factory, while a change to src.core.plugin.runtime.runtime-factory can't break src.core.session.session-manager.
Position
Below the diagonal: src.core.plugin.runtime.runtime-factory uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.events.event-bus.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.task.task-manager.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.session.motrix-database.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.session.session-manager, so a change to src.core.session.session-manager can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.session.session-manager.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.commands.types uses src.core.torrent.magnet-tracker, so a change to src.core.torrent.magnet-tracker can break src.main.commands.types, while a change to src.main.commands.types can't break src.core.torrent.magnet-tracker.
Position
Below the diagonal: src.main.commands.types uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.events.event-bus.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.main.bridge.native-messaging-installer, so a change to src.main.bridge.native-messaging-installer can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.main.bridge.native-messaging-installer.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.shared.types.task-activity.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.task.task-manager.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.engine.engine-supervisor, so a change to src.core.engine.engine-supervisor can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.engine.engine-supervisor.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.plugin.host.plugin-host, so a change to src.core.plugin.host.plugin-host can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.plugin.host.plugin-host.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.plugin.install.plugin-installer, so a change to src.core.plugin.install.plugin-installer can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.plugin.install.plugin-installer.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.session.motrix-database.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.tracker.tracker-manager, so a change to src.core.tracker.tracker-manager can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.tracker.tracker-manager.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.plugin.hooks.hook-orchestrator, so a change to src.core.plugin.hooks.hook-orchestrator can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.plugin.hooks.hook-orchestrator.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.session.session-manager, so a change to src.core.session.session-manager can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.session.session-manager.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.main.ipc.commands uses src.core.torrent.magnet-tracker, so a change to src.core.torrent.magnet-tracker can break src.main.ipc.commands, while a change to src.main.ipc.commands can't break src.core.torrent.magnet-tracker.
Position
Below the diagonal: src.main.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.engine.aria2.aria2-rpc-client, so a change to src.core.engine.aria2.aria2-rpc-client can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.engine.aria2.aria2-rpc-client.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.engine.engine-adapter, so a change to src.core.engine.engine-adapter can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.engine.engine-adapter.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.events.event-bus, so a change to src.core.events.event-bus can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.events.event-bus.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.plugin.capabilities.interface, so a change to src.core.plugin.capabilities.interface can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.plugin.capabilities.interface.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.shared.types.task-activity, so a change to src.shared.types.task-activity can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.shared.types.task-activity.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.plugin.plugin-registry, so a change to src.core.plugin.plugin-registry can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.plugin.plugin-registry.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.settings.settings-manager, so a change to src.core.settings.settings-manager can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.settings.settings-manager.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.task.task-manager, so a change to src.core.task.task-manager can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.task.task-manager.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.engine.engine-supervisor, so a change to src.core.engine.engine-supervisor can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.engine.engine-supervisor.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.plugin.host.plugin-host, so a change to src.core.plugin.host.plugin-host can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.plugin.host.plugin-host.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.plugin.install.plugin-installer, so a change to src.core.plugin.install.plugin-installer can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.plugin.install.plugin-installer.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.session.motrix-database, so a change to src.core.session.motrix-database can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.session.motrix-database.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.tracker.tracker-manager, so a change to src.core.tracker.tracker-manager can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.tracker.tracker-manager.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.plugin.hooks.hook-orchestrator, so a change to src.core.plugin.hooks.hook-orchestrator can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.plugin.hooks.hook-orchestrator.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.session.session-manager, so a change to src.core.session.session-manager can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.session.session-manager.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
src.server.ipc.commands uses src.core.torrent.magnet-tracker, so a change to src.core.torrent.magnet-tracker can break src.server.ipc.commands, while a change to src.server.ipc.commands can't break src.core.torrent.magnet-tracker.
Position
Below the diagonal: src.server.ipc.commands uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 66% · Adequate · gated by D1, D2 ·
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
55
High / Critical
A07:2025 — Authentication Failures
12
High / Critical
A03:2025 — Software Supply Chain Failures
7
Medium
A02:2025 — Security Misconfiguration
4
High / Critical
Roadmap
Top priorities: Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED; Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with community-plugin-install.test.ts, native-messaging-installer.test.ts, app-deep-links.spec.ts; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED.
Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with community-plugin-install.test.ts, native-messaging-installer.test.ts, app-deep-links.spec.ts.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 6 sites, not one: `src/core/engine/aria2/aria2-session-identity-recovery.ts:303` (createHash("sha1")), `src/core/legacy-import/source-scanner.ts:213` (createHash("sha1")), `src/core/task/bt-file-verifier.ts:235` (createHash("sha1")), `src/core/torrent/create-torrent.ts:116` (createHash("sha1")), `src/core/torrent/create-torrent.ts:122` (createHash("sha1")), `src/core/torrent/create-torrent.ts:187` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
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.
Per-file score 0–10 — a quality signature. Of 440 files carrying findings, judged against the Production bar: 0% slop · 65% mixed · 35% near-clean.
File
Score
Band
Worst signal
REDACTED
0.0
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.6
Slop
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.2
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.0
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
REDACTED Scanning: Leaked secret: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
5.1
Mixed
IaC & Container Security: High IaC: REDACTED
REDACTED
5.3
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.3
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
5.7
Mixed
Static Analysis (SAST): Medium: REDACTED
src/main/index.ts
6.0
Mixed
Explicit Debt: TodoComment
src/core/plugin/host/quick-js-worker.ts
6.0
Mixed
Explicit Debt: TodoComment
src/main/platform/appimage-integration.ts
6.0
Mixed
Explicit Debt: TodoComment
REDACTED
6.1
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
6.2
Mixed
Dependency Vulnerabilities: Medium CVE: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 39
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 — 1621
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 — 313
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 5
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 88 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 — 88 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, 1955 of 1973 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for the repository root failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
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 reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for the repository root failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
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 reliability for the vitest suite in the repository root was NOT MEASURED: the dependency install for the repository root failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 reliability for the node:test suite in packages/native-host/ was NOT MEASURED: the dependency install for packages/native-host/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
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 crate 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 (83 contributor(s) across 1563 commit(s) sampled, automation and bot accounts excluded). One of them holds 91% of the history; the other 82 hold 0.1% 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.
D19 Documentation 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. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D21 Naming 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. 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 on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — 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. `e2e/window-chrome/vite.config.ts`, `scripts/build-fnos-package.mjs`, `scripts/prepare-fnos-project.mjs`, `scripts/prepare-synology-project.mjs`, `scripts/synology-target.mjs`, … (+39 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 src/main/commands/command-registry.ts, 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 (compose.yaml). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — container motrix-server-1 is unhealthy; runtime evidence skipped.
DM9 Scattered domain decisions — 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. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
DM9 Scattered domain decisions — 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. Some of this repository's production types come from a frontend that does not bind comparison operands to the members they read, which arm one needs, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
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 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
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.
R10 Code Duplication — 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. 423 further occurrence(s) are not listed individually; the score already reflects all 463.
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. 642 further occurrence(s) are not listed individually; the score already reflects all 682.
R3 Large Files — 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. 87 further occurrence(s) are not listed individually; the score already reflects all 127.
R7 Dead Code — 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. 46 further occurrence(s) are not listed individually; the score already reflects all 86.
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. 106 further occurrence(s) are not listed individually; the score already reflects all 146.
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. 204 further occurrence(s) are not listed individually; the score already reflects all 244.
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.
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 Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: 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.
364 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was commands.buildCommandHandlers at 184. A further 17 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being translate.translateErrorCode at 29 — they are counted neither in the figure above nor in this dimension's score. 8 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: src/core/engine/aria2/translate.ts (translate.translateErrorCode at 29), src/shared/schemas/ffmpeg-release.ts (ffmpeg-release.ffmpegTargetSchema at 26), packages/finalize-fs/src/protocol.rs (Request::operation at 22), src/core/bridge/pairing-prompt-controller.ts (pairing-prompt-controller.parseVerifiedIdentity at 18), src/server/bridge/remote-extension-host-policy.ts (remote-extension-host-policy.canonicalRequestAuthority at 17), and 3 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.
+ 349 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with commands.buildCommandHandlers (cyclomatic 184), legacy-import-dialog.LegacyImportDialogContent (cyclomatic 152), create-task-handler.handleCreateTaskUnderAdmission (cyclomatic 147). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 2.2 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 120; 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.
+ 385 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 120 down to 120 or less in Cognitive Complexity — start with commands.buildCommandHandlers (cognitive 253), create-task-handler.handleCreateTaskUnderAdmission (cognitive 200), legacy-import-dialog.LegacyImportDialogContent (cognitive 152). — 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 7 together lifts Cognitive Complexity from 2.0 to about 2.6/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 Classes6.3 / 10Adequate✓ 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 149 FunctionTooLong finding(s) in God Classes — start with index.ts (6), finalize-task.ts (3), commands.ts (2). — One of this dimension's main actionable groups (149 warning-level).
Resolve the 68 FileTooLong finding(s) in God Classes — start with index.ts (3), commands.ts (2), web-socket-bridge-server.ts. — One of this dimension's main actionable groups (68 warning-level).
Resolve the 41 MethodTooLong finding(s) in God Classes — start with session-manager.ts (3), aria2-adapter.ts (2), plugin-installer.ts (2). — One of this dimension's main actionable groups (41 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
15 duplicated block group(s) detected. A further 5 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 20 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. Measured on part of this repository only: .ts, .tsx (93% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
Edited copy of a member (32 corresponding lines)packages/native-host/src/flatpak_companion/secure_fs.rs:193
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with copy.rs (2), rename.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with copy.rs (2). — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with secure_fs.rs (2). — One of this dimension's main actionable groups (2 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.
5 production modules (Cargo+npm+SwiftPM), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 4 of the 5 (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.
D10 · Test Quality10.0 / 10Adequategated by 4 critical findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
67 skipped (53 with a documented reason), 14 zero-assertion, 3 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 11190 tests.
No assertions (empty test): installs motrix-example-bilibili-resolver from GH and rewrites a URL · ×4tests/integration/community-plugin-install.test.ts:14
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 No assertions (empty test) finding(s) in Test Quality — start with community-plugin-install.test.ts, native-messaging-installer.test.ts, app-deep-links.spec.ts. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 14 Skipped test finding(s) in Test Quality — start with application-menu.spec.ts (2), appimage-cold-launch.spec.ts (2), download-progress.spec.ts. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 10 No assertions finding(s) in Test Quality — start with aria2-process-manager.test.ts (2), plugin-detail-page.test.tsx, use-modifier-keys.test.ts. — One of this dimension's main actionable groups (10 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.
3 outdated, 0 yanked direct Cargo dependencies. 6 of 11 direct crates were graded against crates.io (0 not published there, 5 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: libc · ×3
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.
Resolve the 2 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate 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: src/main/ipc/commands.ts (53×184=9752); src/server/index.ts (54×175=9450); src/main/index.ts (76×104=7904) Repeated repair below the complexity floor: packages/finalize-fs/src/protocol.rs (8 of 10 changes were fixes); src/core/engine/aria2/aria2-rpc-client.ts (8 of 10 changes were fixes); src/shared/external-urls.ts (7 of 10 changes were fixes)
Resolve the 136 Hotspot finding(s) in Churn × Complexity Hotspots — start with index.ts (3), commands.ts (2), REDACTED (2). — One of this dimension's main actionable groups (136 warning-level).
Resolve the 38 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), direct-replay-recipe.ts (2), protocol.rs. — One of this dimension's main actionable groups (38 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.
8 deducted task-comment markers across 236721 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.
TodoComment · ×8src/main/index.ts:2195
What to do
Resolve the 8 TodoComment finding(s) in Explicit Debt — start with quick-js-worker.ts (4), index.ts (2), appimage-integration.ts. — One of this dimension's main actionable groups (8 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.
1 of 1 documentation facets pass in full. 43 document(s) read across 3 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.
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with package.json. — 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 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.
1 of 4 build units (Cargo, SwiftPM, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
18 % of calls cross a namespace and 6 % go through an interface, but 84 % 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.
9 finding(s): 0 critical, 9 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (8). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 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).
55 finding(s): 0 critical, 12 high, 41 medium, 2 low. semgrep hit a parse error in 66 file(s) — `.github/ISSUE_TEMPLATE/bug-report.zh-CN.yml`, `e2e/window-chrome/vite.config.ts` (line 4), `packages/finalize-fs/src/platform/unix/reserved/ntfs_volume.rs` (line 13, line 19, line 22, …), `packages/finalize-fs/src/platform/windows/nt.rs` (line 500, line 517), `packages/native-host/src/flatpak_companion/secure_fs.rs` (line 44, line 50), … (+61 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 6 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — 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).
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 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Low CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 2 High IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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 761 of the 1476 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.
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.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
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 0 platform declaration(s) and 56 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives5.4 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — src/renderer/components/desktop-kit/cubic-glass/cubic-glass-gradient.tsx:125
What to do
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
Do you agree with this assessment?
AC2 · Forms & labels4.5 / 10Weak✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×6) — src/renderer/components/desktop-kit/panel/panel-shell.tsx:79, src/renderer/components/settings-kit/plugin-config-field.tsx:64, src/renderer/routes/downloads/inspector/trackers-tab.tsx:457, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. — src/renderer/components/operator-unlock-gate.tsx:127
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — src/renderer/components/settings-kit/plugin-config-field.tsx:39, src/renderer/routes/settings/cards/integration/trusted-extensions-section.tsx:243
This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×4) — src/renderer/components/settings-kit/plugin-config-field.tsx:78, src/renderer/components/settings-kit/plugin-config-field.tsx:89, src/renderer/routes/downloads/inspector/lifetime-transfer-card.tsx:600, …
A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×8) — src/renderer/routes/settings/cards/advanced-dialog.tsx:199, src/renderer/routes/settings/cards/appearance-dialog.tsx:249, src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:180, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
<div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — src/renderer/components/desktop-kit/inspector-drawer.tsx:160, src/renderer/routes/downloads/task-list-panel.tsx:173
<input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — src/renderer/components/ui/input.tsx:6
<select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — src/renderer/components/ui/native-select.tsx:15
<textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — src/renderer/components/ui/textarea.tsx:6
`.drawer-slide-in` moves (`animation: drawer-slide-in-from-bottom 300ms cubic-bezier(0.32, 0.72, 0, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — src/renderer/styles/globals.css:543
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
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.
`EngineAdapter` declares 35 required operations: `setTaskBtTracker`, `connect`, `disconnect`, `getCapabilities`, `getFeatureReport`, `createDownload`, `pauseTask`, `resumeTask`, `removeTask`, `forceRemoveTask`, `getEngineTaskOptions`, `pauseAll`, `resumeAll`, `changePosition`, `getTaskStatus`, `getTaskFiles`, `changeOption`, `getTaskPieces`, `getTaskPeers`, `getGlobalStats`, `addTorrent`, `getTaskBtTracker`, `removeDownloadResult`, `removeDownloadResults`, `getUploadLength`, `listActiveAndWaiting`, `listWaitingTaskIds`, `listStopped`, `getHistoryCount`, `searchHistory`, `exportSession`, `requeueFromHistory`, `onBtDownloadComplete`, `onDownloadComplete`, `onDownloadError`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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. — src/core/engine/engine-adapter.ts:202
`CapabilityHost` declares 16 required operations: `createLog`, `getTail`, `clearLog`, `setLogVerbose`, `isLogVerbose`, `getLogState`, `subscribeLog`, `appSnapshot`, `i18nSnapshot`, `setLocale`, `onLocaleChange`, `flush`, `fsTaskFor`, `fsStorageFor`, `configFor`, `cookieJarFor`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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. — src/core/plugin/capabilities/interface.ts:53
`SelectionState` declares 16 required operations: `select`, `toggle`, `rangeSelect`, `selectAll`, `clearSelection`, `setItems`, `marqueeSelect`, `marqueeEnd`, `moveFocus`, `focusedSelect`, `shiftMoveFocus`, `focus`, `extendSelection`, `moveSelection`, `isSelected`, `selectedCount`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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. — src/renderer/components/desktop-kit/selection/types.ts:3
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.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect. — src/core/bridge/web-socket-bridge-server.ts:1019
What to do
Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
src.core.legacy-import.source-scanner.LegacySnapshotFile's [digest, identity] are judged in src.core.legacy-import.bt-activation-service.LegacyBtActivationService, src.core.legacy-import.source-scanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
src.core.legacy-import.source-scanner.LegacySource's [identity, root] are judged in src.core.legacy-import.bt-activation-service.LegacyBtActivationService, src.core.legacy-import.http-activation-service.LegacyHttpActivationService, src.core.legacy-import.import-service.LegacyImportService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
src.core.plugin.finalize.filesystem-adapter.FinalizeFsError's [code, details] are judged in src.core.plugin.finalize.finalize-committer.FinalizeCommitter, src.core.plugin.finalize.finalize-recovery-errors — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
src.core.stats.transfer-stats-store.TransferDelta's [downloadBytes, uploadBytes] are judged in src.core.stats.transfer-stats-service.TransferStatsService, src.core.stats.transfer-stats-store, src.core.stats.transfer-stats-store.TransferStatsStore — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
src.renderer.routes.downloads.inspector.activity-chart-model.ActivityPauseBand's [endAt, startAt] are judged in src.renderer.routes.downloads.inspector.activity-chart-model, src.renderer.routes.downloads.inspector.lifetime-transfer-card — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
What to do
Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`has` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/core/plugin/capabilities/metadata.ts:164
`set` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/core/plugin/capabilities/metadata.ts:215
`handleStaged` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/core/plugin/host/capability-bridge.ts:1778
The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/core/torrent/magnet-tracker.ts:1687
The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/main/bridge/native-messaging-installer.ts:516
The guard above `return 'query';` also returns `'query'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — src/renderer/lib/transport/http-ws.ts:51
`onKeyDown` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. — src/renderer/routes/downloads/task-row.tsx:134
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×16) — e2e/application-menu.spec.ts:161, e2e/application-menu.spec.ts:177, e2e/bridge/appimage-cold-launch.spec.ts:101, …
`unsubscribeLocale` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/core/plugin/host/plugin-host.ts:178
`unsubscribeSecurity` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/core/plugin/host/plugin-host.ts:180
`emit` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/core/plugin/post/delivery-observability.ts:69
`schedule` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/renderer/components/desktop-kit/cubic-glass/renderer.ts:28
`init` has an empty body — confirm it's an intentional no-op and not an unfinished method. — src/shared/i18n-resources.ts:76
What to do
Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
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.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
README.md names Electron 44, but the manifest declares `electron` 45.2.3. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — README.md:270
docs/production-builds.md names Electron 44, but the manifest declares `electron` 45.2.3. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/production-builds.md:116
What to do
Reconcile the README with reality: README.md names Electron 44, but the manifest declares `electron` 45.2.3; docs/production-builds.md names Electron 44, but the manifest declares `electron` 45.2.3.
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: `packages/finalize-fs`.
`src/renderer/routes/dashboard/components/tile-error-boundary.tsx` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/renderer/routes/dashboard/components/tile-error-boundary.tsx:45
`src/renderer/lib/notification-text.ts` reports through `console.*` at line 21 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/renderer/lib/notification-text.ts:21
`src/core/plugin/capabilities/commands.ts` reports through `console.*` at line 138 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — src/core/plugin/capabilities/commands.ts:138
`packages/safari-bootstrap/test-integration.mjs` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/safari-bootstrap/test-integration.mjs:113
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
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.
`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`. — package.json:99
What to do
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 & Backup4.0 / 10Weak✓ 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.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
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.
`fetchImpl(` 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. (×4) — src/core/plugin/install/github-fetcher.ts:90, src/core/plugin/install/github-fetcher.ts:130, src/core/plugin/install/url-fetcher.ts:12, …
`fetcher(` 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. — src/core/session/session-manager.ts:116
`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. (×2) — src/core/tracker/tracker-http-client.ts:22, src/core/tracker/tracker-http-client.ts:50
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.
`spawnSync` in `buildNativeHost` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/native-host/build.mjs:144
`gzipSync` in `packageFlatpakCompanion` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — packages/native-host/package-flatpak-companion.mjs:166
`inflateRawSync` in `inspectEmbeddedBlockmap` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/appimage-artifact.mjs:319
`existsSync` in `readLockFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — scripts/fetch-engine.mjs:291
`execFileSync` in `sign` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — scripts/sign-macos.mjs:89, scripts/sign-macos.mjs:100, scripts/sign-macos.mjs:106
`execFileSync` in `replacePayload` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:421
`existsSync` in `verifyLegacyMacFfmpeg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/ffmpeg/verified-install.ts:950
`existsSync` in `installVerifiedFfmpeg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — src/core/ffmpeg/verified-install.ts:1034, src/core/ffmpeg/verified-install.ts:1126
`readFileSync` in `spawnTestBridge` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — src/core/plugin/host/test-helpers.ts:110, src/core/plugin/host/test-helpers.ts:115
`existsSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/plugin/secret-store-libsodium.ts:84
`readFileSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/plugin/secret-store-libsodium.ts:85
`writeFileSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/plugin/secret-store-libsodium.ts:98
`fs.existsSync` in `reAddOrMarkErrorFromPair` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/session/session-manager.ts:1707
`fs.readFileSync` in `reAddOrMarkErrorFromPair` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — src/core/session/session-manager.ts:1715
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety9.6 / 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 — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.
100 duplicated blocks under src/ have copies in at least two of the sibling directories core, main, preload, renderer, server, shared — 71 of them are reported below, and 29 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 100 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 100 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 100 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/main/ipc/commands.ts:965
33 duplicated blocks under src/renderer/ have copies in at least two of the sibling directories components, features, hooks, routes — 11 of them are reported below, and 22 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/renderer/features/directory-preferences/directory-preferences-dialog.tsx:122
25 duplicated blocks under src/core/ have copies in at least two of the sibling directories activity, bridge, bridge-receiver, engine, ffmpeg, geoip (+8 more sibling(s) not listed) — 8 of them are reported below, and 17 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 25 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 25 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 25 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/core/plugin/runtime/plugin-hook-runtime.ts:370
11 duplicated blocks under src/renderer/routes/ have copies in at least two of the sibling directories dashboard, downloads, plugins, settings, trackers — 5 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 11 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — src/renderer/routes/downloads/inspector/task-tracker-dialog.tsx:69
7 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, packaging, scripts, src — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/finalize-fs/build.mjs:23
scripts/stage-electron-app.mjs:45 · scripts/stage-server-app.mjs:40 — the two spans are one implementation copied and then locally edited — 2738 tokens are still identical, in the same order in both files, 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. — scripts/stage-electron-app.mjs:45
src/main/ipc/commands.ts:965 · src/server/ipc/commands.ts:569 — the two spans are one implementation copied and then locally edited — 1236 tokens are still identical, in the same order in both files, 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. — src/main/ipc/commands.ts:965
src/renderer/routes/settings/cards/advanced-dialog.tsx:140 · src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:103 — the two spans are one implementation copied and then locally edited — 758 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/settings/cards/advanced-dialog.tsx:140
scripts/verify-electron-package.mjs:109 · scripts/verify-server-package.mjs:56 — the two spans are one implementation copied and then locally edited — 996 tokens are still identical, in the same order in both files, 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. — scripts/verify-electron-package.mjs:109
src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:129 · src/renderer/routes/settings/cards/network-dialog.tsx:142 — the two spans are one implementation copied and then locally edited — 680 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:129
src/renderer/routes/settings/cards/appearance-dialog.tsx:420 · src/renderer/routes/settings/cards/network-dialog.tsx:315 — the two spans are one implementation copied and then locally edited — 575 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/settings/cards/appearance-dialog.tsx:420
src/shared/lib/log-redact.ts:455 · src/shared/lib/log-redact.ts:780 — the two spans are one implementation copied and then locally edited — 642 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. — src/shared/lib/log-redact.ts:455
src/renderer/routes/settings/cards/downloads-dialog.tsx:89 · src/renderer/routes/settings/cards/general-dialog.tsx:217 — the two spans are one implementation copied and then locally edited — 531 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/settings/cards/downloads-dialog.tsx:89
scripts/prepare-snap-project.mjs:65 · scripts/verify-snap-artifact.mjs:109 — the two spans are one implementation copied and then locally edited — 670 tokens are still identical, in the same order in both files, 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. — scripts/prepare-snap-project.mjs:65
src/main/plugin/capability-host.ts:1 · src/server/plugin/capability-host.ts:1 — these 2 files are line-for-line copies of one another — 105 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — src/main/plugin/capability-host.ts:1
src/renderer/routes/trackers/components/blacklist-tracker-panel.tsx:18 · src/renderer/routes/trackers/components/effective-tracker-panel.tsx:38 — the two spans are one implementation copied and then locally edited — 604 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/trackers/components/blacklist-tracker-panel.tsx:18
src/core/plugin/capabilities/metadata.ts:66 · src/core/plugin/capabilities/storage.ts:76 — the two spans are one implementation copied and then locally edited — 538 tokens are still identical, in the same order in both files, 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. — src/core/plugin/capabilities/metadata.ts:66
packaging/fnos/app/lifecycle.mjs:64 · packaging/synology/app/lifecycle.mjs:224 — 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. — packaging/fnos/app/lifecycle.mjs:64
scripts/assemble-release-artifacts.mjs:472 · scripts/verify-update-artifacts.mjs:166 — the two spans are one implementation copied and then locally edited — 622 tokens are still identical, in the same order in both files, 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. — scripts/assemble-release-artifacts.mjs:472
src/main/bridge/index.ts:550 · src/server/bridge/bootstrap.ts:276 — the two spans are one implementation copied and then locally edited — 532 tokens are still identical, in the same order in both files, 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. — src/main/bridge/index.ts:550
src/main/ipc/commands.ts:834 · src/server/ipc/commands.ts:724 — 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. — src/main/ipc/commands.ts:834
src/renderer/components/ui/autocomplete.tsx:18 · src/renderer/components/ui/combobox.tsx:44 — the two spans are one implementation copied and then locally edited — 310 tokens are still identical, in the same order in both files, 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. — src/renderer/components/ui/autocomplete.tsx:18
packaging/fnos/app/lifecycle.mjs:185 · packaging/synology/app/lifecycle.mjs:365 — the 2 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. — packaging/fnos/app/lifecycle.mjs:185
src/core/task/actions/finalize-task.ts:344 · src/core/task/actions/finalize-task.ts:624 — the two spans are one implementation copied and then locally edited — 309 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. — src/core/task/actions/finalize-task.ts:344
src/main/index.ts:329 · src/server/index.ts:376 — the two spans are one implementation copied and then locally edited — 400 tokens are still identical, in the same order in both files, 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. — src/main/index.ts:329
src/core/plugin/hooks/hook-orchestrator.ts:225 · src/core/plugin/hooks/hook-orchestrator.ts:391 — the two spans are one implementation copied and then locally edited — 343 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. — src/core/plugin/hooks/hook-orchestrator.ts:225
src/renderer/routes/plugins/hooks/use-plugin-graph.ts:60 · src/renderer/routes/plugins/hooks/use-plugin-metadata.ts:70 — 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. — src/renderer/routes/plugins/hooks/use-plugin-graph.ts:60
src/main/index.ts:2561 · src/server/index.ts:1028 — the 2 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. — src/main/index.ts:2561
src/renderer/routes/settings/cards/advanced-dialog.tsx:166 · src/renderer/routes/settings/cards/appearance-dialog.tsx:216 — 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. — src/renderer/routes/settings/cards/advanced-dialog.tsx:166
src/main/plugin/dev-watcher.ts:23 · src/server/plugin/dev-watcher.ts:15 — the 2 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. — src/main/plugin/dev-watcher.ts:23
src/main/ipc/commands.ts:1973 · src/server/ipc/commands.ts:1195 — the 2 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. — src/main/ipc/commands.ts:1973
src/main/ipc/queries.ts:306 · src/server/ipc/queries.ts:351 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/main/ipc/queries.ts:306
src/renderer/routes/settings/cards/network-dialog.tsx:378 · src/renderer/routes/settings/cards/network-dialog.tsx:439 — 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. — src/renderer/routes/settings/cards/network-dialog.tsx:378
src/main/ipc/commands.ts:1722 · src/server/ipc/commands.ts:1075 — 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. — src/main/ipc/commands.ts:1722
scripts/electron-package-utils.mjs:31 · scripts/server-package-utils.mjs:47 — 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. — scripts/electron-package-utils.mjs:31
src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:832 · src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:867 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:832
src/core/plugin/finalize/finalize-committer.ts:637 · src/core/plugin/finalize/finalize-recovery.ts:839 — 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. — src/core/plugin/finalize/finalize-committer.ts:637
src/renderer/routes/plugins/hooks/use-plugin-detail.ts:19 · src/renderer/routes/plugins/hooks/use-plugins.ts:22 — the two spans are one implementation copied and then locally edited — 175 tokens are still identical, in the same order in both files, 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. — src/renderer/routes/plugins/hooks/use-plugin-detail.ts:19
src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:144 · src/renderer/routes/settings/cards/integration/integration-dialog.tsx:130 · src/renderer/routes/settings/cards/network-dialog.tsx:157 — the 3 copies are spread across 3 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. — src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:144
scripts/prepare-fnos-project.mjs:136 · scripts/prepare-synology-project.mjs:60 — the two spans are one implementation copied and then locally edited — 211 tokens are still identical, in the same order in both files, 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. — scripts/prepare-fnos-project.mjs:136
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 · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
scripts/profile-task-inspector-activity.mts:24 imports src/test-utils/task.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — scripts/profile-task-inspector-activity.mts:24
src/renderer/routes/plugins/lib/call-graph-engine.ts:2 imports elkjs/lib/elk-api.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/renderer/routes/plugins/lib/call-graph-engine.ts:2
src/renderer/routes/plugins/lib/call-graph-engine.ts:3 imports elkjs/lib/elk-worker.min.js?worker, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/renderer/routes/plugins/lib/call-graph-engine.ts:3
What to do
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (2 rows); move the shared test helper into a source directory production code may depend on (1 row).
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.
handleCreateTaskUnderAdmission has cyclomatic complexity 144 and cognitive complexity 227; 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. — src/core/task/create-task-handler.ts:393
keyDown has cyclomatic complexity 95 and cognitive complexity 113; 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. — src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:304
EngineDiagnosticsDialogHost has cyclomatic complexity 95 and cognitive complexity 90; 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. — src/renderer/features/engine-diagnostics/engine-diagnostics-dialog.tsx:140
restore has cyclomatic complexity 77 and cognitive complexity 149; 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. — src/core/session/session-manager.ts:793
verifyFlatpakPackaging has cyclomatic complexity 75 and cognitive complexity 39; 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. — scripts/verify-flatpak-packaging.mjs:118
scanLegacySource has cyclomatic complexity 67 and cognitive complexity 108; 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. — src/core/legacy-import/source-scanner.ts:288
recover has cyclomatic complexity 67 and cognitive complexity 87; 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. — src/core/plugin/finalize/finalize-recovery.ts:81
MediaToolsSection has cyclomatic complexity 65 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 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. — src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76
createDownload has cyclomatic complexity 62 and cognitive complexity 72; 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. — src/core/engine/aria2/aria2-adapter.ts:435
invoke has cyclomatic complexity 61 and cognitive complexity 89; 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. — e2e/web-directory-picker/fixture-transport.ts:160
PickerSession has cyclomatic complexity 60 and cognitive complexity 53; 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. — src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135
main has cyclomatic complexity 59 and cognitive complexity 62; 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. — src/server/index.ts:227
reconcile has cyclomatic complexity 57 and cognitive complexity 71; 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. — src/core/legacy-import/http-activation-service.ts:790
initializeMainProcess has cyclomatic complexity 54 and cognitive complexity 59; 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. — src/main/index.ts:1662
execute has cyclomatic complexity 54 and cognitive complexity 57; 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. — src/core/task/bt-storage-service.ts:154
OperationFormContent has cyclomatic complexity 54 and cognitive complexity 43; 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. — src/renderer/features/plugin-operations/operation-form.tsx:103
smokeServerImage has cyclomatic complexity 53 and cognitive complexity 60; 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:928
run has cyclomatic complexity 52 and cognitive complexity 75; 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. — src/core/task/media-task-coordinator.ts:237
TaskRow has cyclomatic complexity 52 and cognitive complexity 64; 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. — src/renderer/routes/dashboard/tiles/tasks-tile.tsx:158
swapMagnetMetadataForBtUnderMutation has cyclomatic complexity 51 and cognitive complexity 66; 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. — src/core/torrent/swap-magnet-metadata-for-bt.ts:128
onReconnectResponse has cyclomatic complexity 49 and cognitive complexity 54; 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. — src/core/bridge/mbp1/reconnect-session.ts:206
addTorrent has cyclomatic complexity 49 and cognitive complexity 54; 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. — src/core/engine/aria2/aria2-adapter.ts:882
DirectoryPicker has cyclomatic complexity 49 and cognitive complexity 50; 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. — src/renderer/components/desktop-kit/directory-picker.tsx:56
reconcile has cyclomatic complexity 48 and cognitive complexity 52; 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. — src/core/legacy-import/bt-activation-service.ts:491
dispatchCall has cyclomatic complexity 48 and cognitive complexity 44; 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. — src/core/plugin/host/capability-bridge.ts:615
resolveLegacyRequestSettings has cyclomatic complexity 46 and cognitive complexity 76; 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. — src/core/legacy-import/session-parser.ts:96
parseAppDeepLink has cyclomatic complexity 44 and cognitive complexity 48; 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. — src/shared/lib/app-deep-link.ts:28
migrate has cyclomatic complexity 44 and cognitive complexity 43; 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. — src/core/session/migrations/index.ts:323
renderField has cyclomatic complexity 44 and cognitive complexity 41; 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. — src/renderer/features/plugin-operations/operation-fields.tsx:62
ActivityCalendar has cyclomatic complexity 44 and cognitive complexity 41; 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. — src/renderer/routes/dashboard/activity/activity-calendar.tsx:264
seedAsPair has cyclomatic complexity 44 and cognitive complexity 39; 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. — src/core/session/session-manager.test.ts:263
recoverAria2SessionIdentity has cyclomatic complexity 43 and cognitive complexity 73; 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. — src/core/engine/aria2/aria2-session-identity-recovery.ts:105
buildRichActivitySeed has cyclomatic complexity 43 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. — e2e/activity-tile.spec.ts:105
tryInterpret has cyclomatic complexity 42 and cognitive complexity 80; 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. — src/renderer/components/add-task/url-interpreters/curl.ts:98
removeTaskUnderMutation has cyclomatic complexity 42 and cognitive complexity 78; 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. — src/core/task/actions/remove-task.ts:100
doStart has cyclomatic complexity 42 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. — src/core/engine/engine-supervisor.ts:434
analyzeDownloadSource has cyclomatic complexity 42 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. — src/shared/lib/download-source.ts:23
LegacyImportDialogContent has cyclomatic complexity 42 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 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. — src/renderer/features/legacy-import/legacy-import-dialog.tsx:122
parseManifest has cyclomatic complexity 41 and cognitive complexity 62; 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. — src/core/plugin/manifest/parse.ts:157
(anonymous) has cyclomatic complexity 41 and cognitive complexity 37; 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:86
Do you agree with this assessment?
R3 · Large Files6.6 / 10Adequate✓ 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.
src/main/index.ts has 3252 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/index.ts:1
src/core/bridge/web-socket-bridge-server.ts has 2724 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/bridge/web-socket-bridge-server.ts:1
src/server/index.ts has 2369 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/server/index.ts:1
src/core/session/session-manager.ts has 2172 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/session/session-manager.ts:1
src/core/plugin/host/capability-bridge.ts has 2148 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/host/capability-bridge.ts:1
src/core/torrent/magnet-tracker.ts has 2143 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/torrent/magnet-tracker.ts:1
src/main/ipc/commands.ts has 2035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/ipc/commands.ts:1
src/core/plugin/host/quick-js-worker.ts has 1902 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/host/quick-js-worker.ts:1
src/core/session/motrix-database.ts has 1599 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/session/motrix-database.ts:1
src/core/task/direct-resource-validator.ts has 1539 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/task/direct-resource-validator.ts:1
src/renderer/routes/dashboard/components/dashboard-grid.tsx has 1538 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/routes/dashboard/components/dashboard-grid.tsx:1
src/core/plugin/host/plugin-host.ts has 1488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/host/plugin-host.ts:1
src/core/task/create-task-handler.ts has 1476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/task/create-task-handler.ts:1
src/core/task/actions/finalize-task.ts has 1457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/task/actions/finalize-task.ts:1
src/core/session/post-delivery-repository.ts has 1384 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/session/post-delivery-repository.ts:1
src/core/engine/aria2/aria2-adapter.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/engine/aria2/aria2-adapter.ts:1
src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx has 1286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:1
src/core/task/media-task-coordinator.ts has 1229 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/task/media-task-coordinator.ts:1
src/main/platform/appimage-integration.ts 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. — src/main/platform/appimage-integration.ts:1
src/core/ffmpeg/verified-install.ts has 1203 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/ffmpeg/verified-install.ts:1
src/server/ipc/commands.ts has 1187 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/server/ipc/commands.ts:1
src/core/bridge/credential-store.ts has 1181 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/bridge/credential-store.ts:1
src/renderer/routes/dashboard/activity/activity-calendar.tsx has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/routes/dashboard/activity/activity-calendar.tsx:1
src/core/bridge/mbp1/pair-session.ts has 1073 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/bridge/mbp1/pair-session.ts:1
src/main/bridge/index.ts has 1063 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/main/bridge/index.ts:1
src/core/legacy-import/http-activation-service.ts has 1036 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/legacy-import/http-activation-service.ts:1
src/core/engine/engine-supervisor.ts has 1035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/engine/engine-supervisor.ts:1
src/core/inspector-activity/task-inspector-activity-service.ts has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/inspector-activity/task-inspector-activity-service.ts:1
src/renderer/features/legacy-import/legacy-import-dialog.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/features/legacy-import/legacy-import-dialog.tsx:1
src/core/legacy-import/import-service.ts has 994 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/legacy-import/import-service.ts:1
src/core/plugin/plugin-registry.ts has 985 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/plugin-registry.ts:1
src/shared/lib/log-redact.ts has 959 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/shared/lib/log-redact.ts:1
src/renderer/components/add-task/add-task-form.tsx has 953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/components/add-task/add-task-form.tsx:1
src/core/torrent/swap-magnet-metadata-for-bt.ts has 922 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/torrent/swap-magnet-metadata-for-bt.ts:1
src/core/inspector-activity/task-inspector-activity-runtime.ts has 912 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/inspector-activity/task-inspector-activity-runtime.ts:1
src/core/bridge/bridge-data-dir-lock.ts has 889 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/bridge/bridge-data-dir-lock.ts:1
src/core/plugin/finalize/finalize-recovery.ts has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/finalize/finalize-recovery.ts:1
src/renderer/routes/settings/cards/bit-torrent-dialog.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:1
src/core/plugin/finalize/native-artifact-operations.ts has 846 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/plugin/finalize/native-artifact-operations.ts:1
src/core/bridge/extension-pairing-projection.ts has 832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/bridge/extension-pairing-projection.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 Coverage9.9 / 10Exemplary✓ 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. (×16) — packaging/fnos/cmd/authority-lifecycle.mjs:1, src/shared/types/plugin.ts:1, src/renderer/components/ui/command.tsx: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 · Tooling10.0 / 10Exemplary✓ 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.
Do you agree with this assessment?
R7 · Dead Code7.8 / 10Strong✓ 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 291 application, 69 tooling and 1175 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (291 application, 69 tooling, 1175 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 (×15) — scripts/profile-task-inspector-activity.mts, packaging/fnos/cmd/authority-lifecycle.mjs, scripts/measure-desktop-memory.mjs, …
Nothing imports this binding — it is safe to review for removal. (×20) — scripts/obsidian-docs-lib.mjs:14, scripts/obsidian-docs-lib.mjs:15, scripts/server-package-utils.mjs:510, …
Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/inspector-activity/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/inspector-activity/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — src/core/inspector-activity/validators.ts:11, src/core/inspector-activity/validators.ts:19
Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/stats/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/stats/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — src/core/stats/transfer-stats-service.ts:14, src/core/stats/transfer-stats-service.ts:16
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.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×5) — scripts/verify-electron-package.mjs:15, scripts/finalize-appimage-artifact.mjs:28, tests/scripts/windows-artifact-names.test.ts:52, …
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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.
src/core/plugin/finalize/finalize-committer.ts → src/core/plugin/finalize/finalize-recovery.ts → src/core/plugin/finalize/finalize-committer.ts (one verified cycle inside a mutually-dependent group of 3 files) — src/core/plugin/finalize/finalize-committer.ts:20
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository. Its Node HTTP listeners were read for HTTPS enforcement alone — TLS served, a redirect to https:// or HSTS, or a TLS-terminating proxy configuration committed beside the server — each judged per server package.
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.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×6) — src/core/engine/aria2/aria2-session-identity-recovery.ts:303, src/core/legacy-import/source-scanner.ts:213, src/core/task/bt-file-verifier.ts:235, …
createHmac(...).update(password) stores a password as a fast digest — cheap to guess whether or not it is salted — with no key-derivation function (PBKDF2/scrypt/Argon2/bcrypt). — packaging/fnos/cmd/account-authority.mjs:94
`o.password !== n.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account. — src/core/proxy/applier.ts:103
`password === this.localProxyPassword` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account. — REDACTED:162
This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price. — src/core/bridge/mbp1/scrypt-w.ts:32
`http.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — src/core/bridge/web-socket-bridge-server.ts:969
`server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.) — src/server/platform/nas/client-gateway.ts:166
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 6 sites, not one: `src/core/engine/aria2/aria2-session-identity-recovery.ts:303` (createHash("sha1")), `src/core/legacy-import/source-scanner.ts:213` (createHash("sha1")), `src/core/task/bt-file-verifier.ts:235` (createHash("sha1")), `src/core/torrent/create-torrent.ts:116` (createHash("sha1")), `src/core/torrent/create-torrent.ts:122` (createHash("sha1")), `src/core/torrent/create-torrent.ts:187` (createHash("sha1")). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Store passwords with a salted, deliberately slow KDF — scrypt or PBKDF2 from node:crypto, or bcrypt/Argon2 — and compare with a constant-time check. A fast digest of a password, however it is encoded, is reversed by precomputed tables or GPU guessing. Start in `packaging/fnos/cmd/account-authority.mjs:94`.
Raise the cost parameter to current guidance — PBKDF2 at 1,300,000 (HMAC-SHA1), 600,000 (SHA-256) or 210,000 (SHA-512) iterations; scrypt at N=2^17, r=8, p=1; bcrypt at a work factor of 10 or more — or move to a memory-hard KDF (Argon2id, scrypt) where the platform offers one. Read the parameter from configuration and tune it to roughly 100 ms per derivation on the slowest hardware that must run it, so the price can be raised again without shipping new code.
Enforce HTTPS on each listed server: serve TLS itself, or redirect plain requests to `https://` and send `Strict-Transport-Security` (`helmet()` does by default) behind the TLS-terminating proxy — and commit that proxy's configuration beside the service. A server only this machine reaches should bind `127.0.0.1`.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`pickDirty` is exported and takes `dirty: DirtyTree | undefined` from its caller, and it calls itself at line 25 (`pickDirty`) with a piece of `dirty` — and nowhere in `pickDirty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `pickDirty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/renderer/lib/form-utils.ts:25
`pickDirty` is exported, takes a document from its caller (line 6) and hands it to `hasDirty`, which calls itself at line 18 (`hasDirty`) with a piece of `node` — and nowhere in `hasDirty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `hasDirty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/renderer/lib/form-utils.ts:18
`jsonSchemaToZod` is exported and takes `node: JsonSchemaNode` from its caller, and it calls itself at line 66 (`jsonSchemaToZod`) with a piece of `node` (and at line 71) — and nowhere in `jsonSchemaToZod` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `jsonSchemaToZod` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:66
`relocatePortableValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 39 (`relocatePortableValue`) with a piece of `value` (and at line 44) — and nowhere in `relocatePortableValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `relocatePortableValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/core/session/portable-relocation.ts:39
`portablePayloadPaths` is exported, takes a document from its caller (line 113) and hands it to `mapPayloadPaths`, which calls itself at line 99 (`mapPayloadPaths`) with a piece of `value` (and at line 106) — and nowhere in `mapPayloadPaths` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapPayloadPaths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/core/session/portable-relocation.ts:99
`canonicalJson` is exported, takes a document from its caller (line 48) and hands it to `serialize`, which calls itself at line 72 (`serialize`) with a piece of `candidate` (and at line 79) — and nowhere in `serialize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `serialize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/core/plugin/post/delivery-materializer.ts:72
`flattenLocaleDict` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 30 (`flattenLocaleDict`) with a piece of `obj` — and nowhere in `flattenLocaleDict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flattenLocaleDict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/core/plugin/manifest/i18n-resolve.ts:30
`canonicalize` is exported and takes `value: unknown` from its caller, and it calls itself at line 29 (`canonicalize`) with a piece of `value` (and at line 36) — and nowhere in `canonicalize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — src/core/plugin/install/public-command-hash.ts:29
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 23/31 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`listenNasClientGateway` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`. — src/server/platform/nas/client-gateway.ts:15
`call` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`. — src/server/platform/fnos/files.ts:31
`refreshOperatorSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/renderer/lib/operator-auth.ts:55
`operatorLogin` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/renderer/lib/operator-auth.ts:133
`operatorLogout` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/renderer/lib/operator-auth.ts:153
`createTrackerHttpClient` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — src/core/tracker/tracker-http-client.ts:26
`healthy` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`. (×2) — packaging/synology/app/lifecycle.mjs:273, packaging/fnos/app/lifecycle.mjs:113
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
`debug` at line 634 is called with an argument built by `active.map((p) => p.id)` (line 639), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — src/core/plugin/hooks/hook-orchestrator.ts:634
What to do
Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped5.7 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:93
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
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. (×20) — src/shared/schemas/geoip-settings.ts:31, src/shared/schemas/registry.ts:289, src/shared/lib/log-redact.ts:413, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×19) — src/server/app-update-service.ts:49, src/server/operator-admin.ts:866, src/server/platform/nas/file-remover.ts:51, …
`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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — src/renderer/routes/settings/cards/integration/use-pair-request-prompts.tsx:381
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`error` at line 598 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/main/window/window-manager.ts:598
`warn` at line 230 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/core/task/actions/shared.ts:230
`warn` at line 252 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/core/task/actions/shared.ts:252
`warn` at line 384 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/core/task/actions/shared.ts:384
`warn` at line 393 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — src/core/task/actions/shared.ts:393
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.3 `!` null assertions per 1k TypeScript source lines — 60 assertion(s) across the 233188 source line(s) of the 1368 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: src/core/session/motrix-database.ts (32), src/core/plugin/capabilities/ffmpeg.ts (4), src/core/inspector-activity/task-inspector-activity-runtime.ts (3). 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?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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 — 3 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 — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 47 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.
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 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. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. 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 1 — a container did not start, exited, or never became healthy) — container motrix-server-1 is unhealthy; 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 — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not 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.
D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; JavaScript, Python, Rust, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Swift surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ 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) — 44 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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 — JavaScript/TypeScript suite
DM1 Aggregate boundaries — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM10 One transaction, one aggregate — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM2 Strongly-typed ids — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM4 Rich vs anemic model — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM5 Encapsulated state — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this TypeScript/JavaScript repository maps no type to a persistence framework (TypeORM/Prisma/MikroORM/Sequelize/Mongoose), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
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
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner 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
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 tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, 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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
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
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — 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.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
D10 · Test Quality· No assertions (empty test) · ×4
No assertions (empty test): installs motrix-example-bilibili-resolver from GH and rewrites a URL tests/integration/community-plugin-install.test.ts:14— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): can unregister repeatedly when manifests are already absent src/main/bridge/native-messaging-installer.test.ts:645— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): an early app link survives renderer startup and a released main window e2e/app-deep-links.spec.ts:120— Test method has an empty body — it asserts nothing and exercises no code.
No assertions (empty test): quits when the disclaimer is declined e2e/disclaimer.spec.ts:104— Test method has an empty body — it asserts nothing and exercises no code.
S1 · Web-Security Posture· Password hashing without a KDF · ×3
Password hashing without a KDF packaging/fnos/cmd/account-authority.mjs:94— createHmac(...).update(password) stores a password as a fast digest — cheap to guess whether or not it is salted — with no key-derivation function (PBKDF2/scrypt/Argon2/bcrypt).
Password hashing without a KDF src/core/proxy/applier.ts:103— `o.password !== n.password` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account.
Password hashing without a KDF REDACTED:162— `password === this.localProxyPassword` checks a password against the stored one in plaintext, so the store holds the password itself and whoever reads it holds every account.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label src/renderer/components/operator-unlock-gate.tsx:127— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
Unlisted import '@electron/asar' scripts/verify-electron-package.mjs:15— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'app-builder-lib' scripts/finalize-appimage-artifact.mjs:28— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'builder-util' tests/scripts/windows-artifact-names.test.ts:52— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'plist' tests/scripts/release-signing-input.test.ts:320— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import 'yargs' tests/scripts/ci-validation.test.ts:385— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
FunctionTooLong: index.main src/server/index.ts:227— FunctionTooLong — main runs 1642 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1542 over it, 16.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: commands.buildCommandHandlers src/main/ipc/commands.ts:314— FunctionTooLong — buildCommandHandlers runs 1188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1088 over it, 11.88× 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: index.initializeMainProcess src/main/index.ts:1662— FunctionTooLong — initializeMainProcess runs 1187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1087 over it, 11.87× 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: web-directory-picker-dialog.PickerSession src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135— FunctionTooLong — PickerSession runs 930 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 830 over it, 9.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.
FunctionTooLong: legacy-import-dialog.LegacyImportDialogContent src/renderer/features/legacy-import/legacy-import-dialog.tsx:122— FunctionTooLong — LegacyImportDialogContent runs 769 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 669 over it, 7.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.
FunctionTooLong: activity-calendar.ActivityCalendar src/renderer/routes/dashboard/activity/activity-calendar.tsx:264— FunctionTooLong — ActivityCalendar runs 769 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 669 over it, 7.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.
FunctionTooLong: commands.buildServerCommandHandlers src/server/ipc/commands.ts:224— FunctionTooLong — buildServerCommandHandlers runs 751 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 651 over it, 7.51× 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: bit-torrent-dialog.BitTorrentDialog src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:87— FunctionTooLong — BitTorrentDialog runs 687 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 587 over it, 6.87× 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: dashboard-grid.DashboardGrid src/renderer/routes/dashboard/components/dashboard-grid.tsx:849— FunctionTooLong — DashboardGrid runs 636 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 536 over it, 6.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lifetime-transfer-card.LifetimeTransferCard src/renderer/routes/downloads/inspector/lifetime-transfer-card.tsx:58— FunctionTooLong — LifetimeTransferCard runs 583 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 483 over it, 5.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.
FunctionTooLong: add-task-form.AddTaskForm src/renderer/components/add-task/add-task-form.tsx:153— FunctionTooLong — AddTaskForm runs 581 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 481 over it, 5.81× 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: media-tools-section.MediaToolsSection src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76— FunctionTooLong — MediaToolsSection runs 540 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 440 over it, 5.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: engine-diagnostics-dialog.EngineDiagnosticsDialogHost src/renderer/features/engine-diagnostics/engine-diagnostics-dialog.tsx:140— FunctionTooLong — EngineDiagnosticsDialogHost runs 510 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 410 over it, 5.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.
FunctionTooLong: swap-magnet-metadata-for-bt.swapMagnetMetadataForBtUnderMutation src/core/torrent/swap-magnet-metadata-for-bt.ts:128— FunctionTooLong — swapMagnetMetadataForBtUnderMutation runs 500 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 400 over it, 5.00× 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: operation-form.OperationFormContent src/renderer/features/plugin-operations/operation-form.tsx:103— FunctionTooLong — OperationFormContent runs 476 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 376 over it, 4.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.
FunctionTooLong: appearance-dialog.AppearanceDialog src/renderer/routes/settings/cards/appearance-dialog.tsx:98— FunctionTooLong — AppearanceDialog runs 453 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 353 over it, 4.53× 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: index.bootstrapBridge src/main/bridge/index.ts:412— FunctionTooLong — bootstrapBridge runs 432 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 332 over it, 4.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: network-dialog.NetworkDialog src/renderer/routes/settings/cards/network-dialog.tsx:96— FunctionTooLong — NetworkDialog runs 424 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 324 over it, 4.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: task-actions-menu.TaskActionsMenu src/renderer/routes/downloads/task-actions-menu.tsx:106— FunctionTooLong — TaskActionsMenu runs 422 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: advanced-dialog.AdvancedDialog src/renderer/routes/settings/cards/advanced-dialog.tsx:83— FunctionTooLong — AdvancedDialog runs 417 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 317 over it, 4.17× 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: plugin-call-graph.PluginCallGraph src/renderer/routes/plugins/components/call-graph/plugin-call-graph.tsx:221— FunctionTooLong — PluginCallGraph runs 392 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 292 over it, 3.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: speed-limit-section.SpeedLimitSection src/renderer/routes/settings/cards/speed-limit-section.tsx:121— FunctionTooLong — SpeedLimitSection runs 390 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 290 over it, 3.90× 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: nas-dialog.NasDialogForm src/renderer/routes/settings/cards/nas-dialog.tsx:111— FunctionTooLong — NasDialogForm runs 379 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 279 over it, 3.79× 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: proxy-section.ProxySection src/renderer/routes/settings/cards/proxy-section.tsx:53— FunctionTooLong — ProxySection runs 377 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 277 over it, 3.77× 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: create-torrent-form.CreateTorrentForm src/renderer/components/create-torrent/create-torrent-form.tsx:70— FunctionTooLong — CreateTorrentForm runs 376 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 276 over it, 3.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.
Hotspot: src/main/ipc/commands.ts src/main/ipc/commands.ts:314— src/main/ipc/commands.ts changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 184 in commands.buildCommandHandlers at line 314. 24 of those changes were fix/bug commits, and the other 29 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/ipc/commands.ts`: 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: src/server/index.ts src/server/index.ts:227— src/server/index.ts changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 175 in index.main at line 227. 28 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/server/index.ts`: 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: src/main/index.ts src/main/index.ts:1662— src/main/index.ts changed 76 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in index.initializeMainProcess at line 1662. 41 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/index.ts`: 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: src/server/ipc/commands.ts src/server/ipc/commands.ts:224— src/server/ipc/commands.ts changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 90 in commands.buildServerCommandHandlers at line 224. 18 of those changes were fix/bug commits, and the other 24 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/server/ipc/commands.ts`: 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: src/core/task/create-task-handler.ts src/core/task/create-task-handler.ts:393— src/core/task/create-task-handler.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 147 in create-task-handler.handleCreateTaskUnderAdmission at line 393. 15 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/task/create-task-handler.ts`: 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: src/renderer/components/add-task/add-task-form.tsx src/renderer/components/add-task/add-task-form.tsx:153— src/renderer/components/add-task/add-task-form.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in add-task-form.AddTaskForm at line 153. 12 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/components/add-task/add-task-form.tsx`: 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: scripts/verify-flatpak-packaging.mjs scripts/verify-flatpak-packaging.mjs:118— scripts/verify-flatpak-packaging.mjs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in verify-flatpak-packaging.verifyFlatpakPackaging at line 118. 14 of those changes were fix/bug commits, and the other 19 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- scripts/verify-flatpak-packaging.mjs`: 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: src/core/session/session-manager.ts src/core/session/session-manager.ts:793— src/core/session/session-manager.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in SessionManager.restore at line 793. 15 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/session/session-manager.ts`: 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: src/core/engine/aria2/aria2-adapter.ts src/core/engine/aria2/aria2-adapter.ts:882— src/core/engine/aria2/aria2-adapter.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in Aria2Adapter.addTorrent at line 882. 15 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/engine/aria2/aria2-adapter.ts`: 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: src/renderer/routes/downloads/task-actions-menu.tsx src/renderer/routes/downloads/task-actions-menu.tsx:106— src/renderer/routes/downloads/task-actions-menu.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in task-actions-menu.TaskActionsMenu at line 106. 5 of those changes were fix/bug commits, and the other 9 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/downloads/task-actions-menu.tsx`: 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: src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135— src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 210 in web-directory-picker-dialog.PickerSession at line 135. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx`: 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: src/renderer/routes/settings/cards/integration/media-tools-section.tsx src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76— src/renderer/routes/settings/cards/integration/media-tools-section.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in media-tools-section.MediaToolsSection at line 76. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/settings/cards/integration/media-tools-section.tsx`: 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: REDACTED REDACTED:152— REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in app.createApp at line 152. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- REDACTED`: 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: src/renderer/routes/settings/cards/appearance-dialog.tsx src/renderer/routes/settings/cards/appearance-dialog.tsx:98— src/renderer/routes/settings/cards/appearance-dialog.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in appearance-dialog.AppearanceDialog at line 98. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/settings/cards/appearance-dialog.tsx`: 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: src/core/engine/engine-supervisor.ts src/core/engine/engine-supervisor.ts:434— src/core/engine/engine-supervisor.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in EngineSupervisor.doStart at line 434. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/engine/engine-supervisor.ts`: 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: packages/finalize-fs/src/state.rs packages/finalize-fs/src/state.rs:32— packages/finalize-fs/src/state.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in State::dispatch at line 32. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/state.rs`: 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: src/renderer/features/legacy-import/legacy-import-dialog.tsx src/renderer/features/legacy-import/legacy-import-dialog.tsx:122— src/renderer/features/legacy-import/legacy-import-dialog.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 152 in legacy-import-dialog.LegacyImportDialogContent at line 122. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/features/legacy-import/legacy-import-dialog.tsx`: 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: src/renderer/components/desktop-kit/directory-picker.tsx src/renderer/components/desktop-kit/directory-picker.tsx:56— src/renderer/components/desktop-kit/directory-picker.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in directory-picker.DirectoryPicker at line 56. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/components/desktop-kit/directory-picker.tsx`: 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: src/core/task/media-task-coordinator.ts src/core/task/media-task-coordinator.ts:237— src/core/task/media-task-coordinator.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in MediaTaskCoordinator.run at line 237. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/task/media-task-coordinator.ts`: 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: src/main/bridge/index.ts src/main/bridge/index.ts:412— src/main/bridge/index.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in index.bootstrapBridge at line 412. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/bridge/index.ts`: 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: src/core/task/actions/finalize-task.ts src/core/task/actions/finalize-task.ts:204— src/core/task/actions/finalize-task.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in finalize-task.finalizeTaskSerialized at line 204. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/task/actions/finalize-task.ts`: 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: REDACTED REDACTED:928— REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in smoke-server-image.smokeServerImage at line 928. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- REDACTED`: 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: src/renderer/routes/downloads/downloads-page.tsx src/renderer/routes/downloads/downloads-page.tsx:112— src/renderer/routes/downloads/downloads-page.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in downloads-page.DownloadsPage at line 112. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/downloads/downloads-page.tsx`: 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: src/renderer/routes/downloads/task-inspector-drawer.tsx src/renderer/routes/downloads/task-inspector-drawer.tsx:63— src/renderer/routes/downloads/task-inspector-drawer.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in task-inspector-drawer.TaskInspectorDrawer at line 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/downloads/task-inspector-drawer.tsx`: 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: src/core/task/actions/re-add-task.ts src/core/task/actions/re-add-task.ts:212— src/core/task/actions/re-add-task.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in re-add-task.buildDirectReAddParams at line 212. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/task/actions/re-add-task.ts`: 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: main/index.ts src/main/index.ts— FileTooLong — 2343 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1843 over it, 4.69× 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: server/index.ts src/server/index.ts— FileTooLong — 1872 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: main (227-2424). The bar is 500 significant lines; this is 1372 over it, 3.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: bridge/web-socket-bridge-server.ts src/core/bridge/web-socket-bridge-server.ts— FileTooLong — 1668 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: WebSocketBridgeServer (557-2593). The bar is 500 significant lines; this is 1168 over it, 3.34× 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: ipc/commands.ts src/main/ipc/commands.ts— FileTooLong — 1569 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: buildCommandHandlers (314-2024). The bar is 500 significant lines; this is 1069 over it, 3.14× 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: session/session-manager.ts src/core/session/session-manager.ts— FileTooLong — 1542 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: SessionManager (245-2232). The bar is 500 significant lines; this is 1042 over it, 3.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: torrent/magnet-tracker.ts src/core/torrent/magnet-tracker.ts— FileTooLong — 1513 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: MagnetTracker (198-2134). The bar is 500 significant lines; this is 1013 over it, 3.03× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: host/capability-bridge.ts src/core/plugin/host/capability-bridge.ts— FileTooLong — 1480 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 980 over it, 2.96× 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: host/quick-js-worker.ts src/core/plugin/host/quick-js-worker.ts— FileTooLong — 1411 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 911 over it, 2.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: components/dashboard-grid.tsx src/renderer/routes/dashboard/components/dashboard-grid.tsx— FileTooLong — 1320 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 820 over it, 2.64× 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: task/direct-resource-validator.ts src/core/task/direct-resource-validator.ts— FileTooLong — 1190 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 690 over it, 2.38× 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: session/post-delivery-repository.ts src/core/session/post-delivery-repository.ts— FileTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: SqlitePostDeliveryRepository (117-1406). The bar is 500 significant lines; this is 668 over it, 2.34× 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: web-directory-picker/web-directory-picker-dialog.tsx src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx— FileTooLong — 1141 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: PickerSession (135-1187). The bar is 500 significant lines; this is 641 over it, 2.28× 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: session/motrix-database.ts src/core/session/motrix-database.ts— FileTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: MotrixDatabase (230-1396). The bar is 500 significant lines; this is 640 over it, 2.28× 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: task/create-task-handler.ts src/core/task/create-task-handler.ts— FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded), about 62% of them inside a single declaration: handleCreateTaskUnderAdmission (393-1353). The bar is 500 significant lines; this is 556 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.
FileTooLong: actions/finalize-task.ts src/core/task/actions/finalize-task.ts— FileTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 542 over it, 2.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: host/plugin-host.ts src/core/plugin/host/plugin-host.ts— FileTooLong — 1039 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: PluginHost (157-1453). The bar is 500 significant lines; this is 539 over it, 2.08× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: activity/activity-calendar.tsx src/renderer/routes/dashboard/activity/activity-calendar.tsx— FileTooLong — 977 significant lines (blank, comment-only and punctuation-only lines excluded), about 79% of them inside a single declaration: ActivityCalendar (264-1226). The bar is 500 significant lines; this is 477 over it, 1.95× 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: aria2/aria2-adapter.ts src/core/engine/aria2/aria2-adapter.ts— FileTooLong — 976 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: Aria2Adapter (148-1402). The bar is 500 significant lines; this is 476 over it, 1.95× 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: ffmpeg/verified-install.ts src/core/ffmpeg/verified-install.ts— FileTooLong — 971 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 471 over it, 1.94× 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: ipc/commands.ts src/server/ipc/commands.ts— FileTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: buildServerCommandHandlers (224-1260). The bar is 500 significant lines; this is 458 over it, 1.92× 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: legacy-import/legacy-import-dialog.tsx src/renderer/features/legacy-import/legacy-import-dialog.tsx— FileTooLong — 875 significant lines (blank, comment-only and punctuation-only lines excluded), about 88% of them inside a single declaration: LegacyImportDialogContent (122-1021). The bar is 500 significant lines; this is 375 over it, 1.75× 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: task/media-task-coordinator.ts src/core/task/media-task-coordinator.ts— FileTooLong — 855 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: EMIT_THROTTLE_MS (167-1172). The bar is 500 significant lines; this is 355 over it, 1.71× 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: legacy-import/http-activation-service.ts src/core/legacy-import/http-activation-service.ts— FileTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: LegacyHttpActivationService (66-1060). The bar is 500 significant lines; this is 347 over it, 1.69× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: inspector-activity/task-inspector-activity-service.ts src/core/inspector-activity/task-inspector-activity-service.ts— FileTooLong — 833 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: TaskInspectorActivityService (154-1089). The bar is 500 significant lines; this is 333 over it, 1.67× 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: legacy-import/import-service.ts src/core/legacy-import/import-service.ts— FileTooLong — 825 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: LegacyImportService (61-1029). The bar is 500 significant lines; this is 325 over it, 1.65× 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: MediaTaskCoordinator.run src/core/task/media-task-coordinator.ts:237— MethodTooLong — run runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× 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: State.dispatch packages/finalize-fs/src/state.rs:32— MethodTooLong — dispatch runs 354 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 254 over it, 3.54× 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: SessionManager.restore src/core/session/session-manager.ts:793— MethodTooLong — restore runs 263 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× 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: PluginHost.doActivate src/core/plugin/host/plugin-host.ts:458— MethodTooLong — doActivate runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SegmentDownloader.run src/core/download/segment-downloader.ts:234— MethodTooLong — run runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LegacyHttpActivationService.reconcile src/core/legacy-import/http-activation-service.ts:790— MethodTooLong — reconcile runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionManager.reAddOrMarkErrorFromPair src/core/session/session-manager.ts:1692— MethodTooLong — reAddOrMarkErrorFromPair runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TrackerManager.performSyncAndCurate src/core/tracker/tracker-manager.ts:301— MethodTooLong — performSyncAndCurate runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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: WebSocketBridgeServer.constructor src/core/bridge/web-socket-bridge-server.ts:607— MethodTooLong — constructor 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: EngineSupervisor.doStart src/core/engine/engine-supervisor.ts:434— MethodTooLong — doStart runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× 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: FinalizeRecovery.recover src/core/plugin/finalize/finalize-recovery.ts:81— MethodTooLong — recover runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.77× 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: MotrixDatabase.prepareStatements src/core/session/motrix-database.ts:308— MethodTooLong — prepareStatements runs 175 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× 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: PluginHttpClient.fetch src/core/plugin/network/plugin-http-client.ts:25— MethodTooLong — fetch runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: Aria2Adapter.addTorrent src/core/engine/aria2/aria2-adapter.ts:882— MethodTooLong — addTorrent runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: FullCrossPluginInvoker.execute src/core/plugin/commands/cross-plugin-invoker.ts:114— MethodTooLong — execute runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: DurableFinalizeRuntime.commit src/core/session/durable-finalize-runtime.ts:83— MethodTooLong — commit runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: ReconnectSession.onReconnectResponse src/core/bridge/mbp1/reconnect-session.ts:206— MethodTooLong — onReconnectResponse runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PluginInstaller.stage src/core/plugin/install/plugin-installer.ts:249— MethodTooLong — stage runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× 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: MagnetTracker.retryMetadataUnderMutation src/core/torrent/magnet-tracker.ts:742— MethodTooLong — retryMetadataUnderMutation runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FinalizeCommitter.commitPrepared src/core/plugin/finalize/finalize-committer.ts:276— MethodTooLong — commitPrepared runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× 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: Aria2Adapter.createDownload src/core/engine/aria2/aria2-adapter.ts:435— MethodTooLong — createDownload runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× 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: OperationFiles.execution src/core/plugin/operations/operation-files.ts:389— MethodTooLong — execution runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× 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: HttpCapabilityHost.request src/core/plugin/capabilities/http.ts:397— MethodTooLong — request runs 142 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 42 over it, 1.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OperationService.run src/core/plugin/operations/operation-service.ts:624— MethodTooLong — run runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.37× 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: TaskInspectorActivityStore.applyCheckpoint src/core/inspector-activity/task-inspector-activity-store.ts:339— MethodTooLong — applyCheckpoint runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× 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.
Swallowed exception (empty catch) src/shared/schemas/geoip-settings.ts:31— 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) src/shared/schemas/registry.ts:289— 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) src/shared/lib/log-redact.ts:413— 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) src/shared/lib/log-redact.ts:770— 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) src/shared/lib/log-redact.ts:775— 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) src/server/app-update-service.ts:49— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/operator-admin.ts:414— 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) src/server/operator-admin.ts:866— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/shutdown.ts:43— 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) src/server/shutdown.ts:124— 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) src/server/platform/nas/file-remover.ts:51— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/platform/nas/file-remover.ts:59— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/platform/nas/file-routes.ts:270— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/platform/nas/file-routes.ts:277— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/platform/nas/file-routes.ts:314— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/server/ipc/commands.ts:511— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:48— 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) src/server/bridge/server-extension-mbp1-runtime.ts:254— 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) src/renderer/routes/trackers/components/blacklist-tracker-panel.tsx:42— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/renderer/routes/trackers/components/effective-tracker-panel.tsx:62— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/renderer/routes/settings/cards/nas-dialog.tsx:222— 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) src/renderer/routes/settings/cards/integration/appimage-integration-section.tsx:76— 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) src/renderer/routes/settings/cards/integration/appimage-native-host-section.tsx:25— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/renderer/routes/plugins/lib/call-graph-layout.ts:44— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) src/renderer/routes/plugins/hooks/use-plugin-detail.ts:47— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Repeated repair: packages/finalize-fs/src/protocol.rs packages/finalize-fs/src/protocol.rs:274— packages/finalize-fs/src/protocol.rs changed 10 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 4 (its worst body is motrix_finalize_fs::protocol::read_frame at line 274), 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(finalize): stabilize Windows suffix renames and recover quarantines (#2512)”; “fix(downloads): avoid hashing ordinary windows finalization (#2406)”; “fix(finalize): support cross-platform publication and storage recovery (#2339)”; “fix(finalize): bound rename retries and report durable completion (#2265)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/protocol.rs`: 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: src/core/engine/aria2/aria2-rpc-client.ts src/core/engine/aria2/aria2-rpc-client.ts:198— src/core/engine/aria2/aria2-rpc-client.ts changed 10 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 9 (its worst body is Aria2RpcClient.unpause at line 198), 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(downloads): continue retained http tasks through the engine (#2489)”; “fix(torrent): support large tasks and streamline detail updates (#2453)”; “fix: unblock task creation, resume retried downloads, explain long paths (#2194)”; “fix: stabilize linux ci and improve scrollbar contrast (#2180)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/engine/aria2/aria2-rpc-client.ts`: 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: src/shared/external-urls.ts src/shared/external-urls.ts:58— src/shared/external-urls.ts 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 2 (its worst body is external-urls.getFfmpegManualUrl at line 58), 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(server): complete media tools and settings controls (#2497)”; “fix(updater): serialize installs and guard cross-volume updates (#2433)”; “fix(ffmpeg): polish verified installation and settings (#2302)”; “fix(linux): replace login startup switches with manual guidance (#2261)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/shared/external-urls.ts`: 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: packages/finalize-fs/src/platform/windows/mod.rs packages/finalize-fs/src/platform/windows/mod.rs:258— packages/finalize-fs/src/platform/windows/mod.rs changed 7 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 6 (its worst body is motrix_finalize_fs::platform::windows::split_absolute_root at line 258), 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(finalize): stabilize Windows suffix renames and recover quarantines (#2512)”; “fix(finalize): allow exfat directory roots without file ids (#2330)”; “fix(finalize): bound rename retries and report durable completion (#2265)”; “fix(finalize): harden artifact publication across filesystems (#2192)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/platform/windows/mod.rs`: 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: src/core/bridge-receiver/submit-download-adapter.ts src/core/bridge-receiver/submit-download-adapter.ts:98— src/core/bridge-receiver/submit-download-adapter.ts changed 7 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 15 (its worst body is SubmitDownloadAdapter.adapt at line 98), 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(bridge): sanitize browser cookies before engine dispatch (#2469)”; “fix(bridge): isolate browser extension installations (#2468)”; “fix(bridge): preserve browser download filenames (#2155)”; “fix(downloads): validate sources and stabilize url entry (#2154)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/bridge-receiver/submit-download-adapter.ts`: 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: src/core/engine/aria2/aria2-process-manager.ts src/core/engine/aria2/aria2-process-manager.ts:277— src/core/engine/aria2/aria2-process-manager.ts changed 6 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 14 (its worst body is Aria2ProcessManager.inspectPort at line 277), 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(engine): preserve production download diagnostics (#2361)”; “fix(aria2): harden WebSocket RPC and upgrade engine (#2032)”; “fix(download): preserve filenames for proxied redirect downloads (#2013)”; “fix: resolve beta blockers in downloads, RPC, NAT, and proxy (#2002)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/engine/aria2/aria2-process-manager.ts`: 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: src/shared/schemas/engine-settings.ts src/shared/schemas/engine-settings.ts:15— src/shared/schemas/engine-settings.ts 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 4 (its worst body is engine-settings.controlFreeString at line 15), 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(settings): raise concurrent download limit to 200 (#2460)”; “fix(settings): clarify validation and connection feedback (#2126)”; “fix(bt): isolate web seed failures and extend magnet timeout (#2088)”; “fix(download): preserve filenames for proxied redirect downloads (#2013)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/shared/schemas/engine-settings.ts`: 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: src/renderer/components/desktop-kit/panel/panel-shell.tsx src/renderer/components/desktop-kit/panel/panel-shell.tsx:28— src/renderer/components/desktop-kit/panel/panel-shell.tsx 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 7 (its worst body is panel-shell.PanelShell at line 28), 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(downloads): keep list rows reachable under the inspector drawer (#2288)”; “fix(panels): restrict toolbar dragging to compact headers (#2281)”; “fix(ui): adjust panel header spacing”; “fix(downloads): refine list, inspector, and menu interactions (#2149)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/components/desktop-kit/panel/panel-shell.tsx`: 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: packages/finalize-fs/src/platform/mod.rs packages/finalize-fs/src/platform/mod.rs:108— packages/finalize-fs/src/platform/mod.rs changed 7 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 2 (its worst body is motrix_finalize_fs::platform::open_root_for_selection at line 108), 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(finalize): stabilize Windows suffix renames and recover quarantines (#2512)”; “fix(finalize): support cross-platform publication and storage recovery (#2339)”; “fix(finalize): publish completed files safely on NFS (#2179)”; “fix(finalize): support smb shares and recover failed journals (#2132)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/platform/mod.rs`: 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: src/renderer/windows/add-task-window.tsx src/renderer/windows/add-task-window.tsx:19— src/renderer/windows/add-task-window.tsx 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 3 (its worst body is add-task-window.AddTaskWindow at line 19), 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(window): preserve hidden main when cancelling new tasks (#2495)”; “fix: stabilize browser bridge and FFmpeg media workflow (#2019)”; “fix(bt): prevent duplicate torrent tasks and path conflicts (#1939)”; “fix: persist settings and align desktop window controls (#1906)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/windows/add-task-window.tsx`: 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: packages/finalize-fs/src/platform/unix/mod.rs packages/finalize-fs/src/platform/unix/mod.rs:75— packages/finalize-fs/src/platform/unix/mod.rs 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 9 (its worst body is motrix_finalize_fs::platform::unix::open_root 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: “fix(finalize): support cross-platform publication and storage recovery (#2339)”; “fix: stabilize linux ci and improve scrollbar contrast (#2180)”; “fix(finalize): publish completed files safely on NFS (#2179)”; “fix(task): repair terminal recovery and large artifact finalization (#2080)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/platform/unix/mod.rs`: 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: src/core/engine/aria2/translate.ts src/core/engine/aria2/translate.ts:35— src/core/engine/aria2/translate.ts 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 13 (its worst body is translate.translateStatus 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(torrent): support large tasks and streamline detail updates (#2453)”; “fix(engine): open windows paths past MAX_PATH (#2195)”; “fix: unblock task creation, resume retried downloads, explain long paths (#2194)”; “fix(bt): persist magnet file metadata (#1937)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/engine/aria2/translate.ts`: 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: src/main/ipc/commands/reveal-in-folder.ts src/main/ipc/commands/reveal-in-folder.ts:46— src/main/ipc/commands/reveal-in-folder.ts 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 7 (its worst body is reveal-in-folder.createRevealInFolderHandler.<returned closure> at line 46), 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(downloads): normalize windows task output paths (#2395)”; “fix(downloads): stabilize task controls and completion display (#2100)”; “fix(bt): prevent duplicate torrent tasks and path conflicts (#1939)”; “fix(security): harden supply-chain trust boundaries (#1846)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/ipc/commands/reveal-in-folder.ts`: 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: src/main/launcher.ts src/main/launcher.ts:55— src/main/launcher.ts 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 14 (its worst body is launcher.setupLauncher at line 55), 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(window): preserve visibility on repeated login launches (#2348)”; “fix(window): preserve startup activation and restore minimized windows (#2325)”; “fix(protocol): restore safe motrix deep links and retire mo (#2300)”; “fix(bridge): restore Windows desktop startup (#2066)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/launcher.ts`: 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: src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx:23— src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx 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 10 (its worst body is virtual-list.VirtualListInner 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(downloads): keep scrollbar below the column header (#2323)”; “fix(downloads): keep list rows reachable under the inspector drawer (#2288)”; “fix(downloads): refine list, inspector, and menu interactions (#2149)”; “fix(downloads): stabilize task controls and completion display (#2100)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/components/desktop-kit/virtual-list/virtual-list.tsx`: 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: packages/finalize-fs/src/platform/windows/metadata.rs packages/finalize-fs/src/platform/windows/metadata.rs:296— packages/finalize-fs/src/platform/windows/metadata.rs 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 14 (its worst body is motrix_finalize_fs::platform::windows::metadata::directory_names at line 296), 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(finalize): stabilize Windows suffix renames and recover quarantines (#2512)”; “fix(finalize): allow exfat directory roots without file ids (#2330)”; “fix(finalize): bound rename retries and report durable completion (#2265)”; “fix(finalize): support smb shares and recover failed journals (#2132)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/platform/windows/metadata.rs`: 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: src/renderer/routes/downloads/columns.ts src/renderer/routes/downloads/columns.ts:23— src/renderer/routes/downloads/columns.ts 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 2 (its worst body is columns.clampColumnWidth 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(downloads): clarify active task connection counts (#2480)”; “fix(downloads): restore checkboxes for touch-friendly selection (#2381)”; “fix(ui): polish dashboard metrics, tray speeds and download labels (#2175)”; “fix(downloads): refine list, inspector, and menu interactions (#2149)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/renderer/routes/downloads/columns.ts`: 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: src/main/window/platform-options.ts src/main/window/platform-options.ts:25— src/main/window/platform-options.ts 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 6 (its worst body is platform-options.buildPlatformOptions at line 25), 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(window): align startup themes and fullscreen chrome (#2057)”; “fix: persist settings and align desktop window controls (#1906)”; “fix: sync and align window controls (#1894)”; “fix: improve window controls and refresh dependencies (#1886)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/main/window/platform-options.ts`: 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: REDACTED REDACTED:55— REDACTED 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 10 (its worst body is proxy-settings.isProxyHost at line 55), 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(plugins): apply dedicated proxy scope to plugin networking (#2360)”; “fix(settings): clarify validation and connection feedback (#2126)”; “fix(download): preserve filenames for proxied redirect downloads (#2013)”; “fix: resolve beta blockers in downloads, RPC, NAT, and proxy (#2002)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- REDACTED`: 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: src/shared/schemas/direct-replay-recipe.ts src/shared/schemas/direct-replay-recipe.ts:69— src/shared/schemas/direct-replay-recipe.ts 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 4 (its worst body is direct-replay-recipe.directReplayV1Schema at line 69), 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(downloads): continue retained http tasks through the engine (#2489)”; “fix(task): validate http resume metadata and report failures (#2430)”; “fix(bridge): submit task cookies with aria2 motrix.13 (#2073)”; “fix(download): preserve filenames for proxied redirect downloads (#2013)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/shared/schemas/direct-replay-recipe.ts`: 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: src/core/bridge-receiver/pipelines/direct-pipeline.ts src/core/bridge-receiver/pipelines/direct-pipeline.ts:34— src/core/bridge-receiver/pipelines/direct-pipeline.ts 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 4 (its worst body is DirectPipeline.dispatch at line 34), 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(bridge): sanitize browser cookies before engine dispatch (#2469)”; “fix(bridge): preserve browser download filenames (#2155)”; “fix(bridge): submit task cookies with aria2 motrix.13 (#2073)”; “fix: address desktop onboarding, bridge, and installer issues (#2062)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/core/bridge-receiver/pipelines/direct-pipeline.ts`: 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: packages/finalize-fs/src/error.rs packages/finalize-fs/src/error.rs:3— packages/finalize-fs/src/error.rs 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 13 (its worst body is motrix_finalize_fs::error::classify_error at line 3), 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(finalize): support cross-platform publication and storage recovery (#2339)”; “fix(finalize): bound rename retries and report durable completion (#2265)”; “fix(finalize): publish completed files safely on NFS (#2179)”; “fix(finalize): support smb shares and recover failed journals (#2132)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/error.rs`: 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: packages/finalize-fs/src/platform/unix/rename.rs packages/finalize-fs/src/platform/unix/rename.rs:10— packages/finalize-fs/src/platform/unix/rename.rs 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 2 (its worst body is motrix_finalize_fs::platform::unix::rename::rename_opened_no_replace at line 10), 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(finalize): bound rename retries and report durable completion (#2265)”; “fix(finalize): harden artifact publication across filesystems (#2192)”; “fix(finalize): publish completed files safely on NFS (#2179)”; “fix(task): repair terminal recovery and large artifact finalization (#2080)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- packages/finalize-fs/src/platform/unix/rename.rs`: 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: src/server/http/events.ts src/server/http/events.ts:30— src/server/http/events.ts 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 events.bindEventBroadcaster.broadcast at line 30), 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(server): complete media tools and settings controls (#2497)”; “fix(server): allow terminal extension pairing without web url (#2400)”; “fix(web): recover task updates and preserve magnet file selection (#2167)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- src/server/http/events.ts`: 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: REDACTED REDACTED:198— REDACTED 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 aria2.waitForRpc at line 198), 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(engine): upgrade aria2 for durable task cookies (#2074)”; “fix(bridge): submit task cookies with aria2 motrix.13 (#2073)”; “fix(aria2): harden WebSocket RPC and upgrade engine (#2032)”. 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-12..2026-11-10, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-12 00:31:54 +08:00' --until='2026-11-10 00:31:54 +08:00' --full-history --no-merges -- REDACTED`: 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.
ClassTooLong: SessionManager src/core/session/session-manager.ts:245— ClassTooLong — 1313 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 913 over it, 3.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: MagnetTracker src/core/torrent/magnet-tracker.ts:198— ClassTooLong — 1290 significant lines (blank, comment-only and punctuation-only lines excluded), 48 methods. The bar is 400 significant lines; this is 890 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WebSocketBridgeServer src/core/bridge/web-socket-bridge-server.ts:557— ClassTooLong — 1224 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 824 over it, 3.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SqlitePostDeliveryRepository src/core/session/post-delivery-repository.ts:117— ClassTooLong — 1045 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 645 over it, 2.61× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PluginHost src/core/plugin/host/plugin-host.ts:157— ClassTooLong — 870 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 470 over it, 2.18× 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: Aria2Adapter src/core/engine/aria2/aria2-adapter.ts:148— ClassTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 439 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LegacyHttpActivationService src/core/legacy-import/http-activation-service.ts:66— ClassTooLong — 788 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 388 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.
ClassTooLong: LegacyImportService src/core/legacy-import/import-service.ts:61— ClassTooLong — 769 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 369 over it, 1.92× 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: MotrixDatabase src/core/session/motrix-database.ts:230— ClassTooLong — 753 significant lines (blank, comment-only and punctuation-only lines excluded), 42 methods. The bar is 400 significant lines; this is 353 over it, 1.88× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TaskInspectorActivityService src/core/inspector-activity/task-inspector-activity-service.ts:154— ClassTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 309 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.
ClassTooLong: EngineSupervisor src/core/engine/engine-supervisor.ts:91— ClassTooLong — 685 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 285 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FinalizeRecovery src/core/plugin/finalize/finalize-recovery.ts:46— ClassTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 224 over it, 1.56× 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: OperationService src/core/plugin/operations/operation-service.ts:68— ClassTooLong — 600 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 200 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TrackerManager src/core/tracker/tracker-manager.ts:79— ClassTooLong — 594 significant lines (blank, comment-only and punctuation-only lines excluded), 35 methods. The bar is 400 significant lines; this is 194 over it, 1.49× 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: NativeFinalizeArtifactOperations src/core/plugin/finalize/native-artifact-operations.ts:40— ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 188 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TaskInspectorActivityRuntime src/core/inspector-activity/task-inspector-activity-runtime.ts:123— ClassTooLong — 581 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 181 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PluginRegistry src/core/plugin/plugin-registry.ts:148— ClassTooLong — 564 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 164 over it, 1.41× 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: OperationFiles src/core/plugin/operations/operation-files.ts:54— ClassTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 144 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PairSession src/core/bridge/mbp1/pair-session.ts:250— ClassTooLong — 523 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 123 over it, 1.31× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DirectoryPickerController src/renderer/features/web-directory-picker/directory-picker-controller.ts:89— ClassTooLong — 501 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 101 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RendererSupervisor src/main/window/renderer-supervisor.ts:78— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 100 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TaskInspectorActivityStore src/core/inspector-activity/task-inspector-activity-store.ts:189— ClassTooLong — 496 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 96 over it, 1.24× 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: WindowManager src/main/window/window-manager.ts:60— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 39 methods. The bar is 400 significant lines; this is 75 over it, 1.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LegacyBtActivationService src/core/legacy-import/bt-activation-service.ts:46— ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 74 over it, 1.19× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeFinalizeFilesystemAdapter src/core/plugin/finalize/filesystem-adapter.ts:181— ClassTooLong — 457 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 57 over it, 1.14× 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: Aria2RpcClient src/core/engine/aria2/aria2-rpc-client.ts:35— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Aria2Adapter src/core/engine/aria2/aria2-adapter.ts:148— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. Most of these members implement engine-adapter.EngineAdapter (50 of 61 members), so moving them onto a smaller type would remove them from that contract rather than reduce it. To reduce it, split the contract instead: give each cohesive group of operations its own smaller interface and its own implementing type. Where the contract has to stay whole, move the work behind these members into collaborator types, so what is left here is a forward per member rather than a responsibility per member.
TooManyMethods: PluginHost src/core/plugin/host/plugin-host.ts:157— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.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: WebSocketBridgeServer src/core/bridge/web-socket-bridge-server.ts:557— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SqlitePostDeliveryRepository src/core/session/post-delivery-repository.ts:117— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MagnetTracker src/core/torrent/magnet-tracker.ts:198— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CapabilityBridge src/core/plugin/host/capability-bridge.ts:370— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SessionManager src/core/session/session-manager.ts:245— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MotrixDatabase src/core/session/motrix-database.ts:230— TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RendererSupervisor src/main/window/renderer-supervisor.ts:78— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: WindowManager src/main/window/window-manager.ts:60— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: EngineSupervisor src/core/engine/engine-supervisor.ts:91— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TrackerManager src/core/tracker/tracker-manager.ts:79— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LegacyImportService src/core/legacy-import/import-service.ts:61— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DirectoryPickerController src/renderer/features/web-directory-picker/directory-picker-controller.ts:89— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TaskInspectorActivityService src/core/inspector-activity/task-inspector-activity-service.ts:154— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TaskInspectorActivityRuntime src/core/inspector-activity/task-inspector-activity-runtime.ts:123— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeFinalizeFilesystemAdapter src/core/plugin/finalize/filesystem-adapter.ts:181— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Sync-over-async blocking packages/native-host/build.mjs:144— `spawnSync` in `buildNativeHost` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking packages/native-host/package-flatpak-companion.mjs:166— `gzipSync` in `packageFlatpakCompanion` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/appimage-artifact.mjs:319— `inflateRawSync` in `inspectEmbeddedBlockmap` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/fetch-engine.mjs:291— `existsSync` in `readLockFile` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/sign-macos.mjs:89— `execFileSync` in `sign` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/sign-macos.mjs:100— `execFileSync` in `sign` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking scripts/sign-macos.mjs:106— `execFileSync` in `sign` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:421— `execFileSync` in `replacePayload` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/ffmpeg/verified-install.ts:950— `existsSync` in `verifyLegacyMacFfmpeg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/ffmpeg/verified-install.ts:1034— `existsSync` in `installVerifiedFfmpeg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/ffmpeg/verified-install.ts:1126— `existsSync` in `installVerifiedFfmpeg` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/plugin/host/test-helpers.ts:110— `readFileSync` in `spawnTestBridge` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/plugin/host/test-helpers.ts:115— `readFileSync` in `spawnTestBridge` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/plugin/secret-store-libsodium.ts:84— `existsSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/plugin/secret-store-libsodium.ts:85— `readFileSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/plugin/secret-store-libsodium.ts:98— `writeFileSync` in `create` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/session/session-manager.ts:1707— `fs.existsSync` in `reAddOrMarkErrorFromPair` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking src/core/session/session-manager.ts:1715— `fs.readFileSync` in `reAddOrMarkErrorFromPair` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R4 · Test Coverage· No test reaches this file · ×16
No test reaches this file packaging/fnos/cmd/authority-lifecycle.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 src/shared/types/plugin.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 src/renderer/components/ui/command.tsx: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 packages/safari-bootstrap/build.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 packages/safari-bootstrap/test-integration.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 src/renderer/components/desktop-kit/sidebar/nav-user.tsx: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 src/renderer/components/ui/table.tsx: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 src/renderer/components/task/task-status-badge.tsx: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 src/renderer/components/desktop-kit/sidebar/nav-projects.tsx: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 src/renderer/components/desktop-kit/sidebar/nav-main.tsx: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 packages/finalize-fs/build.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 src/renderer/routes/plugins/components/plugin-permission-list.tsx: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 src/renderer/components/ui/native-select.tsx: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 src/renderer/routes/plugins/components/about-section.tsx: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 src/renderer/components/desktop-kit/sidebar/nav-secondary.tsx: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 src/server/operator-cli.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 assertions: keeps the operation visible but unavailable for a disabled plugin src/renderer/routes/plugins/plugin-detail-page.test.tsx:257— 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: removes listeners on unmount src/renderer/hooks/use-modifier-keys.test.ts:36— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, 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: skips updateApp when handler is undefined src/core/proxy/applier.test.ts:173— 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: is a no-op when not running src/core/engine/aria2/aria2-process-manager.test.ts:563— 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: is a no-op when not running src/core/engine/aria2/aria2-process-manager.test.ts:582— 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: ignores notifications with no matching handler src/core/engine/aria2/aria2-rpc-client.test.ts:970— 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: positive time ends seeding even when ratio is unlimited src/core/engine/aria2/seeding-policy.integration.test.ts:110— 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: restoreInflight: no-op src/core/bridge-receiver/bridge-receiver.test.ts:217— 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: restricts a PairSession handle to paired or aborted outcomes src/core/bridge/pairing-prompt-controller.test.ts:99— 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: a second launch restores a minimized main window e2e/window-reopen.spec.ts:99— 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.
AC2 · Forms & labels· <fieldset> without a <legend> · ×8
<fieldset> without a <legend> src/renderer/routes/settings/cards/advanced-dialog.tsx:199— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/appearance-dialog.tsx:249— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:180— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/downloads-dialog.tsx:130— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/general-dialog.tsx:259— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/integration/integration-dialog.tsx:165— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/nas-dialog.tsx:266— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
<fieldset> without a <legend> src/renderer/routes/settings/cards/network-dialog.tsx:193— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
TodoComment src/main/index.ts:2195— // TODO Task 22: wire settingsManager.snapshot()?.plugins?.[pluginId] ?? {} — 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 src/main/index.ts:2197— // TODO Plan F: derive from manifest contributes.configuration schema — 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 src/main/platform/appimage-integration.ts:1024— // converges. TODO(follow-up): also reconcile immediately when the setting — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/core/plugin/host/capability-bridge.phase.test.ts:598— // ── 11. TODO: chain failure → no DB write (requires HookOrchestrator T12) ─ — 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 src/core/plugin/host/quick-js-worker.ts:1279— // TODO(Plan G): proper Uint8Array marshaling via QuickJS typed-array API. — 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 src/core/plugin/host/quick-js-worker.ts:1798— // TODO(Plan C): implement streaming reader protocol via opId round-trips. — 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 src/core/plugin/host/quick-js-worker.ts:1822— // TODO(Plan C): bridge will return {opId} once context wiring is done. — 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 src/core/plugin/host/quick-js-worker.ts:1874— // TODO(Plan C): upgrade to AsyncIterable progress if needed. — 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.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×8
Recursive walk over a caller-supplied document has no depth cap src/renderer/lib/form-utils.ts:25— `pickDirty` is exported and takes `dirty: DirtyTree | undefined` from its caller, and it calls itself at line 25 (`pickDirty`) with a piece of `dirty` — and nowhere in `pickDirty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `pickDirty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/renderer/lib/form-utils.ts:18— `pickDirty` is exported, takes a document from its caller (line 6) and hands it to `hasDirty`, which calls itself at line 18 (`hasDirty`) with a piece of `node` — and nowhere in `hasDirty` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `hasDirty` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap REDACTED:66— `jsonSchemaToZod` is exported and takes `node: JsonSchemaNode` from its caller, and it calls itself at line 66 (`jsonSchemaToZod`) with a piece of `node` (and at line 71) — and nowhere in `jsonSchemaToZod` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `jsonSchemaToZod` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/core/session/portable-relocation.ts:39— `relocatePortableValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 39 (`relocatePortableValue`) with a piece of `value` (and at line 44) — and nowhere in `relocatePortableValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `relocatePortableValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/core/session/portable-relocation.ts:99— `portablePayloadPaths` is exported, takes a document from its caller (line 113) and hands it to `mapPayloadPaths`, which calls itself at line 99 (`mapPayloadPaths`) with a piece of `value` (and at line 106) — and nowhere in `mapPayloadPaths` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapPayloadPaths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/core/plugin/post/delivery-materializer.ts:72— `canonicalJson` is exported, takes a document from its caller (line 48) and hands it to `serialize`, which calls itself at line 72 (`serialize`) with a piece of `candidate` (and at line 79) — and nowhere in `serialize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `serialize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/core/plugin/manifest/i18n-resolve.ts:30— `flattenLocaleDict` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 30 (`flattenLocaleDict`) with a piece of `obj` — and nowhere in `flattenLocaleDict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flattenLocaleDict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap src/core/plugin/install/public-command-hash.ts:29— `canonicalize` is exported and takes `value: unknown` from its caller, and it calls itself at line 29 (`canonicalize`) with a piece of `value` (and at line 36) — and nowhere in `canonicalize` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalize` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X2 · Cancellation propagation· Async function without AbortSignal · ×8
Async function without AbortSignal: listenNasClientGateway src/server/platform/nas/client-gateway.ts:15— `listenNasClientGateway` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`.
Async function without AbortSignal: call src/server/platform/fnos/files.ts:31— `call` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`.
Async function without AbortSignal: refreshOperatorSession src/renderer/lib/operator-auth.ts:55— `refreshOperatorSession` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: operatorLogin src/renderer/lib/operator-auth.ts:133— `operatorLogin` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: operatorLogout src/renderer/lib/operator-auth.ts:153— `operatorLogout` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: createTrackerHttpClient src/core/tracker/tracker-http-client.ts:26— `createTrackerHttpClient` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: healthy packaging/synology/app/lifecycle.mjs:273— `healthy` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`.
Async function without AbortSignal: healthy packaging/fnos/app/lifecycle.mjs:113— `healthy` awaits `http.request(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `http.request(url, { signal })`.
motrix_finalize_fs::platform::windows::metadata::directory_names (cognitive 31) packages/finalize-fs/src/platform/windows/metadata.rs:296— motrix_finalize_fs::platform::windows::metadata::directory_names has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 2 (3 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.
motrix_finalize_fs::platform::unix::copy::copy_file_contents (cognitive 22) packages/finalize-fs/src/platform/unix/copy.rs:29— motrix_finalize_fs::platform::unix::copy::copy_file_contents has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 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.
motrix_finalize_fs::platform::unix::remove::remove_directory_snapshot (cognitive 22) packages/finalize-fs/src/platform/unix/remove.rs:160— motrix_finalize_fs::platform::unix::remove::remove_directory_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 1 (2 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.
motrix_finalize_fs::platform::unix::copy::copy_directory_contents (cognitive 21) packages/finalize-fs/src/platform/unix/copy.rs:78— motrix_finalize_fs::platform::unix::copy::copy_directory_contents has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), 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.
motrix_finalize_fs::platform::unix::reserved::reserve_exfat_target (cognitive 20) packages/finalize-fs/src/platform/unix/reserved.rs:146— motrix_finalize_fs::platform::unix::reserved::reserve_exfat_target has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, match/switch 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.
motrix_finalize_fs::platform::unix::remove::isolate_opened_for_removal (cognitive 18) packages/finalize-fs/src/platform/unix/remove.rs:24— motrix_finalize_fs::platform::unix::remove::isolate_opened_for_removal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 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.
motrix_finalize_fs::platform::unix::remove::remove_with_survivor (cognitive 18) packages/finalize-fs/src/platform/unix/remove.rs:302— motrix_finalize_fs::platform::unix::remove::remove_with_survivor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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.
Outbound HTTP without resilience src/core/plugin/install/github-fetcher.ts:90— `fetchImpl(` 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.
Outbound HTTP without resilience src/core/plugin/install/github-fetcher.ts:130— `fetchImpl(` 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.
Outbound HTTP without resilience src/core/plugin/install/url-fetcher.ts:12— `fetchImpl(` 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.
Outbound HTTP without resilience src/core/plugin/registry/registry-fetcher.ts:67— `fetchImpl(` 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.
Outbound HTTP without resilience src/core/session/session-manager.ts:116— `fetcher(` 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.
Outbound HTTP without resilience src/core/tracker/tracker-http-client.ts:22— `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.
Outbound HTTP without resilience src/core/tracker/tracker-http-client.ts:50— `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.
Weak hash algorithm src/core/engine/aria2/aria2-session-identity-recovery.ts:303— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/core/legacy-import/source-scanner.ts:213— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/core/task/bt-file-verifier.ts:235— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/core/torrent/create-torrent.ts:116— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/core/torrent/create-torrent.ts:122— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/core/torrent/create-torrent.ts:187— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Focus outline removed inline src/renderer/components/desktop-kit/inspector-drawer.tsx:160— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/renderer/components/ui/input.tsx:6— <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/renderer/components/ui/native-select.tsx:15— <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/renderer/components/ui/textarea.tsx:6— <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
Focus outline removed inline src/renderer/routes/downloads/task-list-panel.tsx:173— <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
motrix_native_host::probe::read_response_body (cognitive 46) packages/native-host/src/probe.rs:113— motrix_native_host::probe::read_response_body has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 6 (19 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
motrix_native_host::probe::decode_chunked (cognitive 28) packages/native-host/src/probe.rs:246— motrix_native_host::probe::decode_chunked has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (27 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.
motrix_native_host::flatpak_companion::installation::uninstall_companion (cognitive 19) packages/native-host/src/flatpak_companion/installation.rs:208— motrix_native_host::flatpak_companion::installation::uninstall_companion has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 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.
motrix_native_host::flatpak_companion::installation::install_companion (cognitive 18) packages/native-host/src/flatpak_companion/installation.rs:42— motrix_native_host::flatpak_companion::installation::install_companion has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), loops 3 (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.
motrix_native_host::resolve::poll_launched_endpoint (cognitive 17) packages/native-host/src/resolve.rs:152— motrix_native_host::resolve::poll_launched_endpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 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.
AC2 · Forms & labels· <Input> field component without a label · ×3
<Input> field component without a label src/renderer/components/desktop-kit/panel/panel-shell.tsx:79— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Input> field component without a label src/renderer/components/settings-kit/plugin-config-field.tsx:89— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Input> field component without a label src/renderer/routes/trackers/components/tracker-source-combobox.tsx:158— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
motrix_native_host::probe::read_response_body (cyclomatic 22) packages/native-host/src/probe.rs:113— motrix_native_host::probe::read_response_body 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.
motrix_native_host::flatpak_companion::installation::install_companion (cyclomatic 17) packages/native-host/src/flatpak_companion/installation.rs:42— motrix_native_host::flatpak_companion::installation::install_companion 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.
motrix_native_host::flatpak_companion::installation::uninstall_companion (cyclomatic 17) packages/native-host/src/flatpak_companion/installation.rs:208— motrix_native_host::flatpak_companion::installation::uninstall_companion 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.
D10 · Test Quality· Fixed-sleep synchronisation · ×3
Fixed-sleep synchronisation: cancel invokes downloader.cancel during download phase src/core/task/media-task-coordinator.test.ts:1086— This test starts work it did not wait for (`startPromise`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 10))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: getActiveSegmentGids returns the running downloaders active gids src/core/task/media-task-coordinator.test.ts:1476— This test starts work it did not wait for (`startPromise`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 10))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: http.get outside the manifest hostPermissions fails with host_not_permitted src/core/plugin/host/capability-bridge.dispatch.test.ts:355— This test starts work it did not wait for (`scoped`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 5))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Duplicated block (8 lines × 2) packages/finalize-fs/src/platform/unix/copy.rs:101— packages/finalize-fs/src/platform/unix/copy.rs:101-108 | packages/finalize-fs/src/platform/unix/copy.rs:189-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/finalize-fs/src/platform/unix/copy.rs:101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) packages/finalize-fs/src/platform/unix/copy.rs:189— packages/finalize-fs/src/platform/unix/copy.rs:189-196 | packages/finalize-fs/src/platform/unix/operations.rs:31-38 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `packages/finalize-fs/src/platform/unix/copy.rs:189` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) packages/finalize-fs/src/platform/unix/rename.rs:121— packages/finalize-fs/src/platform/unix/rename.rs:121-128 | packages/finalize-fs/src/platform/unsupported.rs:41-48 — 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 `packages/finalize-fs/src/platform/unix/rename.rs:121` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Fake-async — async method never awaits src/core/plugin/capabilities/metadata.ts:164— `has` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/core/plugin/capabilities/metadata.ts:215— `set` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/core/plugin/host/capability-bridge.ts:1778— `handleStaged` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×3
Guard cannot change the result — returns what the code already falls through to src/core/torrent/magnet-tracker.ts:1687— The guard above `return true;` also returns `true`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to src/main/bridge/native-messaging-installer.ts:516— The guard above `return null;` also returns `null`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to src/renderer/lib/transport/http-ws.ts:51— The guard above `return 'query';` also returns `'query'`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Boundary violation [package:test-suite-dependency] scripts/profile-task-inspector-activity.mts:24— scripts/profile-task-inspector-activity.mts:24 imports src/test-utils/task.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:third-party-deep-import] src/renderer/routes/plugins/lib/call-graph-engine.ts:2— src/renderer/routes/plugins/lib/call-graph-engine.ts:2 imports elkjs/lib/elk-api.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] src/renderer/routes/plugins/lib/call-graph-engine.ts:3— src/renderer/routes/plugins/lib/call-graph-engine.ts:3 imports elkjs/lib/elk-worker.min.js?worker, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
AC2 · Forms & labels· <Select> field component without a label · ×2
<Select> field component without a label src/renderer/components/settings-kit/plugin-config-field.tsx:39— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label src/renderer/routes/settings/cards/integration/trusted-extensions-section.tsx:243— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
index.main::startServer (cyclomatic 32) src/server/index.ts:1671— index.main::startServer has cyclomatic complexity 32 (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 shape REPEATS in the file: 2 other methods here (index.main, index.main::handlePolledTasks) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
index.main::handlePolledTasks (cyclomatic 17) src/server/index.ts:1115— index.main::handlePolledTasks 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: 2 other methods here (index.main, index.main::startServer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
index.main::startServer (cognitive 36) src/server/index.ts:1671— index.main::startServer has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (22 pts), error handling 6 (7 pts), boolean chains 6, ternaries 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. This shape REPEATS in the file: 2 other methods here (index.main, index.main::handlePolledTasks) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
index.main::handlePolledTasks (cognitive 35) src/server/index.ts:1115— index.main::handlePolledTasks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 1, 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. This shape REPEATS in the file: 2 other methods here (index.main, index.main::startServer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
Duplicated block (11 lines × 2) packages/finalize-fs/src/platform/unix/copy.rs:86— packages/finalize-fs/src/platform/unix/copy.rs:86-96 | packages/finalize-fs/src/platform/unix/copy.rs:98-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `packages/finalize-fs/src/platform/unix/copy.rs:96` calls `from_raw_fd`, `ensure_same_entry`, `as_raw_fd` and `packages/finalize-fs/src/platform/unix/copy.rs:85` 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 (11 lines × 2) packages/finalize-fs/src/platform/unix/copy.rs:91— packages/finalize-fs/src/platform/unix/copy.rs:91-101 | packages/finalize-fs/src/platform/unix/copy.rs: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 `packages/finalize-fs/src/platform/unix/copy.rs:91` it begins part-way through the construct above it, so those exact lines 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) packages/native-host/src/flatpak_companion/secure_fs.rs:194— packages/native-host/src/flatpak_companion/secure_fs.rs:194-203 | packages/native-host/src/flatpak_companion/secure_fs.rs:233-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.
Duplicated block (10 lines × 2) packages/native-host/src/flatpak_companion/secure_fs.rs:99— packages/native-host/src/flatpak_companion/secure_fs.rs:99-108 | packages/native-host/src/flatpak_companion/secure_fs.rs:301-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/native-host/src/flatpak_companion/secure_fs.rs: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 (9 lines × 2) packages/finalize-fs/src/state.rs:82— packages/finalize-fs/src/state.rs:82-90 | packages/finalize-fs/src/state.rs:205-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/finalize-fs/src/state.rs:82` 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) packages/native-host/src/flatpak_companion/secure_fs.rs:206— packages/native-host/src/flatpak_companion/secure_fs.rs:206-214 | packages/native-host/src/flatpak_companion/secure_fs.rs:248-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/native-host/src/flatpak_companion/secure_fs.rs:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Dead file (~113 LoC) src/renderer/components/desktop-kit/sidebar/nav-user.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~113 LoC) src/renderer/components/ui/table.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative src/renderer/components/desktop-kit/cubic-glass/cubic-glass-gradient.tsx:125— A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC2 · Forms & labels· <PasswordInput> field component without a label · ×1
<PasswordInput> field component without a label src/renderer/components/settings-kit/plugin-config-field.tsx:64— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <NumberInput> field component without a label · ×1
<NumberInput> field component without a label src/renderer/components/settings-kit/plugin-config-field.tsx:78— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <Slider> field component without a label · ×1
<Slider> field component without a label src/renderer/routes/downloads/inspector/lifetime-transfer-card.tsx:600— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <Textarea> field component without a label · ×1
<Textarea> field component without a label src/renderer/routes/downloads/inspector/trackers-tab.tsx:457— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <InputGroupTextarea> field component without a label · ×1
<InputGroupTextarea> field component without a label src/renderer/routes/plugins/components/plugin-input-group.tsx:135— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <ComboboxChipsInput> field component without a label · ×1
<ComboboxChipsInput> field component without a label src/renderer/routes/trackers/components/tracker-source-combobox.tsx:107— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <OnboardingLanguageSelect> field component without a label · ×1
<OnboardingLanguageSelect> field component without a label src/renderer/windows/onboarding-window.tsx:17— This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×1
Animation without a prefers-reduced-motion guard src/renderer/styles/globals.css:543— `.drawer-slide-in` moves (`animation: drawer-slide-in-from-bottom 300ms cubic-bezier(0.32, 0.72, 0, 1)
both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
commands.buildCommandHandlers (cyclomatic 184) src/main/ipc/commands.ts:314— commands.buildCommandHandlers has cyclomatic complexity 184 (threshold 15). Most of this is not in the body itself: 5 of the 184 points are its own statements and the rest belongs to 39 function items inside it that branch (a function literal at line 1230, a function literal at line 966, a function literal at line 1752, …). 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.
legacy-import-dialog.LegacyImportDialogContent (cyclomatic 152) src/renderer/features/legacy-import/legacy-import-dialog.tsx:122— legacy-import-dialog.LegacyImportDialogContent has cyclomatic complexity 152 (threshold 15). Of this number, 45 points are the body's own statements and 107 belong to 35 function items inside it that branch. 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.
create-task-handler.handleCreateTaskUnderAdmission (cyclomatic 147) src/core/task/create-task-handler.ts:393— create-task-handler.handleCreateTaskUnderAdmission has cyclomatic complexity 147 (threshold 15). Of this number, 124 points are the body's own statements and 23 belong to 6 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.
activity-calendar.ActivityCalendar (cyclomatic 139) src/renderer/routes/dashboard/activity/activity-calendar.tsx:264— activity-calendar.ActivityCalendar has cyclomatic complexity 139 (threshold 15). Of this number, 39 points are the body's own statements and 100 belong to 27 function literals inside it that branch. 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.
operation-form.OperationFormContent (cyclomatic 130) src/renderer/features/plugin-operations/operation-form.tsx:103— operation-form.OperationFormContent has cyclomatic complexity 130 (threshold 15). Of this number, 50 points are the body's own statements and 80 belong to 17 function items inside it that branch. 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.
add-task-form.AddTaskForm (cyclomatic 123) src/renderer/components/add-task/add-task-form.tsx:153— add-task-form.AddTaskForm has cyclomatic complexity 123 (threshold 15). Of this number, 17 points are the body's own statements and 106 belong to 22 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.
index.initializeMainProcess (cyclomatic 104) src/main/index.ts:1662— index.initializeMainProcess has cyclomatic complexity 104 (threshold 15). Of this number, 55 points are the body's own statements and 49 belong to 37 function items inside it that branch. 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.
engine-diagnostics-dialog.EngineDiagnosticsDialogHost (cyclomatic 101) src/renderer/features/engine-diagnostics/engine-diagnostics-dialog.tsx:140— engine-diagnostics-dialog.EngineDiagnosticsDialogHost has cyclomatic complexity 101 (threshold 15). Of this number, 81 points are the body's own statements and 20 belong to 7 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.
web-directory-picker-dialog.PickerSession::keyDown (cyclomatic 94) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:304— web-directory-picker-dialog.PickerSession::keyDown has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent 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 (web-directory-picker-dialog.PickerSession) 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.
media-tools-section.MediaToolsSection (cyclomatic 92) src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76— media-tools-section.MediaToolsSection has cyclomatic complexity 92 (threshold 15). Of this number, 62 points are the body's own statements and 30 belong to 10 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.
commands.buildServerCommandHandlers (cyclomatic 90) src/server/ipc/commands.ts:224— commands.buildServerCommandHandlers has cyclomatic complexity 90 (threshold 15). Most of this is not in the body itself: 5 of the 90 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 571, a function literal at line 932, a function literal at line 1105, …). 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.
MediaTaskCoordinator.run (cyclomatic 78) src/core/task/media-task-coordinator.ts:237— MediaTaskCoordinator.run has cyclomatic complexity 78 (threshold 15). Of this number, 46 points are the body's own statements and 32 belong to 15 function items inside it that branch. 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.
SessionManager.restore (cyclomatic 76) src/core/session/session-manager.ts:793— SessionManager.restore has cyclomatic complexity 76 (threshold 15). Of this number, 73 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.
directory-picker.DirectoryPicker (cyclomatic 73) src/renderer/components/desktop-kit/directory-picker.tsx:56— directory-picker.DirectoryPicker has cyclomatic complexity 73 (threshold 15). Of this number, 43 points are the body's own statements and 30 belong to 7 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.
dashboard-grid.DashboardGrid (cyclomatic 71) src/renderer/routes/dashboard/components/dashboard-grid.tsx:849— dashboard-grid.DashboardGrid has cyclomatic complexity 71 (threshold 15). Most of this is not in the body itself: 11 of the 71 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 1041, 1225, 1162, …). 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.
trackers-tab.TrackersTab (cyclomatic 70) src/renderer/routes/downloads/inspector/trackers-tab.tsx:42— trackers-tab.TrackersTab has cyclomatic complexity 70 (threshold 15). Of this number, 19 points are the body's own statements and 51 belong to 13 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.
plugin-call-graph.PluginCallGraph (cyclomatic 70) src/renderer/routes/plugins/components/call-graph/plugin-call-graph.tsx:221— plugin-call-graph.PluginCallGraph has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 7 of the 70 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 525, 279, 305, …). 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.
bt-file-verifier.verifyBtFiles (cyclomatic 69) src/core/task/bt-file-verifier.ts:22— bt-file-verifier.verifyBtFiles has cyclomatic complexity 69 (threshold 15). Of this number, 28 points are the body's own statements and 41 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.
source-scanner.scanLegacySource (cyclomatic 65) src/core/legacy-import/source-scanner.ts:288— source-scanner.scanLegacySource has cyclomatic complexity 65 (threshold 15). Of this number, 63 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lifetime-transfer-card.LifetimeTransferCard (cyclomatic 65) src/renderer/routes/downloads/inspector/lifetime-transfer-card.tsx:58— lifetime-transfer-card.LifetimeTransferCard has cyclomatic complexity 65 (threshold 15). Of this number, 21 points are the body's own statements and 44 belong to 19 function items inside it that branch. 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.
web-menu-button.WebMenuButton (cyclomatic 63) src/renderer/features/application-menu/web-menu-button.tsx:72— web-menu-button.WebMenuButton has cyclomatic complexity 63 (threshold 15). Most of this is not in the body itself: 5 of the 63 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 195, renderItems, a function literal at line 295, …). 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.
State::dispatch (cyclomatic 63) packages/finalize-fs/src/state.rs:32— State::dispatch has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
system-protocols-section.SystemProtocolsSection (cyclomatic 62) src/renderer/routes/settings/cards/integration/system-protocols-section.tsx:63— system-protocols-section.SystemProtocolsSection has cyclomatic complexity 62 (threshold 15). Of this number, 42 points are the body's own statements and 20 belong to 6 function items inside it that branch. 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.
FinalizeRecovery.recover (cyclomatic 61) src/core/plugin/finalize/finalize-recovery.ts:81— FinalizeRecovery.recover has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
create-torrent-form.CreateTorrentForm (cyclomatic 61) src/renderer/components/create-torrent/create-torrent-form.tsx:70— create-torrent-form.CreateTorrentForm has cyclomatic complexity 61 (threshold 15). Of this number, 32 points are the body's own statements and 29 belong to 9 function items inside it that branch. 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.
task-list-panel.TaskListPanel (cyclomatic 60) src/renderer/routes/downloads/task-list-panel.tsx:38— task-list-panel.TaskListPanel has cyclomatic complexity 60 (threshold 15). Most of this is not in the body itself: 6 of the 60 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 248, 187, 285, …). 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.
Aria2Adapter.addTorrent (cyclomatic 59) src/core/engine/aria2/aria2-adapter.ts:882— Aria2Adapter.addTorrent has cyclomatic complexity 59 (threshold 15). Of this number, 48 points are the body's own statements and 11 belong to 3 function literals inside it that branch. 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.
web-directory-picker-dialog.PickerSession (cyclomatic 59) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135— web-directory-picker-dialog.PickerSession has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent 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 (web-directory-picker-dialog.PickerSession::keyDown) 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.
SessionManager.reAddOrMarkErrorFromPair (cyclomatic 58) src/core/session/session-manager.ts:1692— SessionManager.reAddOrMarkErrorFromPair has cyclomatic complexity 58 (threshold 15). Of this number, 40 points are the body's own statements and 18 belong to 3 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.
BtStorageService.execute (cyclomatic 58) src/core/task/bt-storage-service.ts:154— BtStorageService.execute has cyclomatic complexity 58 (threshold 15). Of this number, 52 points are the body's own statements and 6 belong to 4 function items inside it that branch. 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.
plugin-install-dialog.PluginInstallSession (cyclomatic 57) src/renderer/routes/plugins/plugin-install-dialog.tsx:96— plugin-install-dialog.PluginInstallSession has cyclomatic complexity 57 (threshold 15). Of this number, 32 points are the body's own statements and 25 belong to 9 function items inside it that branch. 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.
nas-auth.registerNasAuth (cyclomatic 57) REDACTED:71— nas-auth.registerNasAuth has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 2 of the 57 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 86, 176, 194, …). 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.
swap-magnet-metadata-for-bt.swapMagnetMetadataForBtUnderMutation (cyclomatic 56) src/core/torrent/swap-magnet-metadata-for-bt.ts:128— swap-magnet-metadata-for-bt.swapMagnetMetadataForBtUnderMutation has cyclomatic complexity 56 (threshold 15). Of this number, 48 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
app.createApp (cyclomatic 56) REDACTED:152— app.createApp has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 11 of the 56 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 274, dispatchCommand, a function literal at line 387, …). 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.
Aria2Adapter.createDownload (cyclomatic 55) src/core/engine/aria2/aria2-adapter.ts:435— Aria2Adapter.createDownload has cyclomatic complexity 55 (threshold 15). Of this number, 54 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.
LegacyHttpActivationService.reconcile (cyclomatic 55) src/core/legacy-import/http-activation-service.ts:790— LegacyHttpActivationService.reconcile 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.
index.main (cyclomatic 54) src/server/index.ts:227— index.main 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. This shape REPEATS in the file: 2 other methods here (index.main::handlePolledTasks, index.main::startServer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
tasks-tile.TaskRow (cyclomatic 53) src/renderer/routes/dashboard/tiles/tasks-tile.tsx:158— tasks-tile.TaskRow has cyclomatic complexity 53 (threshold 15). Of this number, 51 points are the body's own statements and 2 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.
create-selection-store.createSelectionStore (cyclomatic 53) src/renderer/components/desktop-kit/selection/create-selection-store.ts:13— create-selection-store.createSelectionStore has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to one function literal inside it that branches (line 32). 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.
aria2-session-identity-recovery.recoverAria2SessionIdentity (cyclomatic 52) src/core/engine/aria2/aria2-session-identity-recovery.ts:105— aria2-session-identity-recovery.recoverAria2SessionIdentity has cyclomatic complexity 52 (threshold 15). Of this number, 41 points are the body's own statements and 11 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.
use-pair-request-prompts.usePairRequestPrompts (cyclomatic 51) src/renderer/routes/settings/cards/integration/use-pair-request-prompts.tsx:102— use-pair-request-prompts.usePairRequestPrompts has cyclomatic complexity 51 (threshold 15). Most of this is not in the body itself: 1 of the 51 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 202, 373, 156, …). 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.
ReconnectSession.onReconnectResponse (cyclomatic 49) src/core/bridge/mbp1/reconnect-session.ts:206— ReconnectSession.onReconnectResponse has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CompletedTaskStartupGuard.prepare (cyclomatic 49) src/core/engine/aria2/completed-task-startup-guard.ts:165— CompletedTaskStartupGuard.prepare has cyclomatic complexity 49 (threshold 15). Of this number, 18 points are the body's own statements and 31 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.
torrent-creator.registerTorrentCreator (cyclomatic 49) src/server/routes/torrent-creator.ts:47— torrent-creator.registerTorrentCreator has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 1 of the 49 points is its own statement and the rest belongs to 15 function items inside it that branch (readResult, authorize, reap, …). 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.
remove-task.removeTaskUnderMutation (cyclomatic 48) src/core/task/actions/remove-task.ts:100— remove-task.removeTaskUnderMutation has cyclomatic complexity 48 (threshold 15). Of this number, 40 points are the body's own statements and 8 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.
PluginHttpClient.fetch (cyclomatic 47) src/core/plugin/network/plugin-http-client.ts:25— PluginHttpClient.fetch has cyclomatic complexity 47 (threshold 15). Of this number, 42 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.
LegacyBtActivationService.reconcile (cyclomatic 46) src/core/legacy-import/bt-activation-service.ts:491— LegacyBtActivationService.reconcile has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SegmentDownloader.run (cyclomatic 45) src/core/download/segment-downloader.ts:234— SegmentDownloader.run has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 4 of the 45 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 425, a function literal at line 349, a function literal at line 303, …). 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.
bootstrap.bootstrapBridgeForServer (cyclomatic 44) src/server/bridge/bootstrap.ts:157— bootstrap.bootstrapBridgeForServer has cyclomatic complexity 44 (threshold 15). Of this number, 29 points are the body's own statements and 15 belong to 8 function literals inside it that branch. 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.
index.migrate (cyclomatic 44) src/core/session/migrations/index.ts:323— index.migrate has cyclomatic complexity 44 (threshold 15). Of this number, 43 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.
CapabilityBridge.dispatchCall (cyclomatic 44) src/core/plugin/host/capability-bridge.ts:615— CapabilityBridge.dispatchCall has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
create-torrent.torrentCreatorHandlers (cyclomatic 44) src/main/ipc/commands/create-torrent.ts:59— create-torrent.torrentCreatorHandlers has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 145, a function literal at line 88, a function literal at line 106, …). 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.
session-parser.resolveLegacyRequestSettings (cyclomatic 43) src/core/legacy-import/session-parser.ts:96— session-parser.resolveLegacyRequestSettings 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.
url-textarea.UrlTextarea (cyclomatic 43) src/renderer/components/add-task/url-textarea.tsx:54— url-textarea.UrlTextarea has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 8 of the 43 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 151, a function literal at line 89, a function literal at line 225, …). 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.
nas-dialog.NasDialogForm (cyclomatic 42) src/renderer/routes/settings/cards/nas-dialog.tsx:111— nas-dialog.NasDialogForm has cyclomatic complexity 42 (threshold 15). Of this number, 18 points are the body's own statements and 24 belong to 6 function items inside it that branch. 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.
file-routes.registerNasFileRoutes (cyclomatic 42) src/server/platform/nas/file-routes.ts:94— file-routes.registerNasFileRoutes has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 1 of the 42 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 219, a function literal at line 196, output, …). 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.
download-source.analyzeDownloadSource (cyclomatic 42) src/shared/lib/download-source.ts:23— download-source.analyzeDownloadSource 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.
EngineSupervisor.doStart (cyclomatic 41) src/core/engine/engine-supervisor.ts:434— EngineSupervisor.doStart has cyclomatic complexity 41 (threshold 15). Of this number, 39 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.
verified-install.extractVerifiedTar (cyclomatic 41) src/core/ffmpeg/verified-install.ts:620— verified-install.extractVerifiedTar has cyclomatic complexity 41 (threshold 15). Of this number, 35 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.
downloads-page.DownloadsPage (cyclomatic 41) src/renderer/routes/downloads/downloads-page.tsx:112— downloads-page.DownloadsPage has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 230, 316, 217, …). 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.
plugin-detail-page.PluginDetailPage (cyclomatic 41) src/renderer/routes/plugins/plugin-detail-page.tsx:63— plugin-detail-page.PluginDetailPage has cyclomatic complexity 41 (threshold 15). Of this number, 33 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
app-deep-link.parseAppDeepLink (cyclomatic 41) src/shared/lib/app-deep-link.ts:28— app-deep-link.parseAppDeepLink has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OperationService.prepare (cyclomatic 40) src/core/plugin/operations/operation-service.ts:210— OperationService.prepare has cyclomatic complexity 40 (threshold 15). Of this number, 35 points are the body's own statements and 5 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.
DurableFinalizeRuntime.commit (cyclomatic 40) src/core/session/durable-finalize-runtime.ts:83— DurableFinalizeRuntime.commit has cyclomatic complexity 40 (threshold 15). Of this number, 32 points are the body's own statements and 8 belong to 2 function literals inside it that branch. 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.
task-actions-menu.TaskActionsMenu (cyclomatic 40) src/renderer/routes/downloads/task-actions-menu.tsx:106— task-actions-menu.TaskActionsMenu has cyclomatic complexity 40 (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 shape REPEATS in the file: one other method here (task-actions-menu.TaskActionsMenu::handleShortcut) 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.
http-request-context.resolveLegacyHttpRequestContext (cyclomatic 39) src/core/legacy-import/http-request-context.ts:28— http-request-context.resolveLegacyHttpRequestContext has cyclomatic complexity 39 (threshold 15). Of this number, 26 points are the body's own statements and 13 belong to 2 function items inside it that branch. 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.
parse.parseManifest (cyclomatic 39) src/core/plugin/manifest/parse.ts:157— parse.parseManifest has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
use-selectable-list.useSelectableList.onKeyDown (cyclomatic 39) src/renderer/components/desktop-kit/hooks/use-selectable-list.ts:178— use-selectable-list.useSelectableList.onKeyDown has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WebSocketBridgeServer.constructor (cyclomatic 38) src/core/bridge/web-socket-bridge-server.ts:607— WebSocketBridgeServer.constructor has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 744, 667, 828, …). 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.
motrix-menu-button.ElectronMotrixMenuButton (cyclomatic 38) src/renderer/components/window-chrome/motrix-menu-button.tsx:231— motrix-menu-button.ElectronMotrixMenuButton has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 7 of the 38 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 326, a function literal at line 378, a function literal at line 240, …). 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.
legacy-fresh-download.LegacyFreshDownload (cyclomatic 38) src/renderer/features/legacy-import/legacy-fresh-download.tsx:28— legacy-fresh-download.LegacyFreshDownload has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (cancelActivation, activate, prepare, …). 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.
finalize-journal-repository.validateIntents (cyclomatic 37) src/core/session/finalize-journal-repository.ts:487— finalize-journal-repository.validateIntents 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.
plugin-input-group.PluginInputGroup (cyclomatic 37) src/renderer/routes/plugins/components/plugin-input-group.tsx:49— plugin-input-group.PluginInputGroup has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 belong to 4 function items inside it that branch. 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.
verified-install.extractVerifiedFfmpeg (cyclomatic 36) src/core/ffmpeg/verified-install.ts:477— verified-install.extractVerifiedFfmpeg has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 551, 576, 527, …). 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.
HttpCapabilityHost.request (cyclomatic 36) src/core/plugin/capabilities/http.ts:397— HttpCapabilityHost.request has cyclomatic complexity 36 (threshold 15). Of this number, 35 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.
TrackerManager.performSyncAndCurate (cyclomatic 36) src/core/tracker/tracker-manager.ts:301— TrackerManager.performSyncAndCurate has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 325, fetchKind, a function literal at line 439, …). 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.
general-dialog.GeneralDialog (cyclomatic 36) src/renderer/routes/settings/cards/general-dialog.tsx:53— general-dialog.GeneralDialog has cyclomatic complexity 36 (threshold 15). Of this number, 16 points are the body's own statements and 20 belong to 9 function items inside it that branch. 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.
directory-preferences-section.DirectoryPreferencesSection (cyclomatic 36) src/renderer/features/directory-preferences/directory-preferences-section.tsx:74— directory-preferences-section.DirectoryPreferencesSection has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 9 of the 36 points are its own statements and the rest belongs to 5 function items inside it that branch (addFavorite, a function literal at line 160, a function literal at line 104, …). 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.
operation-fields.OperationFields::renderField (cyclomatic 36) src/renderer/features/plugin-operations/operation-fields.tsx:62— operation-fields.OperationFields::renderField 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.
log-redact.redactValue (cyclomatic 36) src/shared/lib/log-redact.ts:666— log-redact.redactValue 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.
PluginHost.doActivate (cyclomatic 35) src/core/plugin/host/plugin-host.ts:458— PluginHost.doActivate has cyclomatic complexity 35 (threshold 15). Of this number, 24 points are the body's own statements and 11 belong to 5 function literals inside it that branch. 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.
CompletedEngineTaskCleanup.complete (cyclomatic 34) src/core/task/completed-engine-task-cleanup.ts:199— CompletedEngineTaskCleanup.complete has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 206, 274). 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.
package-manager.classifyCliInstall (cyclomatic 34) src/main/cli/package-manager.ts:164— package-manager.classifyCliInstall 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.
appearance-dialog.AppearanceDialog (cyclomatic 34) src/renderer/routes/settings/cards/appearance-dialog.tsx:98— appearance-dialog.AppearanceDialog has cyclomatic complexity 34 (threshold 15). Of this number, 18 points are the body's own statements and 16 belong to 10 function literals inside it that branch. 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.
lifecycle (cyclomatic 34) packaging/synology/app/lifecycle.mjs:285— lifecycle has cyclomatic complexity 34 (threshold 15). Of this number, 26 points are the body's own statements and 8 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.
moext-reader.extractLoadedMoext (cyclomatic 33) src/core/plugin/install/moext-reader.ts:240— moext-reader.extractLoadedMoext has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 5 of the 33 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 293, 368, 390, …). 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.
finalize-task.finalizeTaskSerialized (cyclomatic 33) src/core/task/actions/finalize-task.ts:204— finalize-task.finalizeTaskSerialized has cyclomatic complexity 33 (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.
plugin-diagnostics-page.PluginDiagnosticsPage (cyclomatic 33) src/renderer/routes/plugins/plugin-diagnostics-page.tsx:118— plugin-diagnostics-page.PluginDiagnosticsPage has cyclomatic complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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.
tracker-sync-details.TrackerSyncDetails (cyclomatic 33) src/renderer/routes/trackers/components/tracker-sync-details.tsx:35— tracker-sync-details.TrackerSyncDetails has cyclomatic complexity 33 (threshold 15). Of this number, 20 points are the body's own statements and 13 belong to 6 function items inside it that branch. 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.
transfer-tile.TransferTile (cyclomatic 32) src/renderer/routes/dashboard/tiles/transfer-tile.tsx:279— transfer-tile.TransferTile 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.
use-task-actions.useTaskActions.onRetry (cyclomatic 32) src/renderer/routes/downloads/inspector/use-task-actions.ts:373— use-task-actions.useTaskActions.onRetry has cyclomatic complexity 32 (threshold 15). Of this number, 24 points are the body's own statements and 8 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.
network-dialog.NetworkDialog (cyclomatic 32) src/renderer/routes/settings/cards/network-dialog.tsx:96— network-dialog.NetworkDialog has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 12 of the 32 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 135, 119, 121, …). 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.
window-chrome.WindowChrome (cyclomatic 32) src/renderer/components/window-chrome/window-chrome.tsx:157— window-chrome.WindowChrome has cyclomatic complexity 32 (threshold 15). Of this number, 30 points are the body's own statements and 2 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.
marquee-overlay.MarqueeOverlay (cyclomatic 32) src/renderer/components/desktop-kit/marquee-selection/marquee-overlay.tsx:21— marquee-overlay.MarqueeOverlay has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 1 of the 32 points is its own statement and the rest belongs to 11 function literals inside it that branch (lines 133, 78, 164, …). 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.
settings-validation.settingsValidationError.<returned closure> (cyclomatic 32) src/renderer/lib/settings-validation.ts:27— settings-validation.settingsValidationError.<returned closure> 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.
applyPendingSettings (cyclomatic 32) packaging/synology/app/lifecycle.mjs:129— applyPendingSettings has cyclomatic complexity 32 (threshold 15). Of this number, 22 points are the body's own statements and 10 belong to 7 function literals inside it that branch. 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.
task-cookies.prepareAria2TaskCookies (cyclomatic 31) src/core/engine/aria2/task-cookies.ts:24— task-cookies.prepareAria2TaskCookies has cyclomatic complexity 31 (threshold 15). Of this number, 30 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.
EngineSupervisor.diagnose (cyclomatic 31) src/core/engine/engine-supervisor.ts:848— EngineSupervisor.diagnose 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.
LegacyImportService.scanPreview (cyclomatic 31) src/core/legacy-import/import-service.ts:182— LegacyImportService.scanPreview 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.
hls-parser.parseHlsMedia (cyclomatic 31) REDACTED:126— hls-parser.parseHlsMedia 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.
OperationFiles.pick (cyclomatic 31) src/core/plugin/operations/operation-files.ts:99— OperationFiles.pick 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.
RendererSupervisor.tick (cyclomatic 31) src/main/window/renderer-supervisor.ts:428— RendererSupervisor.tick 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.
advanced-dialog.AdvancedDialog (cyclomatic 31) src/renderer/routes/settings/cards/advanced-dialog.tsx:83— advanced-dialog.AdvancedDialog has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 355, 125, 318, …). 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.
use-pending-magnet-selection.usePendingMagnetSelection (cyclomatic 31) src/renderer/components/add-task-dialog/use-pending-magnet-selection.ts:12— use-pending-magnet-selection.usePendingMagnetSelection has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 61, 28, 98, …). 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.
FinalizeRecovery.recoverRenameFile (cyclomatic 30) src/core/plugin/finalize/finalize-recovery.ts:326— FinalizeRecovery.recoverRenameFile has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
quick-js-worker.injectPluginApi (cyclomatic 30) src/core/plugin/host/quick-js-worker.ts:1536— quick-js-worker.injectPluginApi has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 1664, 1593, 1637, …). 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.
PluginInstaller.stage (cyclomatic 30) src/core/plugin/install/plugin-installer.ts:249— PluginInstaller.stage has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.handlePolledTasks (cyclomatic 30) src/main/index.ts:909— index.handlePolledTasks has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 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.
index.startEngineAndRestore (cyclomatic 30) src/main/index.ts:1325— index.startEngineAndRestore has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 6 function literals inside it that branch. 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.
nat-tile.ElectronNatTile (cyclomatic 30) src/renderer/routes/dashboard/tiles/nat-tile.tsx:38— nat-tile.ElectronNatTile 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.
ServerDirectoryService.list (cyclomatic 30) src/server/server-directory-service.ts:262— ServerDirectoryService.list has cyclomatic complexity 30 (threshold 15). Of this number, 27 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.
startAccountAuthority (cyclomatic 30) packaging/fnos/cmd/account-authority.mjs:226— startAccountAuthority has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 20 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.
verified-install.installVerifiedFfmpeg (cyclomatic 29) src/core/ffmpeg/verified-install.ts:978— verified-install.installVerifiedFfmpeg has cyclomatic complexity 29 (threshold 15). Of this number, 28 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.
FinalizeRecovery.recoverReserved (cyclomatic 29) src/core/plugin/finalize/finalize-recovery.ts:454— FinalizeRecovery.recoverReserved has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
FinalizeCommitter.commitPrepared (cyclomatic 29) src/core/plugin/finalize/finalize-committer.ts:276— FinalizeCommitter.commitPrepared 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.
delivery-materializer.materializeCandidate (cyclomatic 29) src/core/plugin/post/delivery-materializer.ts:191— delivery-materializer.materializeCandidate has cyclomatic complexity 29 (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.
re-add-task.buildDirectReAddParams (cyclomatic 29) src/core/task/actions/re-add-task.ts:212— re-add-task.buildDirectReAddParams 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.
ffmpeg-probe-electron.makeElectronFfmpegProbe.<returned closure> (cyclomatic 29) src/main/plugin/ffmpeg-probe-electron.ts:86— ffmpeg-probe-electron.makeElectronFfmpegProbe.<returned closure> 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.
tile-segmented-control.ForwardedTileSegmentedControl (cyclomatic 29) src/renderer/routes/dashboard/components/tile-segmented-control.tsx:35— tile-segmented-control.ForwardedTileSegmentedControl has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, adjacentEnabledValue, requestValueChange, …). 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.
bt-storage-dialog.BtStorageDialog (cyclomatic 29) src/renderer/routes/downloads/bt-storage-dialog.tsx:28— bt-storage-dialog.BtStorageDialog has cyclomatic complexity 29 (threshold 15). Of this number, 24 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
task-inspector-drawer.TaskInspectorDrawer (cyclomatic 29) src/renderer/routes/downloads/task-inspector-drawer.tsx:63— task-inspector-drawer.TaskInspectorDrawer has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 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.
directory-preferences-dialog.OpenDirectoryPreferencesDialog (cyclomatic 29) src/renderer/features/directory-preferences/directory-preferences-dialog.tsx:36— directory-preferences-dialog.OpenDirectoryPreferencesDialog has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (keyDown, save, close, …). 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.
OperationFiles.execution::dispatch (cyclomatic 28) src/core/plugin/operations/operation-files.ts:394— OperationFiles.execution::dispatch 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.
command-runner.createCommandRunner.<returned closure> (cyclomatic 28) src/core/process/command-runner.ts:120— command-runner.createCommandRunner.<returned closure> has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 125, 180, 199, …). 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.
re-add-task.reAddTaskUnderMutation (cyclomatic 28) src/core/task/actions/re-add-task.ts:566— re-add-task.reAddTaskUnderMutation has cyclomatic complexity 28 (threshold 15). Of this number, 27 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.
index.bootstrapBridge (cyclomatic 28) src/main/bridge/index.ts:412— index.bootstrapBridge has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 963, a function literal at line 569, a function literal at line 852, …). 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.
appimage-integration.installSelfIntegration (cyclomatic 28) src/main/platform/appimage-integration.ts:749— appimage-integration.installSelfIntegration has cyclomatic complexity 28 (threshold 15). Of this number, 24 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.
ffmpeg-fetch-electron.fetchFfmpegAsset (cyclomatic 28) src/main/plugin/ffmpeg-fetch-electron.ts:10— ffmpeg-fetch-electron.fetchFfmpegAsset has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 83, 41, 61, …). 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.
speed-sparkline.SpeedSparkline (cyclomatic 28) src/renderer/routes/dashboard/components/speed-sparkline.tsx:38— speed-sparkline.SpeedSparkline has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 50, 118, 62, …). 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.
url-editor.UrlEditor (cyclomatic 28) src/renderer/components/add-task/url-editor.tsx:33— url-editor.UrlEditor has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 3 of the 28 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 60, 94, 97, …). 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.
task-inspector-activity.cloneDataOnlyValue (cyclomatic 28) src/shared/schemas/task-inspector-activity.ts:38— task-inspector-activity.cloneDataOnlyValue 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.
source-scanner.readLegacyFile (cyclomatic 27) src/core/legacy-import/source-scanner.ts:104— source-scanner.readLegacyFile has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs 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.
LegacyBtActivationService.prepare (cyclomatic 27) src/core/legacy-import/bt-activation-service.ts:222— LegacyBtActivationService.prepare has cyclomatic complexity 27 (threshold 15). Of this number, 26 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.
finalize-task.finalizeBtAfterRename (cyclomatic 27) src/core/task/actions/finalize-task.ts:820— finalize-task.finalizeBtAfterRename 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, 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.
desktop-import.registerLegacyImportIpc (cyclomatic 27) src/main/legacy-import/desktop-import.ts:94— desktop-import.registerLegacyImportIpc has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 234, a function literal at line 284, a function literal at line 124, …). 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.
bt-peer-geo-section.BtPeerGeoSection (cyclomatic 27) src/renderer/routes/settings/cards/bt-peer-geo-section.tsx:42— bt-peer-geo-section.BtPeerGeoSection has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 3 function items inside it that branch. 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.
bit-torrent-dialog.BitTorrentDialog (cyclomatic 27) src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:87— bit-torrent-dialog.BitTorrentDialog has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 97, 135, 150, …). 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.
lifecycle (cyclomatic 27) packaging/fnos/app/lifecycle.mjs:125— lifecycle has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 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.
account-authority.accountFromSnapshot (cyclomatic 26) packaging/fnos/cmd/account-authority.mjs:38— account-authority.accountFromSnapshot has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 2 function items inside it that branch. 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.
PluginRegistry.scanInto (cyclomatic 26) src/core/plugin/plugin-registry.ts:503— PluginRegistry.scanInto 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.
task-save-directory.restoreTaskSaveDirectory (cyclomatic 26) src/core/task/task-save-directory.ts:8— task-save-directory.restoreTaskSaveDirectory 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.
SessionManager.mergeTaskFromPair (cyclomatic 26) src/core/session/session-manager.ts:1462— SessionManager.mergeTaskFromPair has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 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.
downloads-more-menu.DownloadsMoreMenu (cyclomatic 26) src/renderer/routes/downloads/downloads-more-menu.tsx:22— downloads-more-menu.DownloadsMoreMenu has cyclomatic complexity 26 (threshold 15). Of this number, 17 points are the body's own statements and 9 belong to 6 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.
task-inspector-action-bar.TaskInspectorActionBar (cyclomatic 26) src/renderer/routes/downloads/inspector/task-inspector-action-bar.tsx:196— task-inspector-action-bar.TaskInspectorActionBar has cyclomatic complexity 26 (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.
speed-limit-section.SpeedLimitSection (cyclomatic 26) src/renderer/routes/settings/cards/speed-limit-section.tsx:121— speed-limit-section.SpeedLimitSection has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (fillFromPeak, a function literal at line 140, a function literal at line 431, …). 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.
cli-tool-section.CliToolSection (cyclomatic 26) src/renderer/routes/settings/cards/integration/cli-tool-section.tsx:153— cli-tool-section.CliToolSection has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
TaskInspectorActivityService.recordSample (cyclomatic 25) src/core/inspector-activity/task-inspector-activity-service.ts:305— TaskInspectorActivityService.recordSample 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.
aria2-legacy-http.requestMatches (cyclomatic 25) src/core/engine/aria2/aria2-legacy-http.ts:88— aria2-legacy-http.requestMatches 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. This is NOT this file's highest cyclomatic complexity: aria2-legacy-http.pinLegacyHttpOptions (cyclomatic 27) 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.
LegacyImportService.runBatches (cyclomatic 25) src/core/legacy-import/import-service.ts:653— LegacyImportService.runBatches has cyclomatic complexity 25 (threshold 15). Of this number, 18 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.
http-cookies.parseSetCookie (cyclomatic 25) src/core/plugin/capabilities/http-cookies.ts:85— http-cookies.parseSetCookie 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.
move-tasks.moveBatch (cyclomatic 25) src/core/task/actions/move-tasks.ts:30— move-tasks.moveBatch has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (move, a function literal at line 37). 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.
CompletedEngineTaskCleanup.observe (cyclomatic 25) src/core/task/completed-engine-task-cleanup.ts:107— CompletedEngineTaskCleanup.observe 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.
desktop-import.prepareFreshDownload (cyclomatic 25) src/main/legacy-import/desktop-import.ts:330— desktop-import.prepareFreshDownload 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.
overview-tab.OverviewTab (cyclomatic 25) src/renderer/routes/downloads/inspector/overview-tab.tsx:157— overview-tab.OverviewTab 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.
import-task-selection.ImportTaskSelection (cyclomatic 25) src/renderer/features/legacy-import/import-task-selection.tsx:47— import-task-selection.ImportTaskSelection has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (renderRow, a function literal at line 74, a function literal at line 150, …). 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.
use-engine-display-status.useEngineDisplayStatus (cyclomatic 25) src/renderer/hooks/use-engine-display-status.ts:53— use-engine-display-status.useEngineDisplayStatus has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 77, 61, 136, …). 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.
operator-auth.registerOperatorAuth (cyclomatic 25) REDACTED:195— operator-auth.registerOperatorAuth has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 232, 286, 317, …). 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.
BootstrapIPCCodec.validateResponse (cyclomatic 25) packages/safari-bootstrap/Sources/SafariNativeIPC/BootstrapIPCCodec.swift:31— BootstrapIPCCodec.validateResponse 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.
SettingsManager.persistUpdate (cyclomatic 24) src/core/settings/settings-manager.ts:600— SettingsManager.persistUpdate 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.
verified-install.download (cyclomatic 24) src/core/ffmpeg/verified-install.ts:386— verified-install.download 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.
FullCrossPluginInvoker.execute (cyclomatic 24) src/core/plugin/commands/cross-plugin-invoker.ts:114— FullCrossPluginInvoker.execute 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.
CapabilityBridge.onMessage (cyclomatic 24) src/core/plugin/host/capability-bridge.ts:493— CapabilityBridge.onMessage has cyclomatic complexity 24 (threshold 15). Of this number, 23 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.
finalize-committer.assertRenameFileJournal (cyclomatic 24) src/core/plugin/finalize/finalize-committer.ts:751— finalize-committer.assertRenameFileJournal has cyclomatic complexity 24 (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.
quick-js-worker.port.on("message") (cyclomatic 24) src/core/plugin/host/quick-js-worker.ts:242— quick-js-worker.port.on("message") 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.
MotrixNatManager.checkDiagnostics (cyclomatic 24) src/main/nat/motrix-nat-manager.ts:45— MotrixNatManager.checkDiagnostics 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.
portable-relocation.blockUnavailablePortableTasks (cyclomatic 24) src/main/platform/portable-relocation.ts:208— portable-relocation.blockUnavailablePortableTasks has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 6 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.
notifications-page.NotificationsPage (cyclomatic 24) src/renderer/routes/notifications/notifications-page.tsx:163— notifications-page.NotificationsPage has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 212, runAction, a function literal at line 284, …). 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.
plugin-call-graph-edge.PluginCallGraphEdge (cyclomatic 24) src/renderer/routes/plugins/components/call-graph/plugin-call-graph-edge.tsx:32— plugin-call-graph-edge.PluginCallGraphEdge has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
appimage-integration-section.AppImageIntegrationSection (cyclomatic 24) src/renderer/routes/settings/cards/integration/appimage-integration-section.tsx:31— appimage-integration-section.AppImageIntegrationSection has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
integration-dialog.IntegrationDialog (cyclomatic 24) src/renderer/routes/settings/cards/integration/integration-dialog.tsx:61— integration-dialog.IntegrationDialog has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 3 function literals inside it that branch. 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.
inspector-drawer.InspectorDrawer (cyclomatic 24) src/renderer/components/desktop-kit/inspector-drawer.tsx:29— inspector-drawer.InspectorDrawer has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 87, a function literal at line 169, selectHeight, …). 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.
NasFileRemover.perform (cyclomatic 24) src/server/platform/nas/file-remover.ts:63— NasFileRemover.perform has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 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.
validators.validateHistoryEventInput (cyclomatic 23) src/core/inspector-activity/validators.ts:159— validators.validateHistoryEventInput 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.
FfmpegService.run (cyclomatic 23) src/core/ffmpeg/ffmpeg-service.ts:81— FfmpegService.run has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function items inside it that branch (acceptLine, a function literal at line 130, a function literal at line 158, …). 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.
session-parser.parseLegacySession::flush (cyclomatic 23) src/core/legacy-import/session-parser.ts:258— session-parser.parseLegacySession::flush 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.
LegacyImportService.authorizeMetadataAdmission (cyclomatic 23) src/core/legacy-import/import-service.ts:303— LegacyImportService.authorizeMetadataAdmission has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (current, unchanged). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
OperationService.run (cyclomatic 23) src/core/plugin/operations/operation-service.ts:624— OperationService.run has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 5 function items inside it that branch. 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.
MagnetTracker.submitUnderAdmission (cyclomatic 23) src/core/torrent/magnet-tracker.ts:438— MagnetTracker.submitUnderAdmission has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 2 function literals inside it that branch. 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.
TaskRecoveryServiceImpl.recover (cyclomatic 23) src/core/task/task-recovery-service.ts:197— TaskRecoveryServiceImpl.recover has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 217, recover). 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.
TrackerSyncer.fetch (cyclomatic 23) src/core/tracker/tracker-syncer.ts:82— TrackerSyncer.fetch has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 95). 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.
compact-limit-input.CompactLimitInput (cyclomatic 23) src/renderer/routes/settings/cards/compact-limit-input.tsx:45— compact-limit-input.CompactLimitInput has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 belong to 4 function items inside it that branch. 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.
toolbar-search.ToolbarSearch (cyclomatic 23) src/renderer/components/desktop-kit/toolbar/toolbar-search.tsx:40— toolbar-search.ToolbarSearch has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 88, a function literal at line 136, collapseIfIdle, …). 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.
semver.compareSemver (cyclomatic 23) src/shared/semver.ts:28— semver.compareSemver 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.
aria2-tuning.recommendFileAllocation (cyclomatic 22) src/core/engine/aria2/aria2-tuning.ts:49— aria2-tuning.recommendFileAllocation 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.
i18n-resolve.walkContributes (cyclomatic 22) src/core/plugin/manifest/i18n-resolve.ts:79— i18n-resolve.walkContributes has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 112, 85, 99). 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.
NativeFinalizeArtifactOperations.prepareFileRename (cyclomatic 22) src/core/plugin/finalize/native-artifact-operations.ts:194— NativeFinalizeArtifactOperations.prepareFileRename has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 4 function items inside it that branch. 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.
PluginInstaller.commit (cyclomatic 22) src/core/plugin/install/plugin-installer.ts:468— PluginInstaller.commit has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 483, 639). 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.
CliToolService.#probe (cyclomatic 22) REDACTED:362— CliToolService.#probe 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.
commands.registerCommandHandlers (cyclomatic 22) src/main/ipc/commands.ts:2026— commands.registerCommandHandlers has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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.
services.createElectronPlatformServices (cyclomatic 22) src/main/platform/services.ts:17— services.createElectronPlatformServices 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.
builtin-update-dialog.BuiltinUpdateDialog (cyclomatic 22) src/renderer/routes/plugins/components/builtin-update-dialog.tsx:32— builtin-update-dialog.BuiltinUpdateDialog has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 49, confirm, cancel, …). 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.
chart.ChartTooltipContent (cyclomatic 22) REDACTED:116— chart.ChartTooltipContent has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 199, 146). 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.
DirectoryPickerController.commitListing (cyclomatic 22) src/renderer/features/web-directory-picker/directory-picker-controller.ts:385— DirectoryPickerController.commitListing has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs 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.
use-transfer-stats.useTransferStats (cyclomatic 22) src/renderer/hooks/use-transfer-stats.ts:58— use-transfer-stats.useTransferStats has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 75, 192, 101, …). 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.
json-schema-to-zod.jsonSchemaToZod (cyclomatic 22) REDACTED:28— json-schema-to-zod.jsonSchemaToZod 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.
HttpWsTransport.connectSocket (cyclomatic 22) src/renderer/lib/transport/http-ws.ts:268— HttpWsTransport.connectSocket has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 334, renew, a function literal at line 328, …). 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.
SynologyTaskFiles.outputIdentity (cyclomatic 22) src/server/platform/synology/task-files.ts:266— SynologyTaskFiles.outputIdentity 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.
remote-extension-config.parsePublicUrl (cyclomatic 21) src/server/bridge/remote-extension-config.ts:186— remote-extension-config.parsePublicUrl 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.
PairSession.onPairHello (cyclomatic 21) src/core/bridge/mbp1/pair-session.ts:417— PairSession.onPairHello 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.
merge-engine-task.mergeEngineTask (cyclomatic 21) src/core/task/merge-engine-task.ts:19— merge-engine-task.mergeEngineTask 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. This is NOT this file's highest cyclomatic complexity: merge-engine-task.hasEngineTaskDelta (cyclomatic 23) 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.
MagnetTracker.retryMetadataUnderMutation (cyclomatic 21) src/core/torrent/magnet-tracker.ts:742— MagnetTracker.retryMetadataUnderMutation 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.
tracker-snapshots.mergeSourceSnapshots (cyclomatic 21) src/core/tracker/tracker-snapshots.ts:8— tracker-snapshots.mergeSourceSnapshots has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
CliToolService.#verifyInstall (cyclomatic 21) REDACTED:497— CliToolService.#verifyInstall 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.
activity-calendar-model.selectActivityGeometry (cyclomatic 21) src/renderer/routes/dashboard/activity/activity-calendar-model.ts:365— activity-calendar-model.selectActivityGeometry 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.
activity-chart-model.buildActivityChartModel (cyclomatic 21) src/renderer/routes/downloads/inspector/activity-chart-model.ts:135— activity-chart-model.buildActivityChartModel 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.
use-directory-preferences-draft.useRevisionedDirectoryDraft.save (cyclomatic 21) src/renderer/features/directory-preferences/use-directory-preferences-draft.ts:237— use-directory-preferences-draft.useRevisionedDirectoryDraft.save 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.
use-polled-query.usePolledQuery (cyclomatic 21) src/renderer/hooks/use-polled-query.ts:58— use-polled-query.usePolledQuery has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 109, 90, 82, …). 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.
server-process-ownership-authority.readExactBinding (cyclomatic 21) src/server/bridge/server-process-ownership-authority.ts:153— server-process-ownership-authority.readExactBinding 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.
plugin-hooks.isBoundedJsonValue (cyclomatic 21) src/shared/schemas/plugin-hooks.ts:78— plugin-hooks.isBoundedJsonValue 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.
remote-extension-config.parseRemoteExtensionConfig (cyclomatic 20) src/server/bridge/remote-extension-config.ts:350— remote-extension-config.parseRemoteExtensionConfig 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.
remote-extension-admission-policy.parseForwarded (cyclomatic 20) src/server/bridge/remote-extension-admission-policy.ts:304— remote-extension-admission-policy.parseForwarded 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.
TaskInspectorActivityService.selectOrdinaryCandidate (cyclomatic 20) src/core/inspector-activity/task-inspector-activity-service.ts:647— TaskInspectorActivityService.selectOrdinaryCandidate 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.
bridge-data-dir-lock.createOwnedFile (cyclomatic 20) src/core/bridge/bridge-data-dir-lock.ts:526— bridge-data-dir-lock.createOwnedFile 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.
extension-identity-resolver.normalizeExtensionIdentity (cyclomatic 20) src/core/bridge/extension-identity-resolver.ts:170— extension-identity-resolver.normalizeExtensionIdentity 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.
Aria2ProcessOutput.emitLine (cyclomatic 20) src/core/engine/aria2/aria2-process-output.ts:109— Aria2ProcessOutput.emitLine 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.
TaskInspectorActivityRuntime.deliverRecoveredAnchor (cyclomatic 20) src/core/inspector-activity/task-inspector-activity-runtime.ts:752— TaskInspectorActivityRuntime.deliverRecoveredAnchor has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 790). 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.
CookieJar.cookieHeader (cyclomatic 20) src/core/plugin/capabilities/http-cookies.ts:292— CookieJar.cookieHeader has cyclomatic complexity 20 (threshold 15). Of this number, 17 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.
PluginRegistry.applyOverlay (cyclomatic 20) src/core/plugin/plugin-registry.ts:639— PluginRegistry.applyOverlay 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.
registry-fetcher.fetchVerifiedPackageBytes (cyclomatic 20) src/core/plugin/registry/registry-fetcher.ts:49— registry-fetcher.fetchVerifiedPackageBytes 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.
aria2-proxy-routing.normalizeProxyUrl (cyclomatic 20) REDACTED:20— aria2-proxy-routing.normalizeProxyUrl 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.
system-proxy.parseProxyEnvironment (cyclomatic 20) REDACTED:58— system-proxy.parseProxyEnvironment 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.
DirectResourceValidatorService.verify (cyclomatic 20) src/core/task/direct-resource-validator.ts:465— DirectResourceValidatorService.verify 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.
MagnetTracker.doCleanupCacheEntry (cyclomatic 20) src/core/torrent/magnet-tracker.ts:1715— MagnetTracker.doCleanupCacheEntry has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
create-torrent.createTorrent (cyclomatic 20) src/core/torrent/create-torrent.ts:102— create-torrent.createTorrent 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.
appimage-native-host.binaryHash (cyclomatic 20) src/main/bridge/appimage-native-host.ts:137— appimage-native-host.binaryHash 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.
task-actions-menu.TaskActionsMenu::handleShortcut (cyclomatic 20) src/renderer/routes/downloads/task-actions-menu.tsx:236— task-actions-menu.TaskActionsMenu::handleShortcut 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 (task-actions-menu.TaskActionsMenu) 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.
task-column-header.TaskColumnHeader (cyclomatic 20) src/renderer/routes/downloads/task-column-header.tsx:39— task-column-header.TaskColumnHeader has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 82, 150, 112, …). 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.
notifications-page.NotificationRow (cyclomatic 20) src/renderer/routes/notifications/notifications-page.tsx:40— notifications-page.NotificationRow 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.
app-update-section.AppUpdateSection (cyclomatic 20) src/renderer/routes/settings/cards/app-update-section.tsx:19— app-update-section.AppUpdateSection 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.
curl.tokenize (cyclomatic 20) src/renderer/components/add-task/url-interpreters/curl.ts:8— curl.tokenize 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.
use-menu-command.useMenuCommand.<returned closure> (cyclomatic 20) src/renderer/features/application-menu/use-menu-command.ts:27— use-menu-command.useMenuCommand.<returned closure> has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
use-task-speed-history.useTaskSpeedHistory (cyclomatic 20) src/renderer/hooks/use-task-speed-history.ts:42— use-task-speed-history.useTaskSpeedHistory has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 97, 61, 74, …). 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.
HttpWsTransport.invoke (cyclomatic 20) src/renderer/lib/transport/http-ws.ts:119— HttpWsTransport.invoke 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.
routes.registerFnosRoutes (cyclomatic 20) src/server/platform/fnos/routes.ts:19— routes.registerFnosRoutes has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 34, 60, 25). 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.
log-redact.redactError (cyclomatic 20) src/shared/lib/log-redact.ts:428— log-redact.redactError 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.
remote-extension-admission-policy.resolveForwardedSource (cyclomatic 19) src/server/bridge/remote-extension-admission-policy.ts:353— remote-extension-admission-policy.resolveForwardedSource 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: remote-extension-admission-policy.normalizeVerifiedOrigin (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.
TaskInspectorActivityStore.applyCheckpoint (cyclomatic 19) src/core/inspector-activity/task-inspector-activity-store.ts:339— TaskInspectorActivityStore.applyCheckpoint 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.
WebSocketBridgeServer.resolveExtensionMbp1Route (cyclomatic 19) src/core/bridge/web-socket-bridge-server.ts:983— WebSocketBridgeServer.resolveExtensionMbp1Route 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.
GeoIPDownloader.download (cyclomatic 19) src/core/geoip/geo-ip-downloader.ts:49— GeoIPDownloader.download has cyclomatic complexity 19 (threshold 15). Of this number, 15 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.
FfmpegCapabilityHost.run (cyclomatic 19) src/core/plugin/capabilities/ffmpeg.ts:299— FfmpegCapabilityHost.run has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (abort, a function literal at line 411, a function literal at line 441, …). 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.
finalize-removal-safety.selectRemovalSurvivor (cyclomatic 19) src/core/plugin/finalize/finalize-removal-safety.ts:23— finalize-removal-safety.selectRemovalSurvivor 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.
NativeFinalizeArtifactOperations.removeIsolated (cyclomatic 19) src/core/plugin/finalize/native-artifact-operations.ts:527— NativeFinalizeArtifactOperations.removeIsolated 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.
aria2-proxy-routing.parseAria2ProxyUrl (cyclomatic 19) REDACTED:120— aria2-proxy-routing.parseAria2ProxyUrl 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.
bt-duplicate-policy.inspectBtDuplicate (cyclomatic 19) src/core/task/bt-duplicate-policy.ts:145— bt-duplicate-policy.inspectBtDuplicate has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
index.syncNativeMessagingManifests (cyclomatic 19) src/main/bridge/index.ts:349— index.syncNativeMessagingManifests 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.
MenuManager.executeApplicationMenuItem (cyclomatic 19) src/main/menu/menu-manager.ts:155— MenuManager.executeApplicationMenuItem 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.
files-tab.FilesTab (cyclomatic 19) src/renderer/routes/downloads/inspector/files-tab.tsx:33— files-tab.FilesTab has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 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.
inline-consent-panel.InlineConsentPanel (cyclomatic 19) src/renderer/routes/plugins/components/inline-consent-panel.tsx:26— inline-consent-panel.InlineConsentPanel has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
proxy-section.ProxySection (cyclomatic 19) src/renderer/routes/settings/cards/proxy-section.tsx:53— proxy-section.ProxySection has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (handleImportFromSystem, a function literal at line 344, a function literal at line 74, …). 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.
sidebar.SidebarProvider (cyclomatic 19) src/renderer/components/ui/sidebar.tsx:53— sidebar.SidebarProvider has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 103, 73, 82, …). 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.
use-transport-mirror.useTransportMirror (cyclomatic 19) src/renderer/hooks/use-transport-mirror.ts:95— use-transport-mirror.useTransportMirror has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 140, 113, 207, …). 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.
file-routes.nasFileRange (cyclomatic 19) src/server/platform/nas/file-routes.ts:22— file-routes.nasFileRange 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.
operator-extension-pairing.runExtensionPairingTerminal (cyclomatic 19) src/server/operator-extension-pairing.ts:112— operator-extension-pairing.runExtensionPairingTerminal has cyclomatic complexity 19 (threshold 15). Of this number, 17 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.
log-redact.limitVerboseValue (cyclomatic 19) src/shared/lib/log-redact.ts:910— log-redact.limitVerboseValue 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.
loadAuthorityKey (cyclomatic 19) packaging/fnos/cmd/account-authority.mjs:163— loadAuthorityKey has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 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.
remote-extension-route-policy.evaluateRemoteExtensionRoute (cyclomatic 18) src/server/bridge/remote-extension-route-policy.ts:129— remote-extension-route-policy.evaluateRemoteExtensionRoute 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.
TaskInspectorActivityService.closeAtExactTerminalTransition (cyclomatic 18) src/core/inspector-activity/task-inspector-activity-service.ts:480— TaskInspectorActivityService.closeAtExactTerminalTransition 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.
LegacyHttpActivationService.sourceContext (cyclomatic 18) src/core/legacy-import/http-activation-service.ts:285— LegacyHttpActivationService.sourceContext 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.
LegacyHttpActivationService.verifyPayload (cyclomatic 18) src/core/legacy-import/http-activation-service.ts:421— LegacyHttpActivationService.verifyPayload has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LegacyHttpActivationService.retainedContentDigest (cyclomatic 18) src/core/legacy-import/http-activation-service.ts:519— LegacyHttpActivationService.retainedContentDigest 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.
LegacyImportService.commitAdmission (cyclomatic 18) src/core/legacy-import/import-service.ts:422— LegacyImportService.commitAdmission has cyclomatic complexity 18 (threshold 15). Of this number, 15 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.
CapabilityBridge.dispatchFfmpeg (cyclomatic 18) src/core/plugin/host/capability-bridge.ts:1440— CapabilityBridge.dispatchFfmpeg has cyclomatic complexity 18 (threshold 15). Of this number, 17 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.
CapabilityBridge.applyHookEffects (cyclomatic 18) src/core/plugin/host/capability-bridge.ts:1696— CapabilityBridge.applyHookEffects has cyclomatic complexity 18 (threshold 15). Of this number, 17 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.
magnet-cleanup-quarantine.isTaskRow (cyclomatic 18) src/core/torrent/magnet-cleanup-quarantine.ts:140— magnet-cleanup-quarantine.isTaskRow 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.
finalize-task.finalizeBt (cyclomatic 18) src/core/task/actions/finalize-task.ts:603— finalize-task.finalizeBt 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.
finalize-task.finalizeBtInPlace (cyclomatic 18) src/core/task/actions/finalize-task.ts:1075— finalize-task.finalizeBtInPlace 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.
MagnetTracker.deferCleanup (cyclomatic 18) src/core/torrent/magnet-tracker.ts:1801— MagnetTracker.deferCleanup has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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.
magnet-tracker.isSafeSwapCleanupArtifactPath (cyclomatic 18) src/core/torrent/magnet-tracker.ts:2190— magnet-tracker.isSafeSwapCleanupArtifactPath 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.
CompletionShutdownController.execute (cyclomatic 18) src/core/task/completion-shutdown-controller.ts:202— CompletionShutdownController.execute has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function items inside it that branch. 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.
get-task-files.createGetTaskFilesHandler.getTaskFiles (cyclomatic 18) src/core/task/get-task-files.ts:64— get-task-files.createGetTaskFilesHandler.getTaskFiles 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.
TaskRecoveryServiceImpl.applyAction (cyclomatic 18) src/core/task/task-recovery-service.ts:444— TaskRecoveryServiceImpl.applyAction 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.
TrackerProber.probeUdp (cyclomatic 18) src/core/tracker/tracker-prober.ts:116— TrackerProber.probeUdp has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 150, 130, 125, …). 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.
AppImageNativeHost.install (cyclomatic 18) src/main/bridge/appimage-native-host.ts:282— AppImageNativeHost.install 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.
tasks-tile.TasksTile (cyclomatic 18) src/renderer/routes/dashboard/tiles/tasks-tile.tsx:505— tasks-tile.TasksTile has cyclomatic complexity 18 (threshold 15). Of this number, 17 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.
task-row.TaskRowBase (cyclomatic 18) src/renderer/routes/downloads/task-row.tsx:43— task-row.TaskRowBase has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 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.
drop-zone.DropZone (cyclomatic 18) src/renderer/components/add-task/drop-zone.tsx:16— drop-zone.DropZone has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (selectNasTorrent, a function literal at line 36, a function literal at line 101, …). 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.
file-list.FileList (cyclomatic 18) src/renderer/components/file-list/file-list.tsx:28— file-list.FileList has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 130, toggleSelectAll, toggleFile, …). 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.
use-notification-toasts.useNotificationToasts (cyclomatic 18) src/renderer/hooks/use-notification-toasts.ts:90— use-notification-toasts.useNotificationToasts 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 3 function literals inside it that branch (lines 169, 130, 162). 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.
use-task-files.useTaskFiles (cyclomatic 18) src/renderer/hooks/use-task-files.ts:27— use-task-files.useTaskFiles 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 8 function literals inside it that branch (lines 48, 77, 95, …). 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.
HttpWsTransport.ensureSocket (cyclomatic 18) src/renderer/lib/transport/http-ws.ts:213— HttpWsTransport.ensureSocket has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 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.
log-redact.limitVerboseError (cyclomatic 18) src/shared/lib/log-redact.ts:757— log-redact.limitVerboseError 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.
task-inspector-activity.findTaskSpeedUpdate (cyclomatic 18) src/shared/schemas/task-inspector-activity.ts:379— task-inspector-activity.findTaskSpeedUpdate 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.
runtimeEnvironment (cyclomatic 18) packaging/fnos/app/lifecycle.mjs:20— runtimeEnvironment 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.
authority-lifecycle.main (cyclomatic 17) packaging/fnos/cmd/authority-lifecycle.mjs:319— authority-lifecycle.main 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.
TaskInspectorActivityStore.applyTransition (cyclomatic 17) src/core/inspector-activity/task-inspector-activity-store.ts:505— TaskInspectorActivityStore.applyTransition 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.
HlsDashPipeline.dispatch (cyclomatic 17) src/core/bridge-receiver/pipelines/hls-dash-pipeline.ts:42— HlsDashPipeline.dispatch 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.
BridgeReceiver.dispatchAdapted (cyclomatic 17) src/core/bridge-receiver/bridge-receiver.ts:357— BridgeReceiver.dispatchAdapted 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.
FileExtensionPairingProjectionStore.saveChecked (cyclomatic 17) src/core/bridge/file-extension-pairing-projection-store.ts:179— FileExtensionPairingProjectionStore.saveChecked 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.
Aria2PauseState.reconcile (cyclomatic 17) src/core/engine/aria2/aria2-pause-state.ts:25— Aria2PauseState.reconcile 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.
Aria2ConfigBuilder.buildArgs (cyclomatic 17) REDACTED:177— Aria2ConfigBuilder.buildArgs 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.
verified-release.verifyFfmpegRelease (cyclomatic 17) src/core/ffmpeg/verified-release.ts:33— verified-release.verifyFfmpegRelease 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.
fs-sandbox.resolveDeepInsideSandbox (cyclomatic 17) src/core/plugin/capabilities/fs-sandbox.ts:64— fs-sandbox.resolveDeepInsideSandbox 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.
command-graph.readSnapshot (cyclomatic 17) src/core/plugin/commands/command-graph.ts:130— command-graph.readSnapshot 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.
PluginHost.activate (cyclomatic 17) src/core/plugin/host/plugin-host.ts:310— PluginHost.activate has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
NativeFinalizeArtifactOperations.publishReserved (cyclomatic 17) src/core/plugin/finalize/native-artifact-operations.ts:76— NativeFinalizeArtifactOperations.publishReserved has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, 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.
NativeFinalizeArtifactOperations.removeKnown (cyclomatic 17) src/core/plugin/finalize/native-artifact-operations.ts:632— NativeFinalizeArtifactOperations.removeKnown 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.
DirectRecoveryPlanner.plan (cyclomatic 17) src/core/session/direct-recovery-planner.ts:142— DirectRecoveryPlanner.plan 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.
finalize-journal-repository.transitionAllowed (cyclomatic 17) src/core/session/finalize-journal-repository.ts:566— finalize-journal-repository.transitionAllowed 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.
DirectResourceValidatorService.verifyLegacyContent::verifyRange (cyclomatic 17) src/core/task/direct-resource-validator.ts:590— DirectResourceValidatorService.verifyLegacyContent::verifyRange 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.
direct-resource-validator.redirectRequestUrl (cyclomatic 17) src/core/task/direct-resource-validator.ts:943— direct-resource-validator.redirectRequestUrl 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.
SqlitePostDeliveryRepository.admissionRejection (cyclomatic 17) src/core/session/post-delivery-repository.ts:666— SqlitePostDeliveryRepository.admissionRejection 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.
create-task-handler.createAdmittedTask (cyclomatic 17) src/core/task/create-task-handler.ts:302— create-task-handler.createAdmittedTask 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.
safari-bootstrap-registration.registerSafariBootstrap (cyclomatic 17) src/main/bridge/safari-bootstrap-registration.ts:26— safari-bootstrap-registration.registerSafariBootstrap 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 branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
BridgeManager.stopCurrent (cyclomatic 17) src/main/bridge/bridge-manager.ts:106— BridgeManager.stopCurrent 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.
RendererSupervisor.created (cyclomatic 17) src/main/window/renderer-supervisor.ts:107— RendererSupervisor.created has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 7 function items inside it that branch (onInPageNavigation, onNavigation, onLoadFailure, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
completion-shutdown.setupCompletionShutdown (cyclomatic 17) src/main/platform/completion-shutdown.ts:38— completion-shutdown.setupCompletionShutdown has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 58, 76, 48, …). 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.
engine-tile.EngineTile (cyclomatic 17) src/renderer/routes/dashboard/tiles/engine-tile.tsx:38— engine-tile.EngineTile 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, 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.
use-plugin-install.usePluginInstall.startInstall (cyclomatic 17) src/renderer/routes/plugins/hooks/use-plugin-install.ts:84— use-plugin-install.usePluginInstall.startInstall 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.
trusted-extensions-section.TrustedExtensionsSection (cyclomatic 17) src/renderer/routes/settings/cards/integration/trusted-extensions-section.tsx:87— trusted-extensions-section.TrustedExtensionsSection has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 187, handleAdd, a function literal at line 110, …). 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.
browser-extensions-section.BrowserExtensionsSection (cyclomatic 17) src/renderer/routes/settings/cards/integration/browser-extensions-section.tsx:60— browser-extensions-section.BrowserExtensionsSection has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 136, 65, 176). 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.
add-task-dialog-host.AddTaskDialogHost (cyclomatic 17) src/renderer/components/add-task-dialog/add-task-dialog-host.tsx:33— add-task-dialog-host.AddTaskDialogHost has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 118, 52, 91, …). 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.
DirectoryPickerController.start (cyclomatic 17) src/renderer/features/web-directory-picker/directory-picker-controller.ts:227— DirectoryPickerController.start has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
use-task-inspector-activity.useTaskInspectorActivity (cyclomatic 17) src/renderer/hooks/use-task-inspector-activity.ts:64— use-task-inspector-activity.useTaskInspectorActivity has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 147, 134, 93, …). 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.
nas.synologyFileAction (cyclomatic 17) src/renderer/platform/nas.ts:46— nas.synologyFileAction 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.
match.matchesAccelerator (cyclomatic 17) src/renderer/shortcuts/match.ts:1— match.matchesAccelerator 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.
NasSettingsStore.save (cyclomatic 17) src/server/platform/nas/settings-store.ts:146— NasSettingsStore.save has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (operation). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
settings.synologySettingsHandlers (cyclomatic 17) src/server/platform/synology/settings.ts:52— settings.synologySettingsHandlers has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 98, a function literal at line 85, identity, …). 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.
operator-admin.parseCommand (cyclomatic 17) src/server/operator-admin.ts:271— operator-admin.parseCommand 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.
log-redact.redactExtraEngineOptions (cyclomatic 17) src/shared/lib/log-redact.ts:540— log-redact.redactExtraEngineOptions 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.
motrix_finalize_fs::platform::unix::reserved::reserve_exfat_target (cyclomatic 17) packages/finalize-fs/src/platform/unix/reserved.rs:146— motrix_finalize_fs::platform::unix::reserved::reserve_exfat_target 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.
credential-store.reconcile (cyclomatic 16) src/core/bridge/credential-store.ts:1114— credential-store.reconcile has cyclomatic complexity 16 (threshold 15). Of this number, 15 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.
file-extension-pairing-projection-store.recoverExtensionPairingProjectionWriterLock (cyclomatic 16) src/core/bridge/file-extension-pairing-projection-store.ts:58— file-extension-pairing-projection-store.recoverExtensionPairingProjectionWriterLock has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 63). 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.
WebSocketBridgeServer.adoptAuthenticatedSession (cyclomatic 16) src/core/bridge/web-socket-bridge-server.ts:2317— WebSocketBridgeServer.adoptAuthenticatedSession has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
PluginSecurityService.fetchPolicy::download (cyclomatic 16) src/core/plugin/security/security-service.ts:283— PluginSecurityService.fetchPolicy::download 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.
NativeFinalizeFilesystemAdapter.sendRequest (cyclomatic 16) src/core/plugin/finalize/filesystem-adapter.ts:640— NativeFinalizeFilesystemAdapter.sendRequest has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
OperationFiles.cleanup (cyclomatic 16) src/core/plugin/operations/operation-files.ts:680— OperationFiles.cleanup 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.
FinalizeRecovery.cleanup (cyclomatic 16) src/core/plugin/finalize/finalize-recovery.ts:611— FinalizeRecovery.cleanup 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.
FinalizeRecovery.restorePrepared (cyclomatic 16) src/core/plugin/finalize/finalize-recovery.ts:731— FinalizeRecovery.restorePrepared 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.
FinalizeCommitter.publish (cyclomatic 16) src/core/plugin/finalize/finalize-committer.ts:486— FinalizeCommitter.publish 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.
PostDeliveryScheduler.execute (cyclomatic 16) src/core/plugin/post/delivery-scheduler.ts:281— PostDeliveryScheduler.execute 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.
finalize-journal-repository.parseRecord (cyclomatic 16) src/core/session/finalize-journal-repository.ts:392— finalize-journal-repository.parseRecord 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.
DirectResourceValidatorService.requestFollowingRedirects (cyclomatic 16) src/core/task/direct-resource-validator.ts:730— DirectResourceValidatorService.requestFollowingRedirects has cyclomatic complexity 16 (threshold 15). Of this number, 15 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.
MotrixDatabase.commitTerminalHookBoundary (cyclomatic 16) src/core/session/motrix-database.ts:817— MotrixDatabase.commitTerminalHookBoundary has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 823). 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.
MagnetTracker.primeFromDatabase (cyclomatic 16) src/core/torrent/magnet-tracker.ts:238— MagnetTracker.primeFromDatabase 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.
MagnetSelectionTimeout.refresh (cyclomatic 16) src/core/torrent/magnet-selection-timeout.ts:95— MagnetSelectionTimeout.refresh has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
TrackerManager.init (cyclomatic 16) src/core/tracker/tracker-manager.ts:164— TrackerManager.init 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
index.makeResolveToMux.<returned closure> (cyclomatic 16) src/main/bridge/index.ts:135— index.makeResolveToMux.<returned closure> has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
package-manager.managerBinDirectory (cyclomatic 16) src/main/cli/package-manager.ts:387— package-manager.managerBinDirectory 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.
WindowManager.recreate (cyclomatic 16) src/main/window/window-manager.ts:238— WindowManager.recreate has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 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.
appimage-integration.inspectSystemIntegration (cyclomatic 16) src/main/platform/appimage-integration.ts:1048— appimage-integration.inspectSystemIntegration 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.
portable-relocation.relocatePortableProfile (cyclomatic 16) src/main/platform/portable-relocation.ts:85— portable-relocation.relocatePortableProfile 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.
tray.setupTray.createTray (cyclomatic 16) src/main/platform/tray.ts:85— tray.setupTray.createTray has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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.
app-layout.AppLayout (cyclomatic 16) src/renderer/layouts/app-layout.tsx:59— app-layout.AppLayout 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, 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.
dashboard-tile-frame.DashboardTileFrame (cyclomatic 16) src/renderer/routes/dashboard/components/dashboard-tile-frame.tsx:92— dashboard-tile-frame.DashboardTileFrame has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 216, 179, 205). 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.
activity-calendar-model.activityMonthLabels (cyclomatic 16) src/renderer/routes/dashboard/activity/activity-calendar-model.ts:560— activity-calendar-model.activityMonthLabels 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. This is NOT this file's highest cyclomatic complexity: activity-calendar-model.moveActivityActiveIndex (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.
use-app-update.useAppUpdate (cyclomatic 16) src/renderer/routes/settings/cards/use-app-update.ts:13— use-app-update.useAppUpdate has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 50, 59, 29, …). 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.
app-update-section.UpdateActionButton (cyclomatic 16) src/renderer/routes/settings/cards/app-update-section.tsx:127— app-update-section.UpdateActionButton 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.
resize-handle.ResizeHandle (cyclomatic 16) src/renderer/components/desktop-kit/resize-handle.tsx:16— resize-handle.ResizeHandle has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 79, 59, 46, …). 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.
operator-unlock-gate.WebGate (cyclomatic 16) src/renderer/components/operator-unlock-gate.tsx:39— operator-unlock-gate.WebGate has cyclomatic complexity 16 (threshold 15). Of this number, 13 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.
operation-form.OperationForm (cyclomatic 16) src/renderer/features/plugin-operations/operation-form.tsx:40— operation-form.OperationForm has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
operator-auth.refreshOperatorSession (cyclomatic 16) src/renderer/lib/operator-auth.ts:55— operator-auth.refreshOperatorSession 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.
prepareApplicationOwnership (cyclomatic 16) packaging/fnos/cmd/authority-lifecycle.mjs:237— prepareApplicationOwnership has cyclomatic complexity 16 (threshold 15). Of this number, 14 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.
commands.buildCommandHandlers (cognitive 253) src/main/ipc/commands.ts:314— commands.buildCommandHandlers has cognitive complexity 253 (threshold 15). Drivers by points: if/else 85 (139 pts), ternaries 26 (53 pts), boolean chains 34, error handling 14 (22 pts), loops 3, match/switch 2 (nesting depth added 89). Most of this is not in the body itself: 4 of the 253 points are its own statements and the rest belongs to 39 function items inside it that branch (a function literal at line 966, a function literal at line 1230, a function literal at line 1823, …). 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.
create-task-handler.handleCreateTaskUnderAdmission (cognitive 200) src/core/task/create-task-handler.ts:393— create-task-handler.handleCreateTaskUnderAdmission has cognitive complexity 200 (threshold 15). Drivers by points: if/else 61 (111 pts), ternaries 36 (76 pts), boolean chains 24, error handling 10 (19 pts), loops 1 (nesting depth added 99). To reduce it, split the body into named stages: move each independent 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 (create-task-handler.handleCreateTaskUnderAdmission::createReservedTask) 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.
legacy-import-dialog.LegacyImportDialogContent (cognitive 152) src/renderer/features/legacy-import/legacy-import-dialog.tsx:122— legacy-import-dialog.LegacyImportDialogContent has cognitive complexity 152 (threshold 15). Drivers by points: if/else 53 (61 pts), boolean chains 53, ternaries 22 (34 pts), error handling 4 (nesting depth added 20). Of this number, 37 points are the body's own statements and 115 belong to 35 function items inside it that branch. 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.
add-task-form.AddTaskForm (cognitive 148) src/renderer/components/add-task/add-task-form.tsx:153— add-task-form.AddTaskForm has cognitive complexity 148 (threshold 15). Drivers by points: if/else 60 (81 pts), boolean chains 30, ternaries 15 (24 pts), error handling 7 (10 pts), loops 2 (3 pts) (nesting depth added 34). Most of this is not in the body itself: 12 of the 148 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 539, 429, 213, …). 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.
commands.buildServerCommandHandlers (cognitive 147) src/server/ipc/commands.ts:224— commands.buildServerCommandHandlers has cognitive complexity 147 (threshold 15). Drivers by points: if/else 45 (83 pts), ternaries 13 (34 pts), boolean chains 17, error handling 6 (12 pts), loops 1 (nesting depth added 65). Most of this is not in the body itself: 4 of the 147 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 571, a function literal at line 932, a function literal at line 1105, …). 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.
SessionManager.restore (cognitive 144) src/core/session/session-manager.ts:793— SessionManager.restore has cognitive complexity 144 (threshold 15). Drivers by points: if/else 43 (112 pts), boolean chains 19, loops 7 (12 pts), ternaries 1 (nesting depth added 74). Of this number, 142 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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.
activity-calendar.ActivityCalendar (cognitive 140) src/renderer/routes/dashboard/activity/activity-calendar.tsx:264— activity-calendar.ActivityCalendar has cognitive complexity 140 (threshold 15). Drivers by points: if/else 56 (62 pts), ternaries 33 (41 pts), boolean chains 37 (nesting depth added 14). Of this number, 41 points are the body's own statements and 99 belong to 27 function literals inside it that branch. 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.
operation-form.OperationFormContent (cognitive 117) src/renderer/features/plugin-operations/operation-form.tsx:103— operation-form.OperationFormContent has cognitive complexity 117 (threshold 15). Drivers by points: if/else 46 (59 pts), boolean chains 46, ternaries 5, error handling 4, loops 2 (3 pts) (nesting depth added 14). Of this number, 36 points are the body's own statements and 81 belong to 17 function items inside it that branch. 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.
web-directory-picker-dialog.PickerSession::keyDown (cognitive 113) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:304— web-directory-picker-dialog.PickerSession::keyDown has cognitive complexity 113 (threshold 15). Drivers by points: if/else 36 (57 pts), boolean chains 29, ternaries 9 (25 pts), loops 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent 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 (web-directory-picker-dialog.PickerSession) 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.
SessionManager.reAddOrMarkErrorFromPair (cognitive 106) src/core/session/session-manager.ts:1692— SessionManager.reAddOrMarkErrorFromPair has cognitive complexity 106 (threshold 15). Drivers by points: ternaries 22 (60 pts), if/else 14 (28 pts), boolean chains 14, error handling 2 (4 pts) (nesting depth added 54). Of this number, 70 points are the body's own statements and 36 belong to 3 function literals inside it that branch. 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.
media-tools-section.MediaToolsSection (cognitive 101) src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76— media-tools-section.MediaToolsSection has cognitive complexity 101 (threshold 15). Drivers by points: ternaries 27 (43 pts), boolean chains 37, if/else 12 (19 pts), error handling 2 (nesting depth added 23). Of this number, 55 points are the body's own statements and 46 belong to 10 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.
engine-diagnostics-dialog.EngineDiagnosticsDialogHost (cognitive 100) src/renderer/features/engine-diagnostics/engine-diagnostics-dialog.tsx:140— engine-diagnostics-dialog.EngineDiagnosticsDialogHost has cognitive complexity 100 (threshold 15). Drivers by points: ternaries 31 (59 pts), boolean chains 31, if/else 7 (8 pts), error handling 2 (nesting depth added 29). Of this number, 75 points are the body's own statements and 25 belong to 7 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.
bt-file-verifier.verifyBtFiles (cognitive 97) src/core/task/bt-file-verifier.ts:22— bt-file-verifier.verifyBtFiles has cognitive complexity 97 (threshold 15). Drivers by points: if/else 35 (63 pts), boolean chains 15, loops 8 (13 pts), error handling 2 (3 pts), ternaries 3 (nesting depth added 34). Of this number, 38 points are the body's own statements and 59 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.
index.initializeMainProcess (cognitive 96) src/main/index.ts:1662— index.initializeMainProcess has cognitive complexity 96 (threshold 15). Drivers by points: if/else 56 (63 pts), boolean chains 20, ternaries 8 (10 pts), error handling 2 (3 pts) (nesting depth added 10). Of this number, 58 points are the body's own statements and 38 belong to 37 function items inside it that branch. 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.
remove-task.removeTaskUnderMutation (cognitive 94) src/core/task/actions/remove-task.ts:100— remove-task.removeTaskUnderMutation has cognitive complexity 94 (threshold 15). Drivers by points: if/else 30 (62 pts), boolean chains 10, error handling 3 (10 pts), ternaries 4 (9 pts), loops 1 (3 pts) (nesting depth added 46). Of this number, 75 points are the body's own statements and 19 belong to 4 function items inside it that branch. 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.
source-scanner.scanLegacySource (cognitive 91) src/core/legacy-import/source-scanner.ts:288— source-scanner.scanLegacySource has cognitive complexity 91 (threshold 15). Drivers by points: if/else 23 (55 pts), boolean chains 20, ternaries 5 (11 pts), loops 3, error handling 1 (2 pts) (nesting depth added 39). Of this number, 90 points are the body's own statements and 1 belongs 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.
transfer-tile.TransferTile (cognitive 91) src/renderer/routes/dashboard/tiles/transfer-tile.tsx:279— transfer-tile.TransferTile has cognitive complexity 91 (threshold 15). Drivers by points: ternaries 22 (80 pts), boolean chains 6, if/else 4 (5 pts) (nesting depth added 59). 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.
aria2-session-identity-recovery.recoverAria2SessionIdentity (cognitive 86) src/core/engine/aria2/aria2-session-identity-recovery.ts:105— aria2-session-identity-recovery.recoverAria2SessionIdentity has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (47 pts), loops 8 (12 pts), ternaries 6 (10 pts), boolean chains 9, error handling 4 (8 pts) (nesting depth added 35). Of this number, 72 points are the body's own statements and 14 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.
MediaTaskCoordinator.run (cognitive 86) src/core/task/media-task-coordinator.ts:237— MediaTaskCoordinator.run has cognitive complexity 86 (threshold 15). Drivers by points: if/else 37 (47 pts), ternaries 15 (17 pts), boolean chains 16, error handling 4 (5 pts), loops 1 (nesting depth added 13). Of this number, 56 points are the body's own statements and 30 belong to 15 function items inside it that branch. 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.
State::dispatch (cognitive 84) packages/finalize-fs/src/state.rs:32— State::dispatch has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (53 pts), match/switch 14 (28 pts), boolean chains 3 (nesting depth added 40). 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.
index.handlePolledTasks (cognitive 83) src/main/index.ts:909— index.handlePolledTasks has cognitive complexity 83 (threshold 15). Drivers by points: if/else 22 (63 pts), error handling 2 (9 pts), boolean chains 5, ternaries 1 (5 pts), loops 1 (nesting depth added 52). Of this number, 66 points are the body's own statements and 17 belong to 2 function literals inside it that branch. 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.
trackers-tab.TrackersTab (cognitive 81) src/renderer/routes/downloads/inspector/trackers-tab.tsx:42— trackers-tab.TrackersTab has cognitive complexity 81 (threshold 15). Drivers by points: if/else 29 (35 pts), ternaries 12 (24 pts), boolean chains 16, error handling 4, loops 2 (nesting depth added 18). Of this number, 23 points are the body's own statements and 58 belong to 13 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.
FinalizeRecovery.recover (cognitive 77) src/core/plugin/finalize/finalize-recovery.ts:81— FinalizeRecovery.recover has cognitive complexity 77 (threshold 15). Drivers by points: if/else 34 (56 pts), boolean chains 15, ternaries 5 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
swap-magnet-metadata-for-bt.swapMagnetMetadataForBtUnderMutation (cognitive 76) src/core/torrent/swap-magnet-metadata-for-bt.ts:128— swap-magnet-metadata-for-bt.swapMagnetMetadataForBtUnderMutation has cognitive complexity 76 (threshold 15). Drivers by points: error handling 16 (34 pts), if/else 17 (25 pts), boolean chains 9, ternaries 7 (8 pts) (nesting depth added 27). Of this number, 62 points are the body's own statements and 14 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.
dashboard-grid.DashboardGrid (cognitive 76) src/renderer/routes/dashboard/components/dashboard-grid.tsx:849— dashboard-grid.DashboardGrid has cognitive complexity 76 (threshold 15). Drivers by points: if/else 31 (38 pts), ternaries 18 (20 pts), boolean chains 16, error handling 1, loops 1 (nesting depth added 9). Most of this is not in the body itself: 11 of the 76 points are its own statements and the rest belongs to 24 function literals inside it that branch (lines 1041, 1124, 1162, …). 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.
PluginHttpClient.fetch (cognitive 75) src/core/plugin/network/plugin-http-client.ts:25— PluginHttpClient.fetch has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (50 pts), boolean chains 13, ternaries 4 (8 pts), error handling 2 (3 pts), loops 1 (nesting depth added 32). Of this number, 65 points are the body's own statements and 10 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.
session-parser.resolveLegacyRequestSettings (cognitive 72) src/core/legacy-import/session-parser.ts:96— session-parser.resolveLegacyRequestSettings has cognitive complexity 72 (threshold 15). Drivers by points: if/else 21 (50 pts), boolean chains 11, loops 5 (8 pts), ternaries 2 (3 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.
hls-parser.parseHlsMedia (cognitive 72) REDACTED:126— hls-parser.parseHlsMedia has cognitive complexity 72 (threshold 15). Drivers by points: if/else 17 (43 pts), ternaries 8 (23 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyHttpActivationService.reconcile (cognitive 69) src/core/legacy-import/http-activation-service.ts:790— LegacyHttpActivationService.reconcile has cognitive complexity 69 (threshold 15). Drivers by points: if/else 30 (51 pts), boolean chains 15, error handling 1 (3 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.
create-selection-store.createSelectionStore (cognitive 69) src/renderer/components/desktop-kit/selection/create-selection-store.ts:13— create-selection-store.createSelectionStore has cognitive complexity 69 (threshold 15). Drivers by points: if/else 36 (48 pts), loops 7 (9 pts), ternaries 7, boolean chains 5 (nesting depth added 14). None of this is in the body itself: all 69 points belong to one function literal inside it that branches (line 32). 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.
CompletedTaskStartupGuard.prepare (cognitive 66) src/core/engine/aria2/completed-task-startup-guard.ts:165— CompletedTaskStartupGuard.prepare has cognitive complexity 66 (threshold 15). Drivers by points: if/else 21 (40 pts), boolean chains 12, error handling 4 (8 pts), ternaries 4, loops 2 (nesting depth added 23). Most of this is not in the body itself: 14 of the 66 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 239, 202, 232, …). 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.
HttpCapabilityHost.request (cognitive 66) src/core/plugin/capabilities/http.ts:397— HttpCapabilityHost.request has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (41 pts), ternaries 4 (13 pts), boolean chains 6, error handling 2 (4 pts), loops 2 (nesting depth added 32). Of this number, 65 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.
operation-fields.OperationFields::renderField (cognitive 66) src/renderer/features/plugin-operations/operation-fields.tsx:62— operation-fields.OperationFields::renderField has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 12 (46 pts), boolean chains 17, if/else 3 (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.
web-menu-button.WebMenuButton (cognitive 65) src/renderer/features/application-menu/web-menu-button.tsx:72— web-menu-button.WebMenuButton has cognitive complexity 65 (threshold 15). Drivers by points: if/else 33 (39 pts), boolean chains 14, ternaries 6 (8 pts), error handling 1 (2 pts), loops 2 (nesting depth added 9). Most of this is not in the body itself: 4 of the 65 points are its own statements and the rest belongs to 23 function items inside it that branch (renderItems, a function literal at line 438, a function literal at line 295, …). 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.
plugin-call-graph.PluginCallGraph (cognitive 64) src/renderer/routes/plugins/components/call-graph/plugin-call-graph.tsx:221— plugin-call-graph.PluginCallGraph has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 29, if/else 25 (29 pts), ternaries 4, loops 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 4 of the 64 points are its own statements and the rest belongs to 22 function literals inside it that branch (lines 525, 279, 305, …). 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.
Aria2Adapter.createDownload (cognitive 63) src/core/engine/aria2/aria2-adapter.ts:435— Aria2Adapter.createDownload has cognitive complexity 63 (threshold 15). Drivers by points: if/else 36 (46 pts), boolean chains 14, loops 1 (2 pts), ternaries 1 (nesting depth added 11). Of this number, 62 points are the body's own statements and 1 belongs 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.
nas-auth.registerNasAuth (cognitive 59) REDACTED:71— nas-auth.registerNasAuth has cognitive complexity 59 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 14, ternaries 8 (14 pts), loops 1 (nesting depth added 14). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 86, 176, 194, …). 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.
index.main (cognitive 59) src/server/index.ts:227— index.main has cognitive complexity 59 (threshold 15). Drivers by points: if/else 80 (103 pts), ternaries 28 (33 pts), boolean chains 28, error handling 10 (13 pts), loops 1 (nesting depth added 31). 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. This shape REPEATS in the file: 2 other methods here (index.main::handlePolledTasks, index.main::startServer) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
parse.parseManifest (cognitive 58) src/core/plugin/manifest/parse.ts:157— parse.parseManifest has cognitive complexity 58 (threshold 15). Drivers by points: if/else 20 (40 pts), boolean chains 8, loops 5 (8 pts), error handling 1, ternaries 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BtStorageService.execute (cognitive 58) src/core/task/bt-storage-service.ts:154— BtStorageService.execute has cognitive complexity 58 (threshold 15). Drivers by points: if/else 31 (35 pts), boolean chains 12, error handling 5 (7 pts), ternaries 3, loops 1 (nesting depth added 6). Of this number, 51 points are the body's own statements and 7 belong to 4 function items inside it that branch. 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.
tasks-tile.TaskRow (cognitive 56) src/renderer/routes/dashboard/tiles/tasks-tile.tsx:158— tasks-tile.TaskRow has cognitive complexity 56 (threshold 15). Drivers by points: ternaries 18 (33 pts), boolean chains 15, if/else 6, match/switch 1 (2 pts) (nesting depth added 16). Of this number, 54 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.
create-torrent-form.CreateTorrentForm (cognitive 56) src/renderer/components/create-torrent/create-torrent-form.tsx:70— create-torrent-form.CreateTorrentForm has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 21, ternaries 14 (18 pts), if/else 12 (14 pts), error handling 3 (nesting depth added 6). Of this number, 26 points are the body's own statements and 30 belong to 9 function items inside it that branch. 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.
SegmentDownloader.run (cognitive 55) src/core/download/segment-downloader.ts:234— SegmentDownloader.run has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (34 pts), ternaries 5 (8 pts), loops 6 (7 pts), boolean chains 5, error handling 1 (nesting depth added 14). Most of this is not in the body itself: 3 of the 55 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 425, a function literal at line 303, a function literal at line 323, …). 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.
EngineSupervisor.doStart (cognitive 54) src/core/engine/engine-supervisor.ts:434— EngineSupervisor.doStart has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (32 pts), ternaries 3 (9 pts), error handling 4 (7 pts), boolean chains 6 (nesting depth added 16). Of this number, 51 points are the body's own statements and 3 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.
use-selectable-list.useSelectableList.onKeyDown (cognitive 53) src/renderer/components/desktop-kit/hooks/use-selectable-list.ts:178— use-selectable-list.useSelectableList.onKeyDown has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 10, ternaries 3 (9 pts), loops 1 (3 pts), match/switch 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.
app.createApp (cognitive 53) REDACTED:152— app.createApp has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (26 pts), ternaries 9 (15 pts), boolean chains 10, error handling 2 (nesting depth added 11). Most of this is not in the body itself: 14 of the 53 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 274, dispatchCommand, a function literal at line 387, …). 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.
Aria2Adapter.addTorrent (cognitive 52) src/core/engine/aria2/aria2-adapter.ts:882— Aria2Adapter.addTorrent has cognitive complexity 52 (threshold 15). Drivers by points: if/else 29 (39 pts), boolean chains 10, loops 1 (2 pts), 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.
lifetime-transfer-card.LifetimeTransferCard (cognitive 52) src/renderer/routes/downloads/inspector/lifetime-transfer-card.tsx:58— lifetime-transfer-card.LifetimeTransferCard has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 25, ternaries 14 (15 pts), if/else 11 (12 pts) (nesting depth added 2). Most of this is not in the body itself: 15 of the 52 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 161, a function literal at line 220, a function literal at line 367, …). 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.
plugin-install-dialog.PluginInstallSession (cognitive 52) src/renderer/routes/plugins/plugin-install-dialog.tsx:96— plugin-install-dialog.PluginInstallSession has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 21, ternaries 6 (8 pts) (nesting depth added 5). Of this number, 24 points are the body's own statements and 28 belong to 9 function items inside it that branch. 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.
ReconnectSession.onReconnectResponse (cognitive 51) src/core/bridge/mbp1/reconnect-session.ts:206— ReconnectSession.onReconnectResponse has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 9, error handling 4 (7 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.
verified-install.installVerifiedFfmpeg (cognitive 51) src/core/ffmpeg/verified-install.ts:978— verified-install.installVerifiedFfmpeg has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 5 (20 pts), if/else 13 (19 pts), boolean chains 8, error handling 2, loops 1 (2 pts) (nesting depth added 22). Of this number, 50 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.
verified-install.extractVerifiedTar (cognitive 50) src/core/ffmpeg/verified-install.ts:620— verified-install.extractVerifiedTar has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 8, loops 4 (7 pts) (nesting depth added 23). Of this number, 39 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.
LegacyBtActivationService.reconcile (cognitive 50) src/core/legacy-import/bt-activation-service.ts:491— LegacyBtActivationService.reconcile has cognitive complexity 50 (threshold 15). Drivers by points: if/else 25 (37 pts), boolean chains 12, 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.
RendererSupervisor.tick (cognitive 50) src/main/window/renderer-supervisor.ts:428— RendererSupervisor.tick has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 8, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
web-directory-picker-dialog.PickerSession (cognitive 50) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135— web-directory-picker-dialog.PickerSession has cognitive complexity 50 (threshold 15). Drivers by points: if/else 60 (84 pts), boolean chains 75, ternaries 29 (50 pts), loops 1 (2 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent 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 (web-directory-picker-dialog.PickerSession::keyDown) 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.
LegacyImportService.runBatches (cognitive 49) src/core/legacy-import/import-service.ts:653— LegacyImportService.runBatches has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 7 (14 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 26). Of this number, 34 points are the body's own statements and 15 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.
nat-tile.ElectronNatTile (cognitive 49) src/renderer/routes/dashboard/tiles/nat-tile.tsx:38— nat-tile.ElectronNatTile has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 19 (42 pts), boolean chains 7 (nesting depth added 23). 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.
use-task-actions.useTaskActions.onRetry (cognitive 49) src/renderer/routes/downloads/inspector/use-task-actions.ts:373— use-task-actions.useTaskActions.onRetry has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 11, loops 2 (6 pts), error handling 2 (4 pts), ternaries 2 (nesting depth added 20). Of this number, 41 points are the body's own statements and 8 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.
url-textarea.UrlTextarea (cognitive 49) src/renderer/components/add-task/url-textarea.tsx:54— url-textarea.UrlTextarea has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 9, ternaries 4 (6 pts), loops 2 (3 pts) (nesting depth added 12). Most of this is not in the body itself: 7 of the 49 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 151, a function literal at line 89, a function literal at line 225, …). 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.
use-pair-request-prompts.usePairRequestPrompts (cognitive 49) src/renderer/routes/settings/cards/integration/use-pair-request-prompts.tsx:102— use-pair-request-prompts.usePairRequestPrompts has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (27 pts), boolean chains 9, loops 4 (6 pts), ternaries 3 (4 pts), error handling 3 (nesting depth added 9). None of this is in the body itself: all 49 points belong to 11 function literals inside it that branch (lines 373, 202, 156, …). 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.
bootstrap.bootstrapBridgeForServer (cognitive 46) src/server/bridge/bootstrap.ts:157— bootstrap.bootstrapBridgeForServer has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (21 pts), ternaries 10 (11 pts), boolean chains 9, loops 4, error handling 1 (nesting depth added 5). Of this number, 27 points are the body's own statements and 19 belong to 8 function literals inside it that branch. 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.
WebSocketBridgeServer.constructor (cognitive 46) src/core/bridge/web-socket-bridge-server.ts:607— WebSocketBridgeServer.constructor has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (33 pts), boolean chains 10, ternaries 1 (2 pts), error handling 1 (nesting depth added 9). None of this is in the body itself: all 46 points belong to 6 function literals inside it that branch (lines 744, 667, 828, …). 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.
MagnetTracker.deferCleanup (cognitive 46) src/core/torrent/magnet-tracker.ts:1801— MagnetTracker.deferCleanup has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (30 pts), ternaries 4 (12 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 28). Of this number, 23 points are the body's own statements and 23 belong to 2 function literals inside it that branch. 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.
download-source.analyzeDownloadSource (cognitive 46) src/shared/lib/download-source.ts:23— download-source.analyzeDownloadSource has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 12, ternaries 3 (4 pts), error handling 2 (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.
StaleSchemaError.constructor (cognitive 45) src/core/session/migrations/index.ts:65— StaleSchemaError.constructor has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 9 (45 pts) (nesting depth added 36). 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.
create-torrent.torrentCreatorHandlers (cognitive 45) src/main/ipc/commands/create-torrent.ts:59— create-torrent.torrentCreatorHandlers has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 11, loops 1 (3 pts), ternaries 2, error handling 1 (nesting depth added 10). None of this is in the body itself: all 45 points belong to 6 function items inside it that branch (a function literal at line 145, a function literal at line 106, a function literal at line 88, …). 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.
app-deep-link.parseAppDeepLink (cognitive 45) src/shared/lib/app-deep-link.ts:28— app-deep-link.parseAppDeepLink has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 8 (16 pts), boolean chains 6, error handling 1, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-cookies.prepareAria2TaskCookies (cognitive 44) src/core/engine/aria2/task-cookies.ts:24— task-cookies.prepareAria2TaskCookies has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 6, loops 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PluginRegistry.scanInto (cognitive 44) src/core/plugin/plugin-registry.ts:503— PluginRegistry.scanInto has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (19 pts), ternaries 7 (15 pts), boolean chains 6, error handling 2 (3 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.
CapabilityBridge.dispatchCall (cognitive 44) src/core/plugin/host/capability-bridge.ts:615— CapabilityBridge.dispatchCall has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 4 (14 pts), boolean chains 6, error handling 1, match/switch 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.
torrent-creator.registerTorrentCreator (cognitive 44) src/server/routes/torrent-creator.ts:47— torrent-creator.registerTorrentCreator has cognitive complexity 44 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 11, loops 3, error handling 1 (nesting depth added 2). None of this is in the body itself: all 44 points belong to 15 function items inside it that branch (readResult, authorize, reap, …). 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.
LegacyImportService.scanPreview (cognitive 42) src/core/legacy-import/import-service.ts:182— LegacyImportService.scanPreview has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 5 (8 pts), boolean chains 4, error handling 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.
http-cookies.parseSetCookie (cognitive 42) src/core/plugin/capabilities/http-cookies.ts:85— http-cookies.parseSetCookie has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (29 pts), ternaries 3 (7 pts), boolean chains 4, error handling 1, loops 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.
quick-js-worker.port.on("message") (cognitive 42) src/core/plugin/host/quick-js-worker.ts:242— quick-js-worker.port.on("message") has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 2, match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
nas-dialog.NasDialogForm (cognitive 42) src/renderer/routes/settings/cards/nas-dialog.tsx:111— nas-dialog.NasDialogForm has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 17, ternaries 2 (3 pts), error handling 2 (nesting depth added 5). Most of this is not in the body itself: 15 of the 42 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 131, a function literal at line 190, a function literal at line 229, …). 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.
lifecycle (cognitive 42) packaging/synology/app/lifecycle.mjs:285— lifecycle has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 7, loops 3 (6 pts), error handling 3, ternaries 1 (2 pts) (nesting depth added 11). Of this number, 31 points are the body's own statements and 11 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.
OperationFiles.execution::dispatch (cognitive 41) src/core/plugin/operations/operation-files.ts:394— OperationFiles.execution::dispatch has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (30 pts), boolean chains 7, error handling 1 (2 pts), ternaries 1 (2 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.
log-redact.redactValue (cognitive 41) src/shared/lib/log-redact.ts:666— log-redact.redactValue has cognitive complexity 41 (threshold 15). Drivers by points: if/else 26 (28 pts), boolean chains 5, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 6). 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.migrate (cognitive 40) src/core/session/migrations/index.ts:323— index.migrate has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 9, ternaries 4 (9 pts), loops 1 (nesting depth added 15). Of this number, 39 points are the body's own statements and 1 belongs 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.
OperationService.prepare (cognitive 40) src/core/plugin/operations/operation-service.ts:210— OperationService.prepare has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 9, loops 3 (6 pts), error handling 1, ternaries 1 (nesting depth added 12). Of this number, 37 points are the body's own statements and 3 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.
downloads-page.DownloadsPage (cognitive 40) src/renderer/routes/downloads/downloads-page.tsx:112— downloads-page.DownloadsPage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17, boolean chains 14, ternaries 7 (9 pts) (nesting depth added 2). Most of this is not in the body itself: 9 of the 40 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 230, 316, 119, …). 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.
curl.tokenize (cognitive 40) src/renderer/components/add-task/url-interpreters/curl.ts:8— curl.tokenize has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 3, 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.
ServerDirectoryService.list (cognitive 40) src/server/server-directory-service.ts:262— ServerDirectoryService.list has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 9, ternaries 5 (7 pts), error handling 3 (5 pts), loops 1 (nesting depth added 14). Of this number, 39 points are the body's own statements and 1 belongs 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.
CapabilityBridge.onMessage (cognitive 39) src/core/plugin/host/capability-bridge.ts:493— CapabilityBridge.onMessage has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 13). Of this number, 38 points are the body's own statements and 1 belongs 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.
CompletedEngineTaskCleanup.complete (cognitive 39) src/core/task/completed-engine-task-cleanup.ts:199— CompletedEngineTaskCleanup.complete has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 7, loops 1 (3 pts) (nesting depth added 12). Most of this is not in the body itself: 13 of the 39 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 274, 206). 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.
portable-relocation.blockUnavailablePortableTasks (cognitive 39) src/main/platform/portable-relocation.ts:208— portable-relocation.blockUnavailablePortableTasks has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (11 pts), loops 5 (8 pts), boolean chains 6 (nesting depth added 16). Of this number, 23 points are the body's own statements and 16 belong to 6 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.
downloads-more-menu.DownloadsMoreMenu (cognitive 39) src/renderer/routes/downloads/downloads-more-menu.tsx:22— downloads-more-menu.DownloadsMoreMenu has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 8, if/else 7, error handling 1 (nesting depth added 15). Of this number, 30 points are the body's own statements and 9 belong to 6 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.
directory-picker.DirectoryPicker (cognitive 39) src/renderer/components/desktop-kit/directory-picker.tsx:56— directory-picker.DirectoryPicker has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 28, if/else 20 (24 pts), ternaries 12 (24 pts), error handling 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. This shape REPEATS in the file: one other method here (directory-picker.DirectoryPicker::handlePick) 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.
file-routes.registerNasFileRoutes (cognitive 39) src/server/platform/nas/file-routes.ts:94— file-routes.registerNasFileRoutes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 11, error handling 4, loops 2, ternaries 2 (nesting depth added 3). None of this is in the body itself: all 39 points belong to 8 function items inside it that branch (a function literal at line 240, a function literal at line 196, a function literal at line 148, …). 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.
CookieJar.cookieHeader (cognitive 38) src/core/plugin/capabilities/http-cookies.ts:292— CookieJar.cookieHeader has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1, loops 1 (nesting depth added 17). Of this number, 34 points are the body's own statements and 4 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.
settings-validation.settingsValidationError.<returned closure> (cognitive 38) src/renderer/lib/settings-validation.ts:27— settings-validation.settingsValidationError.<returned closure> has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 11, ternaries 3 (8 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.
plugin-hooks.isBoundedJsonValue (cognitive 38) src/shared/schemas/plugin-hooks.ts:78— plugin-hooks.isBoundedJsonValue has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (6 pts), boolean chains 4 (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.
semver.compareSemver (cognitive 38) src/shared/semver.ts:28— semver.compareSemver has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 5 (14 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.
FinalizeCommitter.commitPrepared (cognitive 37) src/core/plugin/finalize/finalize-committer.ts:276— FinalizeCommitter.commitPrepared has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2 (3 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.
directory-preferences-section.DirectoryPreferencesSection (cognitive 37) src/renderer/features/directory-preferences/directory-preferences-section.tsx:74— directory-preferences-section.DirectoryPreferencesSection has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 15, ternaries 7 (11 pts), if/else 8 (10 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 5 function items inside it that branch (addFavorite, a function literal at line 104, a function literal at line 160, …). 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.
legacy-fresh-download.LegacyFreshDownload (cognitive 37) src/renderer/features/legacy-import/legacy-fresh-download.tsx:28— legacy-fresh-download.LegacyFreshDownload has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 10, if/else 9 (10 pts), error handling 3 (nesting depth added 5). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (cancelActivation, prepare, activate, …). 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.
verified-install.download (cognitive 36) src/core/ffmpeg/verified-install.ts:386— verified-install.download has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
http-request-context.resolveLegacyHttpRequestContext (cognitive 36) src/core/legacy-import/http-request-context.ts:28— http-request-context.resolveLegacyHttpRequestContext has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 13, error handling 2, loops 1, ternaries 1 (nesting depth added 3). Of this number, 24 points are the body's own statements and 12 belong to 2 function items inside it that branch. 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.
OperationFiles.pick (cognitive 36) src/core/plugin/operations/operation-files.ts:99— OperationFiles.pick has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 6, ternaries 4, error handling 2 (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.
task-save-directory.restoreTaskSaveDirectory (cognitive 36) src/core/task/task-save-directory.ts:8— task-save-directory.restoreTaskSaveDirectory has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 9, loops 2 (4 pts), ternaries 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TrackerSyncer.fetch (cognitive 36) src/core/tracker/tracker-syncer.ts:82— TrackerSyncer.fetch has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 7 (19 pts), if/else 5 (9 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 17). Most of this is not in the body itself: 1 of the 36 points is its own statement and the rest belongs to one function literal inside it that branches (line 95). 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.
activity-calendar-model.selectActivityGeometry (cognitive 36) src/renderer/routes/dashboard/activity/activity-calendar-model.ts:365— activity-calendar-model.selectActivityGeometry has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 5 (11 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-list-panel.TaskListPanel (cognitive 36) src/renderer/routes/downloads/task-list-panel.tsx:38— task-list-panel.TaskListPanel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 14, ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 248, 220, 187, …). 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.
plugin-detail-page.PluginDetailPage (cognitive 36) src/renderer/routes/plugins/plugin-detail-page.tsx:63— plugin-detail-page.PluginDetailPage has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 19, ternaries 8 (9 pts), if/else 5 (8 pts) (nesting depth added 4). Of this number, 31 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
quick-js-worker.injectPluginApi (cognitive 35) src/core/plugin/host/quick-js-worker.ts:1536— quick-js-worker.injectPluginApi has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 9 (12 pts), error handling 4 (5 pts), loops 4, boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 1664, 1593, 1637, …). 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.
move-tasks.moveBatch (cognitive 35) src/core/task/actions/move-tasks.ts:30— move-tasks.moveBatch has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 6 (10 pts), boolean chains 7, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 13). Most of this is not in the body itself: 13 of the 35 points are its own statements and the rest belongs to 2 function items inside it that branch (move, a function literal at line 37). 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.
index.bootstrapBridge (cognitive 35) src/main/bridge/index.ts:412— index.bootstrapBridge has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (9 pts), error handling 4 (6 pts), loops 6, boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 9 of the 35 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 963, a function literal at line 569, a function literal at line 852, …). 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.
url-editor.UrlEditor (cognitive 35) src/renderer/components/add-task/url-editor.tsx:33— url-editor.UrlEditor has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 8 (12 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 10). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 60, 94, 109, …). 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.
PluginRegistry.applyOverlay (cognitive 34) src/core/plugin/plugin-registry.ts:639— PluginRegistry.applyOverlay has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (21 pts), error handling 5 (9 pts), boolean chains 3, 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.
PluginInstaller.stage (cognitive 34) src/core/plugin/install/plugin-installer.ts:249— PluginInstaller.stage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, error handling 5 (7 pts), ternaries 4 (5 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
finalize-task.finalizeTaskSerialized (cognitive 34) src/core/task/actions/finalize-task.ts:204— finalize-task.finalizeTaskSerialized has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 8, error handling 2 (4 pts), 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.
general-dialog.GeneralDialog (cognitive 34) src/renderer/routes/settings/cards/general-dialog.tsx:53— general-dialog.GeneralDialog has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (10 pts), if/else 7 (8 pts), loops 1 (nesting depth added 3). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (notificationRow, a function literal at line 221, a function literal at line 73, …). 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.
command-graph.readSnapshot (cognitive 33) src/core/plugin/commands/command-graph.ts:130— command-graph.readSnapshot has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (23 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 17). Of this number, 32 points are the body's own statements and 1 belongs 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.
moext-reader.extractLoadedMoext (cognitive 33) src/core/plugin/install/moext-reader.ts:240— moext-reader.extractLoadedMoext has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24, boolean chains 6, ternaries 2, error handling 1. Most of this is not in the body itself: 4 of the 33 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 293, 368, 390, …). 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.
OperationFiles.cleanup (cognitive 33) src/core/plugin/operations/operation-files.ts:680— OperationFiles.cleanup has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 4 (10 pts), ternaries 3 (6 pts), boolean chains 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.
FinalizeRecovery.recoverReserved (cognitive 33) src/core/plugin/finalize/finalize-recovery.ts:454— FinalizeRecovery.recoverReserved has cognitive complexity 33 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 7, ternaries 2 (nesting depth added 6). Of this number, 26 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
portable-relocation.relocatePortableDatabase (cognitive 33) src/core/session/portable-relocation.ts:222— portable-relocation.relocatePortableDatabase has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 21). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 229). 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.
finalize-task.finalizeBtAfterRename (cognitive 33) src/core/task/actions/finalize-task.ts:820— finalize-task.finalizeBtAfterRename has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (13 pts), error handling 6 (10 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 7). Of this number, 31 points are the body's own statements and 2 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.
SynologyTaskFiles.outputIdentity (cognitive 33) src/server/platform/synology/task-files.ts:266— SynologyTaskFiles.outputIdentity has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 10 (nesting depth added 12). 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.
lifecycle (cognitive 33) packaging/fnos/app/lifecycle.mjs:125— lifecycle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 4, error handling 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). Of this number, 22 points are the body's own statements and 11 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.
startAccountAuthority (cognitive 33) packaging/fnos/cmd/account-authority.mjs:226— startAccountAuthority has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5, ternaries 2 (4 pts), error handling 3, loops 2 (3 pts) (nesting depth added 10). Of this number, 20 points are the body's own statements and 13 belong to 20 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.
session-parser.parseLegacySession::flush (cognitive 32) src/core/legacy-import/session-parser.ts:258— session-parser.parseLegacySession::flush has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, ternaries 4, 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. This shape REPEATS in the file: one other method here (session-parser.parseLegacySession) 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.
PluginHost.doActivate (cognitive 32) src/core/plugin/host/plugin-host.ts:458— PluginHost.doActivate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 6, error handling 2, ternaries 1 (nesting depth added 5). Of this number, 29 points are the body's own statements and 3 belong to 5 function literals inside it that branch. 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.
DurableFinalizeRuntime.commit (cognitive 32) src/core/session/durable-finalize-runtime.ts:83— DurableFinalizeRuntime.commit has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, ternaries 4 (5 pts), error handling 2 (3 pts) (nesting depth added 5). Of this number, 19 points are the body's own statements and 13 belong to 2 function literals inside it that branch. 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.
create-torrent.createTorrent (cognitive 32) src/core/torrent/create-torrent.ts:102— create-torrent.createTorrent has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (7 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.
package-manager.classifyCliInstall (cognitive 32) src/main/cli/package-manager.ts:164— package-manager.classifyCliInstall has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 10, ternaries 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.
plugin-input-group.PluginInputGroup (cognitive 32) src/renderer/routes/plugins/components/plugin-input-group.tsx:49— plugin-input-group.PluginInputGroup has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (11 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 14 of the 32 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 71, triggerCheck, a function literal at line 92, …). 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.
HlsDashPipeline.dispatch (cognitive 31) src/core/bridge-receiver/pipelines/hls-dash-pipeline.ts:42— HlsDashPipeline.dispatch has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (18 pts), error handling 4 (7 pts), if/else 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.
SettingsManager.persistUpdate (cognitive 31) src/core/settings/settings-manager.ts:600— SettingsManager.persistUpdate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (24 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.
EngineSupervisor.diagnose (cognitive 31) src/core/engine/engine-supervisor.ts:848— EngineSupervisor.diagnose has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 10, error handling 1 (2 pts), if/else 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.
window-chrome.WindowChrome (cognitive 31) src/renderer/components/window-chrome/window-chrome.tsx:157— window-chrome.WindowChrome has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 17, ternaries 9 (13 pts), if/else 1 (nesting depth added 4). Of this number, 29 points are the body's own statements and 2 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.
task-inspector-activity.cloneDataOnlyValue (cognitive 31) src/shared/schemas/task-inspector-activity.ts:38— task-inspector-activity.cloneDataOnlyValue has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 7, loops 2 (3 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.
BridgeReceiver.dispatchAdapted (cognitive 30) src/core/bridge-receiver/bridge-receiver.ts:357— BridgeReceiver.dispatchAdapted has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 8 (13 pts), boolean chains 3 (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.
FullCrossPluginInvoker.execute (cognitive 30) src/core/plugin/commands/cross-plugin-invoker.ts:114— FullCrossPluginInvoker.execute has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), error handling 4 (5 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FinalizeRecovery.recoverRenameFile (cognitive 30) src/core/plugin/finalize/finalize-recovery.ts:326— FinalizeRecovery.recoverRenameFile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 10, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
re-add-task.reAddTaskUnderMutation (cognitive 30) src/core/task/actions/re-add-task.ts:566— re-add-task.reAddTaskUnderMutation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 4 (5 pts), ternaries 4 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 7). Of this number, 28 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.
ffmpeg-probe-electron.makeElectronFfmpegProbe.<returned closure> (cognitive 30) src/main/plugin/ffmpeg-probe-electron.ts:86— ffmpeg-probe-electron.makeElectronFfmpegProbe.<returned closure> has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, error handling 5 (7 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.
desktop-import.prepareFreshDownload (cognitive 30) src/main/legacy-import/desktop-import.ts:330— desktop-import.prepareFreshDownload has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 6, ternaries 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.
task-actions-menu.TaskActionsMenu (cognitive 30) src/renderer/routes/downloads/task-actions-menu.tsx:106— task-actions-menu.TaskActionsMenu has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 36, if/else 22 (26 pts), ternaries 9 (13 pts), error handling 1, loops 1 (nesting depth added 8). 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. This shape REPEATS in the file: one other method here (task-actions-menu.TaskActionsMenu::handleShortcut) 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.
activity-chart-model.buildActivityChartModel (cognitive 30) src/renderer/routes/downloads/inspector/activity-chart-model.ts:135— activity-chart-model.buildActivityChartModel has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 6 (9 pts), boolean chains 5, ternaries 4 (5 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.
marquee-overlay.MarqueeOverlay (cognitive 30) src/renderer/components/desktop-kit/marquee-selection/marquee-overlay.tsx:21— marquee-overlay.MarqueeOverlay has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 8, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 30 points belong to 11 function literals inside it that branch (lines 133, 164, 78, …). 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.
operator-auth.registerOperatorAuth (cognitive 30) REDACTED:195— operator-auth.registerOperatorAuth has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 7, error handling 1 (3 pts), ternaries 3 (nesting depth added 7). None of this is in the body itself: all 30 points belong to 4 function literals inside it that branch (lines 232, 286, 317, …). 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.
aria2-tuning.recommendFileAllocation (cognitive 29) src/core/engine/aria2/aria2-tuning.ts:49— aria2-tuning.recommendFileAllocation has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 6 (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.
chain-merge.mergeChain (cognitive 29) src/core/plugin/hooks/chain-merge.ts:23— chain-merge.mergeChain has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 16). Of this number, 28 points are the body's own statements and 1 belongs 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.
appearance-dialog.AppearanceDialog (cognitive 29) src/renderer/routes/settings/cards/appearance-dialog.tsx:98— appearance-dialog.AppearanceDialog has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 14, if/else 11 (12 pts), ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 219, 139, 110, …). 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.
bridge-data-dir-lock.createOwnedFile (cognitive 28) src/core/bridge/bridge-data-dir-lock.ts:526— bridge-data-dir-lock.createOwnedFile has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 5 (9 pts), boolean chains 4 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FfmpegService.run (cognitive 28) src/core/ffmpeg/ffmpeg-service.ts:81— FfmpegService.run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 5). None of this is in the body itself: all 28 points belong to 4 function items inside it that branch (a function literal at line 130, acceptLine, a function literal at line 158, …). 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.
PluginInstaller.commit (cognitive 28) src/core/plugin/install/plugin-installer.ts:468— PluginInstaller.commit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 483, 639). 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.
finalize-journal-repository.validateIntents (cognitive 28) src/core/session/finalize-journal-repository.ts:487— finalize-journal-repository.validateIntents has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 9, ternaries 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.
DirectResourceValidatorService.requestFollowingRedirects (cognitive 28) src/core/task/direct-resource-validator.ts:730— DirectResourceValidatorService.requestFollowingRedirects has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 3 (8 pts), boolean chains 2, 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.
re-add-task.buildDirectReAddParams (cognitive 28) src/core/task/actions/re-add-task.ts:212— re-add-task.buildDirectReAddParams has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 7 (8 pts), boolean chains 7 (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.
ffmpeg-fetch-electron.fetchFfmpegAsset (cognitive 28) src/main/plugin/ffmpeg-fetch-electron.ts:10— ffmpeg-fetch-electron.fetchFfmpegAsset has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, error handling 3 (4 pts), ternaries 1 (3 pts), loops 2 (nesting depth added 4). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 83, 22, 41, …). 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.
desktop-import.registerLegacyImportIpc (cognitive 28) src/main/legacy-import/desktop-import.ts:94— desktop-import.registerLegacyImportIpc has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12, boolean chains 8, ternaries 4 (6 pts), error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 13 function items inside it that branch (a function literal at line 234, a function literal at line 284, a function literal at line 124, …). 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.
advanced-dialog.AdvancedDialog (cognitive 28) src/renderer/routes/settings/cards/advanced-dialog.tsx:83— advanced-dialog.AdvancedDialog has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (10 pts), ternaries 5 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 169, 355, 376, …). 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.
tracker-sync-details.TrackerSyncDetails (cognitive 28) src/renderer/routes/trackers/components/tracker-sync-details.tsx:35— tracker-sync-details.TrackerSyncDetails has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 12, error handling 1, if/else 1 (nesting depth added 4). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 70, a function literal at line 196, a function literal at line 55, …). 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.
use-pending-magnet-selection.usePendingMagnetSelection (cognitive 28) src/renderer/components/add-task-dialog/use-pending-magnet-selection.ts:12— use-pending-magnet-selection.usePendingMagnetSelection has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 10, ternaries 3 (nesting depth added 1). None of this is in the body itself: all 28 points belong to 10 function literals inside it that branch (lines 61, 28, 50, …). 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.
import-task-selection.ImportTaskSelection (cognitive 28) src/renderer/features/legacy-import/import-task-selection.tsx:47— import-task-selection.ImportTaskSelection has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (9 pts), ternaries 4 (6 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (renderRow, a function literal at line 74, a function literal at line 150, …). 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.
PostDeliveryScheduler.runBatch (cognitive 27) src/core/plugin/post/delivery-scheduler.ts:150— PostDeliveryScheduler.runBatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 3 (5 pts), boolean chains 3 (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.
SessionManager.mergeTaskFromPair (cognitive 27) src/core/session/session-manager.ts:1462— SessionManager.mergeTaskFromPair has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, ternaries 6 (8 pts), if/else 4 (5 pts) (nesting depth added 3). Of this number, 22 points are the body's own statements and 5 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.
MagnetTracker.submitUnderAdmission (cognitive 27) src/core/torrent/magnet-tracker.ts:438— MagnetTracker.submitUnderAdmission has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (21 pts), error handling 3, boolean chains 2, ternaries 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 12 belong to 2 function literals inside it that branch. 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.
TaskRecoveryServiceImpl.recover (cognitive 27) src/core/task/task-recovery-service.ts:197— TaskRecoveryServiceImpl.recover has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, loops 4 (5 pts), ternaries 3 (5 pts), error handling 2 (4 pts) (nesting depth added 8). Of this number, 15 points are the body's own statements and 12 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.
TrackerManager.performSyncAndCurate (cognitive 27) src/core/tracker/tracker-manager.ts:301— TrackerManager.performSyncAndCurate has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, ternaries 9 (10 pts), if/else 4 (5 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (fetchKind, a function literal at line 325, a function literal at line 439, …). 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.
AppImageNativeHost.install (cognitive 27) src/main/bridge/appimage-native-host.ts:282— AppImageNativeHost.install has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (4 pts), error handling 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.
appimage-integration.installSelfIntegration (cognitive 27) src/main/platform/appimage-integration.ts:749— appimage-integration.installSelfIntegration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7, ternaries 3, error handling 2 (nesting depth added 2). Of this number, 23 points are the body's own statements and 4 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.
index.startEngineAndRestore (cognitive 27) src/main/index.ts:1325— index.startEngineAndRestore has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5, error handling 4, loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 11 belong to 6 function literals inside it that branch. 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.
system-protocols-section.SystemProtocolsSection (cognitive 27) src/renderer/routes/settings/cards/integration/system-protocols-section.tsx:63— system-protocols-section.SystemProtocolsSection has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 21, if/else 15 (17 pts), ternaries 7 (12 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, 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. This shape REPEATS in the file: one other method here (system-protocols-section.SystemProtocolsSection::handleOpenSystemSettings) 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.
integration-dialog.IntegrationDialog (cognitive 27) src/renderer/routes/settings/cards/integration/integration-dialog.tsx:61— integration-dialog.IntegrationDialog has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (10 pts), ternaries 3 (5 pts) (nesting depth added 3). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 97, 84, 136). 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.
advanced-panel.DenseField (cognitive 27) src/renderer/components/add-task/advanced-panel.tsx:330— advanced-panel.DenseField has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 15). None of this is in the body itself: all 27 points belong to 2 function literals inside it that branch (lines 349, 391). 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.
motrix-menu-button.ElectronMotrixMenuButton (cognitive 27) src/renderer/components/window-chrome/motrix-menu-button.tsx:231— motrix-menu-button.ElectronMotrixMenuButton has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15, boolean chains 7, ternaries 5. Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 326, a function literal at line 310, a function literal at line 240, …). 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.
remote-extension-admission-policy.parseForwarded (cognitive 26) src/server/bridge/remote-extension-admission-policy.ts:304— remote-extension-admission-policy.parseForwarded has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, ternaries 2 (4 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.
TaskInspectorActivityService.recordSample (cognitive 26) src/core/inspector-activity/task-inspector-activity-service.ts:305— TaskInspectorActivityService.recordSample has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 9, ternaries 3 (4 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, 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.
aria2-legacy-http.requestMatches (cognitive 26) src/core/engine/aria2/aria2-legacy-http.ts:88— aria2-legacy-http.requestMatches has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 2, ternaries 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.
verified-install.extractVerifiedFfmpeg (cognitive 26) src/core/ffmpeg/verified-install.ts:477— verified-install.extractVerifiedFfmpeg has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 12, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 576, 551, 527, …). 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.
fs-sandbox.resolveDeepInsideSandbox (cognitive 26) src/core/plugin/capabilities/fs-sandbox.ts:64— fs-sandbox.resolveDeepInsideSandbox has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (6 pts), boolean chains 4, 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.
bit-torrent-dialog.BitTorrentDialog (cognitive 26) src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:87— bit-torrent-dialog.BitTorrentDialog has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10, boolean chains 8, if/else 7 (8 pts) (nesting depth added 1). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 150, 97, 135, …). 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.
log-redact.headerNames (cognitive 26) src/shared/lib/log-redact.ts:379— log-redact.headerNames has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 pts), error handling 2 (5 pts), loops 1 (nesting depth added 13). Of this number, 24 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.
log-redact.redactError (cognitive 26) src/shared/lib/log-redact.ts:428— log-redact.redactError has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 6 (8 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.
BootstrapIPCCodec.validateResponse (cognitive 26) packages/safari-bootstrap/Sources/SafariNativeIPC/BootstrapIPCCodec.swift:31— BootstrapIPCCodec.validateResponse has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 19, 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.
registry-fetcher.fetchVerifiedPackageBytes (cognitive 25) src/core/plugin/registry/registry-fetcher.ts:49— registry-fetcher.fetchVerifiedPackageBytes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, ternaries 1 (3 pts), error handling 2, 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.
MagnetTracker.retryMetadataUnderMutation (cognitive 25) src/core/torrent/magnet-tracker.ts:742— MagnetTracker.retryMetadataUnderMutation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 3, 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.
MotrixNatManager.checkDiagnostics (cognitive 25) src/main/nat/motrix-nat-manager.ts:45— MotrixNatManager.checkDiagnostics has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, 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.
plugin-diagnostics-page.PluginDiagnosticsPage (cognitive 25) src/renderer/routes/plugins/plugin-diagnostics-page.tsx:118— plugin-diagnostics-page.PluginDiagnosticsPage has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 9, ternaries 4. Of this number, 20 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
use-directory-preferences-draft.useRevisionedDirectoryDraft.save (cognitive 25) src/renderer/features/directory-preferences/use-directory-preferences-draft.ts:237— use-directory-preferences-draft.useRevisionedDirectoryDraft.save has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 4, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
json-schema-to-zod.jsonSchemaToZod (cognitive 25) REDACTED:28— json-schema-to-zod.jsonSchemaToZod has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (3 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.
prepareApplicationOwnership (cognitive 25) packaging/fnos/cmd/authority-lifecycle.mjs:237— prepareApplicationOwnership has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 12). Of this number, 20 points are the body's own statements and 5 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.
LegacyBtActivationService.prepare (cognitive 24) src/core/legacy-import/bt-activation-service.ts:222— LegacyBtActivationService.prepare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 8, loops 1 (nesting depth added 4). Of this number, 22 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.
finalize-task.finalizeBt (cognitive 24) src/core/task/actions/finalize-task.ts:603— finalize-task.finalizeBt has cognitive complexity 24 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 9 (10 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MagnetTracker.doCleanupCacheEntry (cognitive 24) src/core/torrent/magnet-tracker.ts:1715— MagnetTracker.doCleanupCacheEntry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 4). Of this number, 20 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
TaskRecoveryServiceImpl.applyAction (cognitive 24) src/core/task/task-recovery-service.ts:444— TaskRecoveryServiceImpl.applyAction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (8 pts), boolean chains 1, 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.
TrackerProber.probe (cognitive 24) src/core/tracker/tracker-prober.ts:23— TrackerProber.probe has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 13). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 42, 27). 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.
linux-default-apps.resolveInstalledDesktopIds (cognitive 24) src/main/platform/linux-default-apps.ts:154— linux-default-apps.resolveInstalledDesktopIds has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (3 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.
task-inspector-drawer.TaskInspectorDrawer (cognitive 24) src/renderer/routes/downloads/task-inspector-drawer.tsx:63— task-inspector-drawer.TaskInspectorDrawer has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 18, ternaries 4 (5 pts), if/else 1 (nesting depth added 1). Of this number, 22 points are the body's own statements and 2 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.
compact-limit-input.CompactLimitInput (cognitive 24) src/renderer/routes/settings/cards/compact-limit-input.tsx:45— compact-limit-input.CompactLimitInput has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 6, if/else 2 (nesting depth added 2). Of this number, 14 points are the body's own statements and 10 belong to 4 function items inside it that branch. 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.
network-dialog.NetworkDialog (cognitive 24) src/renderer/routes/settings/cards/network-dialog.tsx:96— network-dialog.NetworkDialog has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (10 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 135, 163, 121, …). 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.
toolbar-search.ToolbarSearch (cognitive 24) src/renderer/components/desktop-kit/toolbar/toolbar-search.tsx:40— toolbar-search.ToolbarSearch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 4 (6 pts) (nesting depth added 4). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 136, a function literal at line 88, collapseIfIdle, …). 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.
DirectoryPickerController.start (cognitive 24) src/renderer/features/web-directory-picker/directory-picker-controller.ts:227— DirectoryPickerController.start has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 2 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.
NasFileRemover.perform (cognitive 24) src/server/platform/nas/file-remover.ts:63— NasFileRemover.perform has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, ternaries 2 (nesting depth added 3). Of this number, 22 points are the body's own statements and 2 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.
credential-store.reconcile (cognitive 23) src/core/bridge/credential-store.ts:1114— credential-store.reconcile has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 8). Of this number, 22 points are the body's own statements and 1 belongs 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.
WebSocketBridgeServer.resolveExtensionMbp1Route (cognitive 23) src/core/bridge/web-socket-bridge-server.ts:983— WebSocketBridgeServer.resolveExtensionMbp1Route has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5, boolean chains 3, error handling 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.
finalize-removal-safety.selectRemovalSurvivor (cognitive 23) src/core/plugin/finalize/finalize-removal-safety.ts:23— finalize-removal-safety.selectRemovalSurvivor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 6). Of this number, 22 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.
system-proxy.parseElectronProxyChain (cognitive 23) REDACTED:15— system-proxy.parseElectronProxyChain has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (9 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.
DirectResourceValidatorService.verifyLegacyContent::verifyRange (cognitive 23) src/core/task/direct-resource-validator.ts:590— DirectResourceValidatorService.verifyLegacyContent::verifyRange has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (4 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.
finalize-task.finalizeBtInPlace (cognitive 23) src/core/task/actions/finalize-task.ts:1075— finalize-task.finalizeBtInPlace has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (8 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.
appimage-integration.parseExecValue (cognitive 23) src/main/platform/appimage-integration.ts:238— appimage-integration.parseExecValue has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, 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.
services.createElectronPlatformServices (cognitive 23) src/main/platform/services.ts:17— services.createElectronPlatformServices has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 4 (6 pts), boolean chains 5 (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.
overview-tab.OverviewTab (cognitive 23) src/renderer/routes/downloads/inspector/overview-tab.tsx:157— overview-tab.OverviewTab has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 11 (13 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.
notifications-page.NotificationsPage (cognitive 23) src/renderer/routes/notifications/notifications-page.tsx:163— notifications-page.NotificationsPage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 10, error handling 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 212, runAction, a function literal at line 284, …). 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.
builtin-update-dialog.BuiltinUpdateDialog (cognitive 23) src/renderer/routes/plugins/components/builtin-update-dialog.tsx:32— builtin-update-dialog.BuiltinUpdateDialog has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7, ternaries 4 (7 pts), boolean chains 6, error handling 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (cancel, a function literal at line 49, confirm, …). 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.
appimage-integration-section.AppImageIntegrationSection (cognitive 23) src/renderer/routes/settings/cards/integration/appimage-integration-section.tsx:31— appimage-integration-section.AppImageIntegrationSection has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, ternaries 4 (7 pts), if/else 3, error handling 1 (nesting depth added 3). Of this number, 19 points are the body's own statements and 4 belong to 3 function items inside it that branch. 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.
motrix-menu-button.MenuTree (cognitive 23) src/renderer/components/window-chrome/motrix-menu-button.tsx:130— motrix-menu-button.MenuTree has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 3 (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.
directory-preferences-dialog.OpenDirectoryPreferencesDialog (cognitive 23) src/renderer/features/directory-preferences/directory-preferences-dialog.tsx:36— directory-preferences-dialog.OpenDirectoryPreferencesDialog has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 10. Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (keyDown, save, a function literal at line 73, …). 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.
use-polled-query.usePolledQuery (cognitive 23) src/renderer/hooks/use-polled-query.ts:58— use-polled-query.usePolledQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, ternaries 2 (3 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 5 function literals inside it that branch (lines 109, 90, 82, …). 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.
ServerDirectoryService.locations (cognitive 23) src/server/server-directory-service.ts:121— ServerDirectoryService.locations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), boolean chains 2, error handling 2 (nesting depth added 9). Of this number, 20 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.
applyPendingSettings (cognitive 23) packaging/synology/app/lifecycle.mjs:129— applyPendingSettings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, error handling 2 (3 pts), loops 1 (nesting depth added 6). Of this number, 17 points are the body's own statements and 6 belong to 7 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.
package-flatpak-companion.parseArgs (cognitive 22) packages/native-host/package-flatpak-companion.mjs:39— package-flatpak-companion.parseArgs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 17 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.
bridge-data-dir-lock.recoverExistingLock (cognitive 22) src/core/bridge/bridge-data-dir-lock.ts:309— bridge-data-dir-lock.recoverExistingLock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 4 (9 pts), ternaries 1 (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.
verified-install.findLegacyRelease (cognitive 22) src/core/ffmpeg/verified-install.ts:852— verified-install.findLegacyRelease has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), error handling 1 (3 pts), loops 2 (3 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.
PluginRegistry.setHostLanguageTransaction (cognitive 22) src/core/plugin/plugin-registry.ts:444— PluginRegistry.setHostLanguageTransaction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (5 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FinalizeRecovery.restorePrepared (cognitive 22) src/core/plugin/finalize/finalize-recovery.ts:731— FinalizeRecovery.restorePrepared has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5 (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.
command-runner.createCommandRunner.<returned closure> (cognitive 22) src/core/process/command-runner.ts:120— command-runner.createCommandRunner.<returned closure> has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 8, error handling 4 (6 pts) (nesting depth added 2). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 180, 199, 125, …). 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.
portable-relocation.relocatePortableProfile (cognitive 22) src/main/platform/portable-relocation.ts:85— portable-relocation.relocatePortableProfile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bt-storage-dialog.BtStorageDialog (cognitive 22) src/renderer/routes/downloads/bt-storage-dialog.tsx:28— bt-storage-dialog.BtStorageDialog has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (6 pts), if/else 3, error handling 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
task-actions-menu.TaskActionsMenu::handleShortcut (cognitive 22) src/renderer/routes/downloads/task-actions-menu.tsx:236— task-actions-menu.TaskActionsMenu::handleShortcut has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 3 (6 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. This shape REPEATS in the file: one other method here (task-actions-menu.TaskActionsMenu) 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.
bt-peer-geo-section.BtPeerGeoSection (cognitive 22) src/renderer/routes/settings/cards/bt-peer-geo-section.tsx:42— bt-peer-geo-section.BtPeerGeoSection has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (6 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 8 belong to 3 function items inside it that branch. 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.
inspector-drawer.InspectorDrawer (cognitive 22) src/renderer/components/desktop-kit/inspector-drawer.tsx:29— inspector-drawer.InspectorDrawer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 87, a function literal at line 169, selectHeight, …). 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.
chart.ChartTooltipContent (cognitive 22) REDACTED:116— chart.ChartTooltipContent has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (9 pts), if/else 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 199, 146). 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.
HttpWsTransport.invoke (cognitive 22) src/renderer/lib/transport/http-ws.ts:119— HttpWsTransport.invoke has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 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.
HttpWsTransport.connectSocket (cognitive 22) src/renderer/lib/transport/http-ws.ts:268— HttpWsTransport.connectSocket has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (15 pts), error handling 4 (5 pts), boolean chains 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 334, renew, a function literal at line 328, …). 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.
server-process-ownership-authority.readExactBinding (cognitive 22) src/server/bridge/server-process-ownership-authority.ts:153— server-process-ownership-authority.readExactBinding has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 6, 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.
NasRecoveryAccess.authorizeResume (cognitive 22) src/server/platform/nas/recovery-access.ts:56— NasRecoveryAccess.authorizeResume has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (4 pts), boolean chains 3, error handling 1 (nesting depth added 9). Of this number, 19 points are the body's own statements and 3 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.
loadAuthorityKey (cognitive 22) packaging/fnos/cmd/account-authority.mjs:163— loadAuthorityKey has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 3 (5 pts), boolean chains 3 (nesting depth added 8). Of this number, 14 points are the body's own statements and 8 belong to 3 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.
account-authority.accountFromSnapshot (cognitive 21) packaging/fnos/cmd/account-authority.mjs:38— account-authority.accountFromSnapshot has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 9, ternaries 2 (3 pts) (nesting depth added 1). 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: 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.
validators.validateHistoryEventInput (cognitive 21) src/core/inspector-activity/validators.ts:159— validators.validateHistoryEventInput has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Aria2Adapter.removeDownloadResults (cognitive 21) src/core/engine/aria2/aria2-adapter.ts:1232— Aria2Adapter.removeDownloadResults has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (9 pts), ternaries 2 (6 pts), boolean chains 2, error handling 1 (2 pts), if/else 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.
FfmpegCapabilityHost.run (cognitive 21) src/core/plugin/capabilities/ffmpeg.ts:299— FfmpegCapabilityHost.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, error handling 2, ternaries 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (abort, a function literal at line 411, a function literal at line 441, …). 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.
CapabilityBridge.dispatchFfmpeg (cognitive 21) src/core/plugin/host/capability-bridge.ts:1440— CapabilityBridge.dispatchFfmpeg has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 1 (2 pts), boolean chains 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.
session-manager.resolveCurrentAria2Rows (cognitive 21) src/core/session/session-manager.ts:138— session-manager.resolveCurrentAria2Rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 5 (7 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MagnetTracker.primeFromDatabase (cognitive 21) src/core/torrent/magnet-tracker.ts:238— MagnetTracker.primeFromDatabase has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 2 (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.
create-task-handler.createAdmittedTask (cognitive 21) src/core/task/create-task-handler.ts:302— create-task-handler.createAdmittedTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 5). Of this number, 19 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.
create-task-handler.handleCreateTaskUnderAdmission::createReservedTask (cognitive 21) src/core/task/create-task-handler.ts:1208— create-task-handler.handleCreateTaskUnderAdmission::createReservedTask has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (create-task-handler.handleCreateTaskUnderAdmission) 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.
index.makeResolveToMux.<returned closure> (cognitive 21) src/main/bridge/index.ts:135— index.makeResolveToMux.<returned closure> has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (13 pts), if/else 2 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 14 points are the body's own statements and 7 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.
CliToolService.#probe (cognitive 21) REDACTED:362— CliToolService.#probe has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 7, if/else 6 (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.
tile-segmented-control.ForwardedTileSegmentedControl (cognitive 21) src/renderer/routes/dashboard/components/tile-segmented-control.tsx:35— tile-segmented-control.ForwardedTileSegmentedControl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, ternaries 4, loops 1, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (adjacentEnabledValue, requestValueChange, a function literal at line 136, …). 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.
import-run-content.ImportRunResult (cognitive 21) src/renderer/features/legacy-import/import-run-content.tsx:122— import-run-content.ImportRunResult has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 7 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
use-task-speed-history.useTaskSpeedHistory (cognitive 21) src/renderer/hooks/use-task-speed-history.ts:42— use-task-speed-history.useTaskSpeedHistory has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 97, 61, 120, …). 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.
use-transfer-stats.useTransferStats (cognitive 21) src/renderer/hooks/use-transfer-stats.ts:58— use-transfer-stats.useTransferStats has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 2). None of this is in the body itself: all 21 points belong to 9 function literals inside it that branch (lines 75, 192, 145, …). 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.
SynologyFiles.policy (cognitive 21) src/server/platform/synology/files.ts:199— SynologyFiles.policy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 8). None of this is in the body itself: all 21 points belong to 3 function literals inside it that branch (lines 208, 217, 252). 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.
operator-admin.listPendingRequests (cognitive 21) src/server/operator-admin.ts:522— operator-admin.listPendingRequests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
log-redact.redactExtraEngineOptions (cognitive 21) src/shared/lib/log-redact.ts:540— log-redact.redactExtraEngineOptions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (6 pts), error handling 2 (3 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.
log-redact.limitVerboseError (cognitive 21) src/shared/lib/log-redact.ts:757— log-redact.limitVerboseError has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 6 (8 pts), boolean chains 1, 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.
log-redact.limitVerboseValue (cognitive 21) src/shared/lib/log-redact.ts:910— log-redact.limitVerboseValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
remote-extension-config.parsePublicUrl (cognitive 20) src/server/bridge/remote-extension-config.ts:186— remote-extension-config.parsePublicUrl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 2, error handling 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.
Aria2ProcessOutput.emitLine (cognitive 20) src/core/engine/aria2/aria2-process-output.ts:109— Aria2ProcessOutput.emitLine has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (11 pts), if/else 6, boolean chains 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.
completed-task-startup-guard.parseSessionRunIntent (cognitive 20) src/core/engine/aria2/completed-task-startup-guard.ts:38— completed-task-startup-guard.parseSessionRunIntent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 1 (nesting depth added 8). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EngineSupervisor.recover (cognitive 20) src/core/engine/engine-supervisor.ts:958— EngineSupervisor.recover has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 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.
GeoIPDownloader.download (cognitive 20) src/core/geoip/geo-ip-downloader.ts:49— GeoIPDownloader.download has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4, ternaries 3, boolean chains 1, loops 1 (nesting depth added 3). 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.
CapabilityBridge.applyHookEffects (cognitive 20) src/core/plugin/host/capability-bridge.ts:1696— CapabilityBridge.applyHookEffects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 2 (3 pts), loops 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 1 belongs 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.
system-proxy.parseProxyEnvironment (cognitive 20) REDACTED:58— system-proxy.parseProxyEnvironment has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 3, if/else 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.
DirectResourceValidatorService.verify (cognitive 20) src/core/task/direct-resource-validator.ts:465— DirectResourceValidatorService.verify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, ternaries 2 (3 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.
TrackerManager.init (cognitive 20) src/core/tracker/tracker-manager.ts:164— TrackerManager.init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BridgeManager.stopCurrent (cognitive 20) src/main/bridge/bridge-manager.ts:106— BridgeManager.stopCurrent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 2 (5 pts), boolean chains 3 (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.
package-manager.managerBinDirectory (cognitive 20) src/main/cli/package-manager.ts:387— package-manager.managerBinDirectory has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 5 (6 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.
CliToolService.#verifyInstall (cognitive 20) REDACTED:497— CliToolService.#verifyInstall has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (7 pts), ternaries 3 (5 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.
commands.registerCommandHandlers (cognitive 20) src/main/ipc/commands.ts:2026— commands.registerCommandHandlers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 6). Of this number, 10 points are the body's own statements and 10 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.
dashboard-tile-frame.DashboardTileFrame (cognitive 20) src/renderer/routes/dashboard/components/dashboard-tile-frame.tsx:92— dashboard-tile-frame.DashboardTileFrame has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 8, if/else 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 216, 179, 205). 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.
task-row.TaskRowBase (cognitive 20) src/renderer/routes/downloads/task-row.tsx:43— task-row.TaskRowBase has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 12 (15 pts), boolean chains 5 (nesting depth added 3). Of this number, 18 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.
speed-limit-section.SpeedLimitSection (cognitive 20) src/renderer/routes/settings/cards/speed-limit-section.tsx:121— speed-limit-section.SpeedLimitSection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 5, error handling 1. Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (fillFromPeak, a function literal at line 140, a function literal at line 201, …). 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.
trusted-extensions-section.TrustedExtensionsSection (cognitive 20) src/renderer/routes/settings/cards/integration/trusted-extensions-section.tsx:87— trusted-extensions-section.TrustedExtensionsSection has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 6, if/else 2, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 187, handleAdd, a function literal at line 110, …). 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.
cli-tool-section.CliToolSection (cognitive 20) src/renderer/routes/settings/cards/integration/cli-tool-section.tsx:153— cli-tool-section.CliToolSection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, ternaries 4, if/else 1. Of this number, 17 points are the body's own statements and 3 belong to 3 function items inside it that branch. 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.
use-engine-display-status.useEngineDisplayStatus (cognitive 20) src/renderer/hooks/use-engine-display-status.ts:53— use-engine-display-status.useEngineDisplayStatus has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 5, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 77, 61, 136, …). 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.
operator-extension-pairing.runExtensionPairingTerminal (cognitive 20) src/server/operator-extension-pairing.ts:112— operator-extension-pairing.runExtensionPairingTerminal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 2 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.
remote-extension-admission-policy.resolveForwardedSource (cognitive 19) src/server/bridge/remote-extension-admission-policy.ts:353— remote-extension-admission-policy.resolveForwardedSource 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.
build.parseArgs (cognitive 19) packages/native-host/build.mjs:54— build.parseArgs has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 14 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.
SubmitDownloadAdapter.adapt (cognitive 19) src/core/bridge-receiver/submit-download-adapter.ts:98— SubmitDownloadAdapter.adapt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 4 (6 pts), boolean chains 1 (nesting depth added 4). 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: 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.
ExtensionPairingProjectionService.reconcileCommitted (cognitive 19) src/core/bridge/extension-pairing-projection.ts:373— ExtensionPairingProjectionService.reconcileCommitted has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 3 (6 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 7). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 377). 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.
TaskInspectorActivityRuntime.deliverRecoveredAnchor (cognitive 19) src/core/inspector-activity/task-inspector-activity-runtime.ts:752— TaskInspectorActivityRuntime.deliverRecoveredAnchor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 790). 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.
source-scanner.readLegacyFile (cognitive 19) src/core/legacy-import/source-scanner.ts:104— source-scanner.readLegacyFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 8, error handling 1, loops 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.
LegacyImportService.authorizeMetadataAdmission (cognitive 19) src/core/legacy-import/import-service.ts:303— LegacyImportService.authorizeMetadataAdmission has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 1). 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: 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.
http.buildResponse (cognitive 19) src/core/plugin/capabilities/http.ts:652— http.buildResponse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), error handling 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.
PluginSecurityService.fetchPolicy::download (cognitive 19) src/core/plugin/security/security-service.ts:283— PluginSecurityService.fetchPolicy::download has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 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.
NativeFinalizeArtifactOperations.prepareFileRename (cognitive 19) src/core/plugin/finalize/native-artifact-operations.ts:194— NativeFinalizeArtifactOperations.prepareFileRename has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, loops 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 7 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HookOrchestrator.runBeforeFinalize (cognitive 19) src/core/plugin/hooks/hook-orchestrator.ts:370— HookOrchestrator.runBeforeFinalize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 1 (2 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
quick-js-worker.handleHookEnter (cognitive 19) src/core/plugin/host/quick-js-worker.ts:337— quick-js-worker.handleHookEnter has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 484, 419, 399, …). 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.
OperationService.run (cognitive 19) src/core/plugin/operations/operation-service.ts:624— OperationService.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, error handling 3, ternaries 2 (3 pts), loops 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 5 belong to 5 function items inside it that branch. 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.
delivery-materializer.materializeCandidate (cognitive 19) src/core/plugin/post/delivery-materializer.ts:191— delivery-materializer.materializeCandidate has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 8, 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.
queries.buildContributionIndex (cognitive 19) src/core/plugin/queries.ts:105— queries.buildContributionIndex has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 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.
direct-resource-validator.redirectRequestUrl (cognitive 19) src/core/task/direct-resource-validator.ts:943— direct-resource-validator.redirectRequestUrl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 4 (6 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.
MotrixDatabase.commitTerminalHookBoundary (cognitive 19) src/core/session/motrix-database.ts:817— MotrixDatabase.commitTerminalHookBoundary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, ternaries 1 (nesting depth added 5). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 823). 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.
re-add-task.reAddBt (cognitive 19) src/core/task/actions/re-add-task.ts:142— re-add-task.reAddBt has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (15 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.
CompletedEngineTaskCleanup.observe (cognitive 19) src/core/task/completed-engine-task-cleanup.ts:107— CompletedEngineTaskCleanup.observe has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, 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.
get-task-files.createGetTaskFilesHandler.getTaskFiles (cognitive 19) src/core/task/get-task-files.ts:64— get-task-files.createGetTaskFilesHandler.getTaskFiles has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, loops 3 (5 pts), boolean chains 4, ternaries 2, error handling 1 (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.
TrackerProber.probeUdp (cognitive 19) src/core/tracker/tracker-prober.ts:116— TrackerProber.probeUdp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 3, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 130, 150, 125, …). 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.
NativeMessagingInstaller.syncManifests (cognitive 19) src/main/bridge/native-messaging-installer.ts:325— NativeMessagingInstaller.syncManifests has cognitive complexity 19 (threshold 15). Drivers by points: error handling 2 (6 pts), loops 3 (6 pts), if/else 3 (4 pts), ternaries 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.
index.syncNativeMessagingManifests (cognitive 19) src/main/bridge/index.ts:349— index.syncNativeMessagingManifests has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, ternaries 3 (6 pts), if/else 3 (5 pts), error handling 1, 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.
launcher.setupLauncher (cognitive 19) src/main/launcher.ts:55— launcher.setupLauncher has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 130). 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.
completion-shutdown.setupCompletionShutdown (cognitive 19) src/main/platform/completion-shutdown.ts:38— completion-shutdown.setupCompletionShutdown has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6 (nesting depth added 3). None of this is in the body itself: all 19 points belong to 7 function literals inside it that branch (lines 58, 76, 48, …). 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.
download-progress.getDownloadProgressValue (cognitive 19) src/main/platform/download-progress.ts:13— download-progress.getDownloadProgressValue has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 3 (5 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.
speed-sparkline.SpeedSparkline (cognitive 19) src/renderer/routes/dashboard/components/speed-sparkline.tsx:38— speed-sparkline.SpeedSparkline has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, boolean chains 7, if/else 3. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 50, 118, 62, …). 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.
engine-badge.EngineBadge (cognitive 19) src/renderer/routes/downloads/engine-badge.tsx:7— engine-badge.EngineBadge has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (16 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.
notifications-page.NotificationRow (cognitive 19) src/renderer/routes/notifications/notifications-page.tsx:40— notifications-page.NotificationRow has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 8 (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.
use-plugin-install.usePluginInstall.startInstall (cognitive 19) src/renderer/routes/plugins/hooks/use-plugin-install.ts:84— use-plugin-install.usePluginInstall.startInstall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, error handling 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.
plugin-call-graph-edge.PluginCallGraphEdge (cognitive 19) src/renderer/routes/plugins/components/call-graph/plugin-call-graph-edge.tsx:32— plugin-call-graph-edge.PluginCallGraphEdge has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (10 pts), boolean chains 8, if/else 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.
drop-zone.DropZone (cognitive 19) src/renderer/components/add-task/drop-zone.tsx:16— drop-zone.DropZone has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, error handling 2 (3 pts), loops 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (selectNasTorrent, a function literal at line 36, a function literal at line 101, …). 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.
file-list.FileList (cognitive 19) src/renderer/components/file-list/file-list.tsx:28— file-list.FileList has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 6, ternaries 2. Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 130, toggleSelectAll, toggleFile, …). 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.
operator-auth.refreshOperatorSession (cognitive 19) src/renderer/lib/operator-auth.ts:55— operator-auth.refreshOperatorSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, 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.
remote-extension-config.parseRemoteExtensionConfig (cognitive 18) src/server/bridge/remote-extension-config.ts:350— remote-extension-config.parseRemoteExtensionConfig has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 4, error handling 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.
remote-extension-route-policy.evaluateRemoteExtensionRoute (cognitive 18) src/server/bridge/remote-extension-route-policy.ts:129— remote-extension-route-policy.evaluateRemoteExtensionRoute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 2, error handling 1, 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.
compaction.compactTaskTransferSamples (cognitive 18) src/core/inspector-activity/compaction.ts:64— compaction.compactTaskTransferSamples has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). Of this number, 13 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.
TaskInspectorActivityService.closeAtExactTerminalTransition (cognitive 18) src/core/inspector-activity/task-inspector-activity-service.ts:480— TaskInspectorActivityService.closeAtExactTerminalTransition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 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.
bridge-data-dir-lock.acquireBridgeDataDirLock (cognitive 18) src/core/bridge/bridge-data-dir-lock.ts:242— bridge-data-dir-lock.acquireBridgeDataDirLock has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 4 (8 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.
bridge-data-dir-lock.resumeInterruptedRecovery (cognitive 18) src/core/bridge/bridge-data-dir-lock.ts:384— bridge-data-dir-lock.resumeInterruptedRecovery has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
JsonRpcProtocol.handleMessage (cognitive 18) src/core/engine/aria2/json-rpc-protocol.ts:184— JsonRpcProtocol.handleMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 1 (3 pts), ternaries 1 (2 pts), boolean chains 1, 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.
completed-task-startup-guard.readRunIntent (cognitive 18) src/core/engine/aria2/completed-task-startup-guard.ts:81— completed-task-startup-guard.readRunIntent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (3 pts), boolean chains 2, ternaries 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.
LegacyImportService.commitAdmission (cognitive 18) src/core/legacy-import/import-service.ts:422— LegacyImportService.commitAdmission has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 2, error handling 1, loops 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 3 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.
hls-parser.parseHlsMaster (cognitive 18) REDACTED:59— hls-parser.parseHlsMaster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3, boolean chains 2, loops 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs 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.
command-graph.snapshotCandidates (cognitive 18) src/core/plugin/commands/command-graph.ts:265— command-graph.snapshotCandidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts), loops 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.
NativeFinalizeArtifactOperations.removeIsolated (cognitive 18) src/core/plugin/finalize/native-artifact-operations.ts:527— NativeFinalizeArtifactOperations.removeIsolated has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7 (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.
PostDeliveryScheduler.execute (cognitive 18) src/core/plugin/post/delivery-scheduler.ts:281— PostDeliveryScheduler.execute has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (7 pts), error handling 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
update-scan.scanForUpdates (cognitive 18) src/core/plugin/registry/update-scan.ts:24— update-scan.scanForUpdates 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.
merge-engine-task.mergeEngineTask (cognitive 18) src/core/task/merge-engine-task.ts:19— merge-engine-task.mergeEngineTask has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (6 pts), if/else 4 (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.
re-add-task.reAddTask (cognitive 18) src/core/task/actions/re-add-task.ts:502— re-add-task.reAddTask has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 5). Of this number, 13 points are the body's own statements and 5 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.
shell-environment.resolveExecutable (cognitive 18) src/main/cli/shell-environment.ts:150— shell-environment.resolveExecutable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 4 (5 pts), boolean chains 3, loops 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.
WindowManager.recreate (cognitive 18) src/main/window/window-manager.ts:238— WindowManager.recreate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 259). 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.
MenuManager.walkAndUpdate (cognitive 18) src/main/menu/menu-manager.ts:372— MenuManager.walkAndUpdate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 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.
files-tab.FilesTab (cognitive 18) src/renderer/routes/downloads/inspector/files-tab.tsx:33— files-tab.FilesTab has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 8 (nesting depth added 3). Of this number, 13 points are the body's own statements and 5 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.
task-column-header.TaskColumnHeader (cognitive 18) src/renderer/routes/downloads/task-column-header.tsx:39— task-column-header.TaskColumnHeader has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 6, boolean chains 4 (nesting depth added 1). None of this is in the body itself: all 18 points belong to 4 function literals inside it that branch (lines 82, 150, 112, …). 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.
system-protocols-section.SystemProtocolsSection::handleOpenSystemSettings (cognitive 18) src/renderer/routes/settings/cards/integration/system-protocols-section.tsx:141— system-protocols-section.SystemProtocolsSection::handleOpenSystemSettings has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 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. This shape REPEATS in the file: one other method here (system-protocols-section.SystemProtocolsSection) 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.
operation-form.OperationForm (cognitive 18) src/renderer/features/plugin-operations/operation-form.tsx:40— operation-form.OperationForm has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, ternaries 4 (7 pts), if/else 3 (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 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.
use-notification-toasts.useNotificationToasts (cognitive 18) src/renderer/hooks/use-notification-toasts.ts:90— use-notification-toasts.useNotificationToasts has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (7 pts), if/else 6, boolean chains 4, error handling 1 (nesting depth added 2). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 169, 130, 162). 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.
file-routes.nasFileRange (cognitive 18) src/server/platform/nas/file-routes.ts:22— file-routes.nasFileRange has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6, 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.
routes.registerFnosRoutes (cognitive 18) src/server/platform/fnos/routes.ts:19— routes.registerFnosRoutes has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6, error handling 3, ternaries 2. None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 34, 60, 25). 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.
NasSettingsStore.snapshot (cognitive 18) src/server/platform/nas/settings-store.ts:73— NasSettingsStore.snapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 2 (3 pts), ternaries 2 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator-admin.runOperatorAdmin (cognitive 18) src/server/operator-admin.ts:783— operator-admin.runOperatorAdmin has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6 (7 pts), boolean chains 2, 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.
task-inspector-activity.findTaskSpeedUpdate (cognitive 18) src/shared/schemas/task-inspector-activity.ts:379— task-inspector-activity.findTaskSpeedUpdate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 1, 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.
RemoteExtensionSurfacePolicy.evaluate (cognitive 17) src/server/bridge/remote-extension-surface-policy.ts:40— RemoteExtensionSurfacePolicy.evaluate has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 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.
TaskInspectorActivityService.selectOrdinaryCandidate (cognitive 17) src/core/inspector-activity/task-inspector-activity-service.ts:647— TaskInspectorActivityService.selectOrdinaryCandidate has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 11, 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.
TaskInspectorActivityStore.applyCheckpoint (cognitive 17) src/core/inspector-activity/task-inspector-activity-store.ts:339— TaskInspectorActivityStore.applyCheckpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (3 pts), ternaries 3, 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.
PairSession.onPairHello (cognitive 17) src/core/bridge/mbp1/pair-session.ts:417— PairSession.onPairHello has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, error handling 3, boolean chains 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.
LegacyHttpActivationService.sourceContext (cognitive 17) src/core/legacy-import/http-activation-service.ts:285— LegacyHttpActivationService.sourceContext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyHttpActivationService.noConflicts (cognitive 17) src/core/legacy-import/http-activation-service.ts:660— LegacyHttpActivationService.noConflicts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (nesting depth added 5). 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.
CommandInvokeAudit.cleanupRotations (cognitive 17) src/core/plugin/commands/invoke-audit.ts:191— CommandInvokeAudit.cleanupRotations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CapabilityBridge.handleStaged (cognitive 17) src/core/plugin/host/capability-bridge.ts:1778— CapabilityBridge.handleStaged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (3 pts), boolean chains 2, error handling 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.
finalize-committer.assertRenameFileJournal (cognitive 17) src/core/plugin/finalize/finalize-committer.ts:751— finalize-committer.assertRenameFileJournal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, 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.
OperationService.catalog (cognitive 17) src/core/plugin/operations/operation-service.ts:114— OperationService.catalog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 4, if/else 2 (nesting depth added 6). None of this is in the body itself: all 17 points belong to 4 function literals inside it that branch (lines 119, 115, 121, …). 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.
aria2-proxy-routing.decideAria2ProxyRoute (cognitive 17) REDACTED:159— aria2-proxy-routing.decideAria2ProxyRoute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, 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.
clear-stopped-tasks.clearStoppedTasks (cognitive 17) src/core/task/actions/clear-stopped-tasks.ts:59— clear-stopped-tasks.clearStoppedTasks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (2 pts), loops 1 (2 pts), ternaries 2, boolean chains 1 (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
task-recovery-service.determineAction (cognitive 17) src/core/task/task-recovery-service.ts:54— task-recovery-service.determineAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (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.
tracker-selector.collectSourceUrls (cognitive 17) src/core/tracker/tracker-selector.ts:29— tracker-selector.collectSourceUrls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 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.
tracker-selector.selectTrackers (cognitive 17) src/core/tracker/tracker-selector.ts:56— tracker-selector.selectTrackers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3, ternaries 3, boolean chains 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppImageNativeHost.disable (cognitive 17) src/main/bridge/appimage-native-host.ts:414— AppImageNativeHost.disable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (4 pts), boolean chains 1, 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.
WindowManager.createBrowserWindow (cognitive 17) src/main/window/window-manager.ts:506— WindowManager.createBrowserWindow has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7 (nesting depth added 2). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 574, a function literal at line 555, preventUntrustedNavigation). 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.
appimage-integration.removeDesktopIdFromMimeApps (cognitive 17) src/main/platform/appimage-integration.ts:554— appimage-integration.removeDesktopIdFromMimeApps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, ternaries 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.
os-bridge.createOsNotificationBridge.handleClick (cognitive 17) src/main/notifications/os-bridge.ts:85— os-bridge.createOsNotificationBridge.handleClick has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (3 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.
tray.setupTray.createTray (cognitive 17) src/main/platform/tray.ts:85— tray.setupTray.createTray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 151, 130, 142, …). 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.
engine-tile.EngineTile (cognitive 17) src/renderer/routes/dashboard/tiles/engine-tile.tsx:38— engine-tile.EngineTile has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 4, if/else 1 (nesting depth added 3). 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, 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.
tasks-tile.TasksTile (cognitive 17) src/renderer/routes/dashboard/tiles/tasks-tile.tsx:505— tasks-tile.TasksTile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 4 (5 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.
task-inspector-action-bar.TaskInspectorActionBar (cognitive 17) src/renderer/routes/downloads/inspector/task-inspector-action-bar.tsx:196— task-inspector-action-bar.TaskInspectorActionBar has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 14, 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.
registry-install-action.RegistryInstallSession (cognitive 17) src/renderer/routes/plugins/components/registry-install-action.tsx:23— registry-install-action.RegistryInstallSession has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 3 (nesting depth added 6). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 37). 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.
app-update-section.UpdateActionButton (cognitive 17) src/renderer/routes/settings/cards/app-update-section.tsx:127— app-update-section.UpdateActionButton has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (10 pts), boolean chains 5, if/else 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.
renderer.startCubicGlassRenderer.draw (cognitive 17) src/renderer/components/desktop-kit/cubic-glass/renderer.ts:134— renderer.startCubicGlassRenderer.draw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (6 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.
directory-picker.DirectoryPicker::handlePick (cognitive 17) src/renderer/components/desktop-kit/directory-picker.tsx:155— directory-picker.DirectoryPicker::handlePick has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 3 (6 pts), boolean chains 4, 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. This shape REPEATS in the file: one other method here (directory-picker.DirectoryPicker) 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.
use-task-files.useTaskFiles (cognitive 17) src/renderer/hooks/use-task-files.ts:27— use-task-files.useTaskFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 3, error handling 1, ternaries 1. None of this is in the body itself: all 17 points belong to 8 function literals inside it that branch (lines 48, 77, 95, …). 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.
match.matchesAccelerator (cognitive 17) src/renderer/shortcuts/match.ts:1— match.matchesAccelerator has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, loops 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.
readLicenseDirectory (cognitive 17) packages/native-host/package-flatpak-companion.mjs:202— readLicenseDirectory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (4 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (walk, a function literal at line 212, a function literal at line 204, …). 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.
Aria2ConfigBuilder.buildArgs (cognitive 16) REDACTED:177— Aria2ConfigBuilder.buildArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, 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.
session-parser.parseLegacySession (cognitive 16) src/core/legacy-import/session-parser.ts:251— session-parser.parseLegacySession has cognitive complexity 16 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 8, loops 4, ternaries 4 (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. This shape REPEATS in the file: one other method here (session-parser.parseLegacySession::flush) 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.
dash-parser.expandTimeline (cognitive 16) REDACTED:262— dash-parser.expandTimeline has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), 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.
FinalizeRecovery.restore (cognitive 16) src/core/plugin/finalize/finalize-recovery.ts:551— FinalizeRecovery.restore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6 (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.
NativeFinalizeArtifactOperations.removeKnown (cognitive 16) src/core/plugin/finalize/native-artifact-operations.ts:632— NativeFinalizeArtifactOperations.removeKnown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 5, 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.
quick-js-worker.jsValueToVmHandle (cognitive 16) src/core/plugin/host/quick-js-worker.ts:1271— quick-js-worker.jsValueToVmHandle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DirectRecoveryPlanner.plan (cognitive 16) src/core/session/direct-recovery-planner.ts:142— DirectRecoveryPlanner.plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 5, error handling 1, 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.
MagnetTracker.getFileSelection (cognitive 16) src/core/torrent/magnet-tracker.ts:1056— MagnetTracker.getFileSelection has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 2 (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.
windows-desktop-startup-recovery.recoverDefaultWindowsDesktopBridgeResidue (cognitive 16) src/main/bridge/windows-desktop-startup-recovery.ts:35— windows-desktop-startup-recovery.recoverDefaultWindowsDesktopBridgeResidue has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 3 (5 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.
appimage-integration.runStartupIntegration (cognitive 16) src/main/platform/appimage-integration.ts:1220— appimage-integration.runStartupIntegration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (nesting depth added 9). 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.
MenuManager.normalizeElectronSeparators (cognitive 16) src/main/menu/menu-manager.ts:397— MenuManager.normalizeElectronSeparators has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). Of this number, 14 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.
tray.setupTray.onSettingsChanged (cognitive 16) src/main/platform/tray.ts:236— tray.setupTray.onSettingsChanged has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 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.
activity-calendar-model.activityMonthLabels (cognitive 16) src/renderer/routes/dashboard/activity/activity-calendar-model.ts:560— activity-calendar-model.activityMonthLabels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, loops 2 (3 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.
browser-extensions-section.BrowserExtensionsSection (cognitive 16) src/renderer/routes/settings/cards/integration/browser-extensions-section.tsx:60— browser-extensions-section.BrowserExtensionsSection has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 136, 65, 176). 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.
add-task-dialog-host.AddTaskDialogHost (cognitive 16) src/renderer/components/add-task-dialog/add-task-dialog-host.tsx:33— add-task-dialog-host.AddTaskDialogHost has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, boolean chains 3, ternaries 1. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 52, 75, 91, …). 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.
blur-highlight.splitHighlightedText (cognitive 16) src/renderer/components/ui/blur-highlight.tsx:73— blur-highlight.splitHighlightedText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs 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.
sidebar.SidebarProvider (cognitive 16) src/renderer/components/ui/sidebar.tsx:53— sidebar.SidebarProvider has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 4. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 103, 73, 82, …). 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.
use-operation-state.useOperationState (cognitive 16) src/renderer/features/plugin-operations/use-operation-state.ts:18— use-operation-state.useOperationState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, loops 3, error handling 1 (2 pts) (nesting depth added 4). None of this is in the body itself: all 16 points belong to 4 function literals inside it that branch (lines 28, 24, 61, …). 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.
DirectoryPickerController.commitListing (cognitive 16) src/renderer/features/web-directory-picker/directory-picker-controller.ts:385— DirectoryPickerController.commitListing has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 4. Of this number, 15 points are the body's own statements and 1 belongs to one function literal 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.
use-transport-mirror.useTransportMirror (cognitive 16) src/renderer/hooks/use-transport-mirror.ts:95— use-transport-mirror.useTransportMirror has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 2, loops 2, error handling 1, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to 6 function literals inside it that branch (lines 140, 113, 207, …). 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.
use-task-inspector-activity.useTaskInspectorActivity (cognitive 16) src/renderer/hooks/use-task-inspector-activity.ts:64— use-task-inspector-activity.useTaskInspectorActivity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, ternaries 2. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 147, 134, 93, …). 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.
HttpWsTransport.ensureSocket (cognitive 16) src/renderer/lib/transport/http-ws.ts:213— HttpWsTransport.ensureSocket has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 238, 257). 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.
runtimeEnvironment (cognitive 16) packaging/fnos/app/lifecycle.mjs:20— runtimeEnvironment has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (4 pts), other 3, 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×1
REDACTED
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×1
Edited copy of a member (32 corresponding lines) packages/native-host/src/flatpak_companion/secure_fs.rs:193— packages/native-host/src/flatpak_companion/secure_fs.rs:193-227 | packages/native-host/src/flatpak_companion/secure_fs.rs:232-263 — 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 copy of a member (18 corresponding lines) · ×1
Edited copy of a member (18 corresponding lines) packages/native-host/src/broker_protocol.rs:158— packages/native-host/src/broker_protocol.rs:158-181 | packages/native-host/src/protocol.rs:128-145 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×1
Edited copy of a member (14 corresponding lines) packages/finalize-fs/src/platform/unix/publish.rs:20— packages/finalize-fs/src/platform/unix/publish.rs:20-34 | packages/finalize-fs/src/platform/unix/reserved.rs:131-144 — 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 (7 corresponding lines) · ×1
Edited copy of a member (7 corresponding lines) packages/finalize-fs/src/platform/unix/metadata.rs:66— packages/finalize-fs/src/platform/unix/metadata.rs:66-80 | packages/finalize-fs/src/platform/unix/metadata.rs:82-88 — 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.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) packages/native-host/src/appimage_config.rs:51— packages/native-host/src/appimage_config.rs:51-56 | packages/native-host/src/flatpak_companion/allowlist.rs: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.
Duplicated block (4–15 lines × 3) packages/finalize-fs/src/state.rs:215— packages/finalize-fs/src/state.rs:215-229 | packages/finalize-fs/src/state.rs:398-412 | packages/finalize-fs/src/state.rs:546-549 — 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 `packages/finalize-fs/src/state.rs:215` 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 (14 lines × 2) packages/finalize-fs/src/state.rs:277— packages/finalize-fs/src/state.rs:277-290 | packages/finalize-fs/src/state.rs:336-349 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/finalize-fs/src/state.rs:277` 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–13 lines × 3) packages/finalize-fs/src/platform/unix/copy.rs:127— packages/finalize-fs/src/platform/unix/copy.rs:127-139 | packages/finalize-fs/src/platform/unix/copy.rs:202-210 | packages/finalize-fs/src/platform/unix/operations.rs:119-127 — 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 `packages/finalize-fs/src/platform/unix/copy.rs:127` 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) packages/finalize-fs/src/platform/unix/copy.rs:33— packages/finalize-fs/src/platform/unix/copy.rs:33-45 | packages/finalize-fs/src/platform/unix/digest.rs:24-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 `packages/finalize-fs/src/platform/unix/copy.rs:33` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) packages/finalize-fs/src/platform/unix/reserved.rs:33— packages/finalize-fs/src/platform/unix/reserved.rs:33-37 | packages/finalize-fs/src/platform/unix/reserved.rs:207-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) scripts/fnos_publication.py:63— scripts/fnos_publication.py:63-69 | scripts/synology_publication.py:188-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `scripts/fnos_publication.py:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
IC1 · Incompleteness & stubs· Markup wires an event to an empty handler · ×1
Markup wires an event to an empty handler src/renderer/routes/downloads/task-row.tsx:134— `onKeyDown` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
P12 · CI test-gate honesty· Runner config excludes tests no gate runs · ×1
Runner config excludes tests no gate runs vitest.config.ts:28— `src/{renderer,preload}/**` removes 2581 test(s) in 296 file(s) (e.g. `src/preload/preload.test.ts`, `src/renderer/components/byte-unit-sync.test.tsx`) from what vitest collects, and no other runner or CI command runs them — they are dead tests. Run them (another runner, project or job), or delete them.
Duplication concentrated across 6 sibling directories (100 clone groups) src/main/ipc/commands.ts:965— 100 duplicated blocks under src/ have copies in at least two of the sibling directories core, main, preload, renderer, server, shared — 71 of them are reported below, and 29 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 100 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 100 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 100 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (33 clone groups) src/renderer/features/directory-preferences/directory-preferences-dialog.tsx:122— 33 duplicated blocks under src/renderer/ have copies in at least two of the sibling directories components, features, hooks, routes — 11 of them are reported below, and 22 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 33 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 33 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 33 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 14 sibling directories (25 clone groups) src/core/plugin/runtime/plugin-hook-runtime.ts:370— 25 duplicated blocks under src/core/ have copies in at least two of the sibling directories activity, bridge, bridge-receiver, engine, ffmpeg, geoip (+8 more sibling(s) not listed) — 8 of them are reported below, and 17 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 25 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 25 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 25 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 5 sibling directories (11 clone groups) src/renderer/routes/downloads/inspector/task-tracker-dialog.tsx:69— 11 duplicated blocks under src/renderer/routes/ have copies in at least two of the sibling directories dashboard, downloads, plugins, settings, trackers — 5 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 11 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 11 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 11 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (7 clone groups) packages/finalize-fs/build.mjs:23— 7 duplicated blocks under the repository root have copies in at least two of the sibling directories packages, packaging, scripts, src — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (457 matched lines × 2 locations) · ×1
Duplicated block with local edits (457 matched lines × 2 locations) scripts/stage-electron-app.mjs:45— scripts/stage-electron-app.mjs:45 · scripts/stage-server-app.mjs:40 — the two spans are one implementation copied and then locally edited — 2738 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (247 matched lines × 2 locations) · ×1
Duplicated block with local edits (247 matched lines × 2 locations) src/main/ipc/commands.ts:965— src/main/ipc/commands.ts:965 · src/server/ipc/commands.ts:569 — the two spans are one implementation copied and then locally edited — 1236 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (182 matched lines × 2 locations) · ×1
Duplicated block with local edits (182 matched lines × 2 locations) src/renderer/routes/settings/cards/advanced-dialog.tsx:140— src/renderer/routes/settings/cards/advanced-dialog.tsx:140 · src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:103 — the two spans are one implementation copied and then locally edited — 758 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (163 matched lines × 2 locations) · ×1
Duplicated block with local edits (163 matched lines × 2 locations) scripts/verify-electron-package.mjs:109— scripts/verify-electron-package.mjs:109 · scripts/verify-server-package.mjs:56 — the two spans are one implementation copied and then locally edited — 996 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (158 matched lines × 2 locations) · ×1
Duplicated block with local edits (158 matched lines × 2 locations) src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:129— src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:129 · src/renderer/routes/settings/cards/network-dialog.tsx:142 — the two spans are one implementation copied and then locally edited — 680 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (141 matched lines × 2 locations) · ×1
Duplicated block with local edits (141 matched lines × 2 locations) src/renderer/routes/settings/cards/appearance-dialog.tsx:420— src/renderer/routes/settings/cards/appearance-dialog.tsx:420 · src/renderer/routes/settings/cards/network-dialog.tsx:315 — the two spans are one implementation copied and then locally edited — 575 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (131 matched lines × 2 locations) · ×1
Duplicated block with local edits (131 matched lines × 2 locations) src/shared/lib/log-redact.ts:455— src/shared/lib/log-redact.ts:455 · src/shared/lib/log-redact.ts:780 — the two spans are one implementation copied and then locally edited — 642 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.
R10 · Code Duplication· Duplicated block with local edits (123 matched lines × 2 locations) · ×1
Duplicated block with local edits (123 matched lines × 2 locations) src/renderer/routes/settings/cards/downloads-dialog.tsx:89— src/renderer/routes/settings/cards/downloads-dialog.tsx:89 · src/renderer/routes/settings/cards/general-dialog.tsx:217 — the two spans are one implementation copied and then locally edited — 531 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (110 matched lines × 2 locations) · ×1
Duplicated block with local edits (110 matched lines × 2 locations) scripts/prepare-snap-project.mjs:65— scripts/prepare-snap-project.mjs:65 · scripts/verify-snap-artifact.mjs:109 — the two spans are one implementation copied and then locally edited — 670 tokens are still identical, in the same order in both files, 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.
Wholesale file copy (105 identical lines × 2 files) src/main/plugin/capability-host.ts:1— src/main/plugin/capability-host.ts:1 · src/server/plugin/capability-host.ts:1 — these 2 files are line-for-line copies of one another — 105 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (99 matched lines × 2 locations) · ×1
Duplicated block with local edits (99 matched lines × 2 locations) src/renderer/routes/trackers/components/blacklist-tracker-panel.tsx:18— src/renderer/routes/trackers/components/blacklist-tracker-panel.tsx:18 · src/renderer/routes/trackers/components/effective-tracker-panel.tsx:38 — the two spans are one implementation copied and then locally edited — 604 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (97 matched lines × 2 locations) · ×1
Duplicated block with local edits (97 matched lines × 2 locations) src/core/plugin/capabilities/metadata.ts:66— src/core/plugin/capabilities/metadata.ts:66 · src/core/plugin/capabilities/storage.ts:76 — the two spans are one implementation copied and then locally edited — 538 tokens are still identical, in the same order in both files, 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 (93 lines × 2 locations) packaging/fnos/app/lifecycle.mjs:64— packaging/fnos/app/lifecycle.mjs:64 · packaging/synology/app/lifecycle.mjs:224 — 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.
R10 · Code Duplication· Duplicated block with local edits (89 matched lines × 2 locations) · ×1
Duplicated block with local edits (89 matched lines × 2 locations) scripts/assemble-release-artifacts.mjs:472— scripts/assemble-release-artifacts.mjs:472 · scripts/verify-update-artifacts.mjs:166 — the two spans are one implementation copied and then locally edited — 622 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (82 matched lines × 2 locations) · ×1
Duplicated block with local edits (82 matched lines × 2 locations) src/main/bridge/index.ts:550— src/main/bridge/index.ts:550 · src/server/bridge/bootstrap.ts:276 — the two spans are one implementation copied and then locally edited — 532 tokens are still identical, in the same order in both files, 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 (78 lines × 2 locations) src/main/ipc/commands.ts:834— src/main/ipc/commands.ts:834 · src/server/ipc/commands.ts:724 — 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.
R10 · Code Duplication· Duplicated block with local edits (78 matched lines × 2 locations) · ×1
Duplicated block with local edits (78 matched lines × 2 locations) src/renderer/components/ui/autocomplete.tsx:18— src/renderer/components/ui/autocomplete.tsx:18 · src/renderer/components/ui/combobox.tsx:44 — the two spans are one implementation copied and then locally edited — 310 tokens are still identical, in the same order in both files, 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 (61 lines × 2 locations) packaging/fnos/app/lifecycle.mjs:185— packaging/fnos/app/lifecycle.mjs:185 · packaging/synology/app/lifecycle.mjs:365 — the 2 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.
R10 · Code Duplication· Duplicated block with local edits (61 matched lines × 2 locations) · ×1
Duplicated block with local edits (61 matched lines × 2 locations) src/core/task/actions/finalize-task.ts:344— src/core/task/actions/finalize-task.ts:344 · src/core/task/actions/finalize-task.ts:624 — the two spans are one implementation copied and then locally edited — 309 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.
R10 · Code Duplication· Duplicated block with local edits (60 matched lines × 2 locations) · ×1
Duplicated block with local edits (60 matched lines × 2 locations) src/main/index.ts:329— src/main/index.ts:329 · src/server/index.ts:376 — the two spans are one implementation copied and then locally edited — 400 tokens are still identical, in the same order in both files, 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.
R10 · Code Duplication· Duplicated block with local edits (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) src/core/plugin/hooks/hook-orchestrator.ts:225— src/core/plugin/hooks/hook-orchestrator.ts:225 · src/core/plugin/hooks/hook-orchestrator.ts:391 — the two spans are one implementation copied and then locally edited — 343 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 (54 lines × 2 locations) src/renderer/routes/plugins/hooks/use-plugin-graph.ts:60— src/renderer/routes/plugins/hooks/use-plugin-graph.ts:60 · src/renderer/routes/plugins/hooks/use-plugin-metadata.ts:70 — 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 (50 lines × 2 locations) src/main/index.ts:2561— src/main/index.ts:2561 · src/server/index.ts:1028 — the 2 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.
Duplicated block (46 lines × 2 locations) src/renderer/routes/settings/cards/advanced-dialog.tsx:166— src/renderer/routes/settings/cards/advanced-dialog.tsx:166 · src/renderer/routes/settings/cards/appearance-dialog.tsx:216 — 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 (45 lines × 2 locations) src/main/plugin/dev-watcher.ts:23— src/main/plugin/dev-watcher.ts:23 · src/server/plugin/dev-watcher.ts:15 — the 2 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.
Duplicated block (44 lines × 2 locations) src/main/ipc/commands.ts:1973— src/main/ipc/commands.ts:1973 · src/server/ipc/commands.ts:1195 — the 2 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.
Duplicated block (41 lines × 2 locations) src/main/ipc/queries.ts:306— src/main/ipc/queries.ts:306 · src/server/ipc/queries.ts:351 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (38 lines × 2 locations) src/renderer/routes/settings/cards/network-dialog.tsx:378— src/renderer/routes/settings/cards/network-dialog.tsx:378 · src/renderer/routes/settings/cards/network-dialog.tsx:439 — 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 (37 lines × 2 locations) src/main/ipc/commands.ts:1722— src/main/ipc/commands.ts:1722 · src/server/ipc/commands.ts:1075 — 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 (36 lines × 2 locations) scripts/electron-package-utils.mjs:31— scripts/electron-package-utils.mjs:31 · scripts/server-package-utils.mjs:47 — 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.
Duplicated block (35 lines × 2 locations) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:832— src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:832 · src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:867 — both copies are in the same file, so extract the 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 (34 lines × 2 locations) src/core/plugin/finalize/finalize-committer.ts:637— src/core/plugin/finalize/finalize-committer.ts:637 · src/core/plugin/finalize/finalize-recovery.ts:839 — 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.
R10 · Code Duplication· Duplicated block with local edits (34 matched lines × 2 locations) · ×1
Duplicated block with local edits (34 matched lines × 2 locations) src/renderer/routes/plugins/hooks/use-plugin-detail.ts:19— src/renderer/routes/plugins/hooks/use-plugin-detail.ts:19 · src/renderer/routes/plugins/hooks/use-plugins.ts:22 — the two spans are one implementation copied and then locally edited — 175 tokens are still identical, in the same order in both files, 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 (34 lines × 3 locations) src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:144— src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:144 · src/renderer/routes/settings/cards/integration/integration-dialog.tsx:130 · src/renderer/routes/settings/cards/network-dialog.tsx:157 — the 3 copies are spread across 3 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.
R10 · Code Duplication· Duplicated block with local edits (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) scripts/prepare-fnos-project.mjs:136— scripts/prepare-fnos-project.mjs:136 · scripts/prepare-synology-project.mjs:60 — the two spans are one implementation copied and then locally edited — 211 tokens are still identical, in the same order in both files, 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.
Complex function handleCreateTaskUnderAdmission (cyclomatic 144, cognitive 227) src/core/task/create-task-handler.ts:393— handleCreateTaskUnderAdmission has cyclomatic complexity 144 and cognitive complexity 227; 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 keyDown (cyclomatic 95, cognitive 113) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:304— keyDown has cyclomatic complexity 95 and cognitive complexity 113; 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 EngineDiagnosticsDialogHost (cyclomatic 95, cognitive 90) src/renderer/features/engine-diagnostics/engine-diagnostics-dialog.tsx:140— EngineDiagnosticsDialogHost has cyclomatic complexity 95 and cognitive complexity 90; 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 restore (cyclomatic 77, cognitive 149) src/core/session/session-manager.ts:793— restore has cyclomatic complexity 77 and cognitive complexity 149; 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 verifyFlatpakPackaging (cyclomatic 75, cognitive 39) scripts/verify-flatpak-packaging.mjs:118— verifyFlatpakPackaging has cyclomatic complexity 75 and cognitive complexity 39; 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 scanLegacySource (cyclomatic 67, cognitive 108) src/core/legacy-import/source-scanner.ts:288— scanLegacySource has cyclomatic complexity 67 and cognitive complexity 108; 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 recover (cyclomatic 67, cognitive 87) src/core/plugin/finalize/finalize-recovery.ts:81— recover has cyclomatic complexity 67 and cognitive complexity 87; 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 MediaToolsSection (cyclomatic 65, cognitive 58) src/renderer/routes/settings/cards/integration/media-tools-section.tsx:76— MediaToolsSection has cyclomatic complexity 65 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 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 createDownload (cyclomatic 62, cognitive 72) src/core/engine/aria2/aria2-adapter.ts:435— createDownload has cyclomatic complexity 62 and cognitive complexity 72; 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 invoke (cyclomatic 61, cognitive 89) e2e/web-directory-picker/fixture-transport.ts:160— invoke has cyclomatic complexity 61 and cognitive complexity 89; 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 PickerSession (cyclomatic 60, cognitive 53) src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:135— PickerSession has cyclomatic complexity 60 and cognitive complexity 53; 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.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 59, cognitive 62) · ×1
Complex function main (cyclomatic 59, cognitive 62) src/server/index.ts:227— main has cyclomatic complexity 59 and cognitive complexity 62; 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 reconcile (cyclomatic 57, cognitive 71) src/core/legacy-import/http-activation-service.ts:790— reconcile has cyclomatic complexity 57 and cognitive complexity 71; 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 initializeMainProcess (cyclomatic 54, cognitive 59) src/main/index.ts:1662— initializeMainProcess has cyclomatic complexity 54 and cognitive complexity 59; 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 execute (cyclomatic 54, cognitive 57) src/core/task/bt-storage-service.ts:154— execute has cyclomatic complexity 54 and cognitive complexity 57; 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 OperationFormContent (cyclomatic 54, cognitive 43) src/renderer/features/plugin-operations/operation-form.tsx:103— OperationFormContent has cyclomatic complexity 54 and cognitive complexity 43; 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 smokeServerImage (cyclomatic 53, cognitive 60) REDACTED:928— smokeServerImage has cyclomatic complexity 53 and cognitive complexity 60; 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.
R2 · Cyclomatic Complexity· Complex function run (cyclomatic 52, cognitive 75) · ×1
Complex function run (cyclomatic 52, cognitive 75) src/core/task/media-task-coordinator.ts:237— run has cyclomatic complexity 52 and cognitive complexity 75; 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 TaskRow (cyclomatic 52, cognitive 64) src/renderer/routes/dashboard/tiles/tasks-tile.tsx:158— TaskRow has cyclomatic complexity 52 and cognitive complexity 64; 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 swapMagnetMetadataForBtUnderMutation (cyclomatic 51, cognitive 66) src/core/torrent/swap-magnet-metadata-for-bt.ts:128— swapMagnetMetadataForBtUnderMutation has cyclomatic complexity 51 and cognitive complexity 66; 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 onReconnectResponse (cyclomatic 49, cognitive 54) src/core/bridge/mbp1/reconnect-session.ts:206— onReconnectResponse has cyclomatic complexity 49 and cognitive complexity 54; 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 addTorrent (cyclomatic 49, cognitive 54) src/core/engine/aria2/aria2-adapter.ts:882— addTorrent has cyclomatic complexity 49 and cognitive complexity 54; 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 DirectoryPicker (cyclomatic 49, cognitive 50) src/renderer/components/desktop-kit/directory-picker.tsx:56— DirectoryPicker has cyclomatic complexity 49 and cognitive complexity 50; 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 reconcile (cyclomatic 48, cognitive 52) src/core/legacy-import/bt-activation-service.ts:491— reconcile has cyclomatic complexity 48 and cognitive complexity 52; 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 dispatchCall (cyclomatic 48, cognitive 44) src/core/plugin/host/capability-bridge.ts:615— dispatchCall has cyclomatic complexity 48 and cognitive complexity 44; 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 resolveLegacyRequestSettings (cyclomatic 46, cognitive 76) src/core/legacy-import/session-parser.ts:96— resolveLegacyRequestSettings has cyclomatic complexity 46 and cognitive complexity 76; 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 parseAppDeepLink (cyclomatic 44, cognitive 48) src/shared/lib/app-deep-link.ts:28— parseAppDeepLink has cyclomatic complexity 44 and cognitive complexity 48; 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 migrate (cyclomatic 44, cognitive 43) src/core/session/migrations/index.ts:323— migrate has cyclomatic complexity 44 and cognitive complexity 43; 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 renderField (cyclomatic 44, cognitive 41) src/renderer/features/plugin-operations/operation-fields.tsx:62— renderField has cyclomatic complexity 44 and cognitive complexity 41; 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 ActivityCalendar (cyclomatic 44, cognitive 41) src/renderer/routes/dashboard/activity/activity-calendar.tsx:264— ActivityCalendar has cyclomatic complexity 44 and cognitive complexity 41; 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 seedAsPair (cyclomatic 44, cognitive 39) src/core/session/session-manager.test.ts:263— seedAsPair has cyclomatic complexity 44 and cognitive complexity 39; 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 recoverAria2SessionIdentity (cyclomatic 43, cognitive 73) src/core/engine/aria2/aria2-session-identity-recovery.ts:105— recoverAria2SessionIdentity has cyclomatic complexity 43 and cognitive complexity 73; 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 buildRichActivitySeed (cyclomatic 43, cognitive 58) e2e/activity-tile.spec.ts:105— buildRichActivitySeed has cyclomatic complexity 43 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 tryInterpret (cyclomatic 42, cognitive 80) src/renderer/components/add-task/url-interpreters/curl.ts:98— tryInterpret has cyclomatic complexity 42 and cognitive complexity 80; 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 removeTaskUnderMutation (cyclomatic 42, cognitive 78) src/core/task/actions/remove-task.ts:100— removeTaskUnderMutation has cyclomatic complexity 42 and cognitive complexity 78; 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 doStart (cyclomatic 42, cognitive 55) src/core/engine/engine-supervisor.ts:434— doStart has cyclomatic complexity 42 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 analyzeDownloadSource (cyclomatic 42, cognitive 46) src/shared/lib/download-source.ts:23— analyzeDownloadSource has cyclomatic complexity 42 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 LegacyImportDialogContent (cyclomatic 42, cognitive 38) src/renderer/features/legacy-import/legacy-import-dialog.tsx:122— LegacyImportDialogContent has cyclomatic complexity 42 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 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 parseManifest (cyclomatic 41, cognitive 62) src/core/plugin/manifest/parse.ts:157— parseManifest has cyclomatic complexity 41 and cognitive complexity 62; 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 41, cognitive 37) REDACTED:86— (anonymous) has cyclomatic complexity 41 and cognitive complexity 37; 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.
src/main/index.ts: 3252 lines of code src/main/index.ts:1— src/main/index.ts has 3252 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/bridge/web-socket-bridge-server.ts · ×1
src/core/bridge/web-socket-bridge-server.ts: 2724 lines of code src/core/bridge/web-socket-bridge-server.ts:1— src/core/bridge/web-socket-bridge-server.ts has 2724 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/server/index.ts: 2369 lines of code src/server/index.ts:1— src/server/index.ts has 2369 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/session/session-manager.ts · ×1
src/core/session/session-manager.ts: 2172 lines of code src/core/session/session-manager.ts:1— src/core/session/session-manager.ts has 2172 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/host/capability-bridge.ts · ×1
src/core/plugin/host/capability-bridge.ts: 2148 lines of code src/core/plugin/host/capability-bridge.ts:1— src/core/plugin/host/capability-bridge.ts has 2148 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/torrent/magnet-tracker.ts · ×1
src/core/torrent/magnet-tracker.ts: 2143 lines of code src/core/torrent/magnet-tracker.ts:1— src/core/torrent/magnet-tracker.ts has 2143 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/main/ipc/commands.ts: 2035 lines of code src/main/ipc/commands.ts:1— src/main/ipc/commands.ts has 2035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/host/quick-js-worker.ts · ×1
src/core/plugin/host/quick-js-worker.ts: 1902 lines of code src/core/plugin/host/quick-js-worker.ts:1— src/core/plugin/host/quick-js-worker.ts has 1902 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/session/motrix-database.ts · ×1
src/core/session/motrix-database.ts: 1599 lines of code src/core/session/motrix-database.ts:1— src/core/session/motrix-database.ts has 1599 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/task/direct-resource-validator.ts · ×1
src/core/task/direct-resource-validator.ts: 1539 lines of code src/core/task/direct-resource-validator.ts:1— src/core/task/direct-resource-validator.ts has 1539 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/routes/dashboard/components/dashboard-grid.tsx · ×1
src/renderer/routes/dashboard/components/dashboard-grid.tsx: 1538 lines of code src/renderer/routes/dashboard/components/dashboard-grid.tsx:1— src/renderer/routes/dashboard/components/dashboard-grid.tsx has 1538 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/host/plugin-host.ts · ×1
src/core/plugin/host/plugin-host.ts: 1488 lines of code src/core/plugin/host/plugin-host.ts:1— src/core/plugin/host/plugin-host.ts has 1488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/task/create-task-handler.ts · ×1
src/core/task/create-task-handler.ts: 1476 lines of code src/core/task/create-task-handler.ts:1— src/core/task/create-task-handler.ts has 1476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/task/actions/finalize-task.ts · ×1
src/core/task/actions/finalize-task.ts: 1457 lines of code src/core/task/actions/finalize-task.ts:1— src/core/task/actions/finalize-task.ts has 1457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/session/post-delivery-repository.ts · ×1
src/core/session/post-delivery-repository.ts: 1384 lines of code src/core/session/post-delivery-repository.ts:1— src/core/session/post-delivery-repository.ts has 1384 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/engine/aria2/aria2-adapter.ts · ×1
src/core/engine/aria2/aria2-adapter.ts: 1354 lines of code src/core/engine/aria2/aria2-adapter.ts:1— src/core/engine/aria2/aria2-adapter.ts has 1354 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx · ×1
src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx: 1286 lines of code src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx:1— src/renderer/features/web-directory-picker/web-directory-picker-dialog.tsx has 1286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/task/media-task-coordinator.ts · ×1
src/core/task/media-task-coordinator.ts: 1229 lines of code src/core/task/media-task-coordinator.ts:1— src/core/task/media-task-coordinator.ts has 1229 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/main/platform/appimage-integration.ts · ×1
src/main/platform/appimage-integration.ts: 1220 lines of code src/main/platform/appimage-integration.ts:1— src/main/platform/appimage-integration.ts 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.
R3 · Large Files· src/core/ffmpeg/verified-install.ts · ×1
src/core/ffmpeg/verified-install.ts: 1203 lines of code src/core/ffmpeg/verified-install.ts:1— src/core/ffmpeg/verified-install.ts has 1203 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/server/ipc/commands.ts: 1187 lines of code src/server/ipc/commands.ts:1— src/server/ipc/commands.ts has 1187 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/bridge/credential-store.ts · ×1
src/core/bridge/credential-store.ts: 1181 lines of code src/core/bridge/credential-store.ts:1— src/core/bridge/credential-store.ts has 1181 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/routes/dashboard/activity/activity-calendar.tsx · ×1
src/renderer/routes/dashboard/activity/activity-calendar.tsx: 1147 lines of code src/renderer/routes/dashboard/activity/activity-calendar.tsx:1— src/renderer/routes/dashboard/activity/activity-calendar.tsx has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/bridge/mbp1/pair-session.ts · ×1
src/core/bridge/mbp1/pair-session.ts: 1073 lines of code src/core/bridge/mbp1/pair-session.ts:1— src/core/bridge/mbp1/pair-session.ts has 1073 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/main/bridge/index.ts: 1063 lines of code src/main/bridge/index.ts:1— src/main/bridge/index.ts has 1063 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/legacy-import/http-activation-service.ts · ×1
src/core/legacy-import/http-activation-service.ts: 1036 lines of code src/core/legacy-import/http-activation-service.ts:1— src/core/legacy-import/http-activation-service.ts has 1036 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/engine/engine-supervisor.ts · ×1
src/core/engine/engine-supervisor.ts: 1035 lines of code src/core/engine/engine-supervisor.ts:1— src/core/engine/engine-supervisor.ts has 1035 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/inspector-activity/task-inspector-activity-service.ts · ×1
src/core/inspector-activity/task-inspector-activity-service.ts: 1021 lines of code src/core/inspector-activity/task-inspector-activity-service.ts:1— src/core/inspector-activity/task-inspector-activity-service.ts has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/features/legacy-import/legacy-import-dialog.tsx · ×1
src/renderer/features/legacy-import/legacy-import-dialog.tsx: 1008 lines of code src/renderer/features/legacy-import/legacy-import-dialog.tsx:1— src/renderer/features/legacy-import/legacy-import-dialog.tsx has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/legacy-import/import-service.ts · ×1
src/core/legacy-import/import-service.ts: 994 lines of code src/core/legacy-import/import-service.ts:1— src/core/legacy-import/import-service.ts has 994 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/plugin-registry.ts · ×1
src/core/plugin/plugin-registry.ts: 985 lines of code src/core/plugin/plugin-registry.ts:1— src/core/plugin/plugin-registry.ts has 985 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/shared/lib/log-redact.ts · ×1
src/shared/lib/log-redact.ts: 959 lines of code src/shared/lib/log-redact.ts:1— src/shared/lib/log-redact.ts has 959 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/components/add-task/add-task-form.tsx · ×1
src/renderer/components/add-task/add-task-form.tsx: 953 lines of code src/renderer/components/add-task/add-task-form.tsx:1— src/renderer/components/add-task/add-task-form.tsx has 953 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/torrent/swap-magnet-metadata-for-bt.ts · ×1
src/core/torrent/swap-magnet-metadata-for-bt.ts: 922 lines of code src/core/torrent/swap-magnet-metadata-for-bt.ts:1— src/core/torrent/swap-magnet-metadata-for-bt.ts has 922 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/inspector-activity/task-inspector-activity-runtime.ts · ×1
src/core/inspector-activity/task-inspector-activity-runtime.ts: 912 lines of code src/core/inspector-activity/task-inspector-activity-runtime.ts:1— src/core/inspector-activity/task-inspector-activity-runtime.ts has 912 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/bridge/bridge-data-dir-lock.ts · ×1
src/core/bridge/bridge-data-dir-lock.ts: 889 lines of code src/core/bridge/bridge-data-dir-lock.ts:1— src/core/bridge/bridge-data-dir-lock.ts has 889 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/finalize/finalize-recovery.ts · ×1
src/core/plugin/finalize/finalize-recovery.ts: 875 lines of code src/core/plugin/finalize/finalize-recovery.ts:1— src/core/plugin/finalize/finalize-recovery.ts has 875 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/renderer/routes/settings/cards/bit-torrent-dialog.tsx · ×1
src/renderer/routes/settings/cards/bit-torrent-dialog.tsx: 847 lines of code src/renderer/routes/settings/cards/bit-torrent-dialog.tsx:1— src/renderer/routes/settings/cards/bit-torrent-dialog.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/plugin/finalize/native-artifact-operations.ts · ×1
src/core/plugin/finalize/native-artifact-operations.ts: 846 lines of code src/core/plugin/finalize/native-artifact-operations.ts:1— src/core/plugin/finalize/native-artifact-operations.ts has 846 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· src/core/bridge/extension-pairing-projection.ts · ×1
src/core/bridge/extension-pairing-projection.ts: 832 lines of code src/core/bridge/extension-pairing-projection.ts:1— src/core/bridge/extension-pairing-projection.ts has 832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~833 LoC) scripts/profile-task-inspector-activity.mts— no import path from any entry point (291 application, 69 tooling, 1175 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 (~370 LoC) packaging/fnos/cmd/authority-lifecycle.mjs— no import path from any entry point (291 application, 69 tooling, 1175 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 (~244 LoC) scripts/measure-desktop-memory.mjs— no import path from any entry point (291 application, 69 tooling, 1175 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 (~156 LoC) scripts/migrate-i18n.mjs— no import path from any entry point (291 application, 69 tooling, 1175 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 (~125 LoC) src/renderer/components/ui/command.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~121 LoC) scripts/profile-task-activity.mts— no import path from any entry point (291 application, 69 tooling, 1175 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 (~95 LoC) src/renderer/components/task/task-status-badge.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~84 LoC) src/renderer/components/desktop-kit/sidebar/nav-projects.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~78 LoC) src/renderer/components/desktop-kit/sidebar/nav-main.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~66 LoC) src/renderer/routes/plugins/components/plugin-permission-list.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~61 LoC) src/renderer/components/ui/native-select.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~40 LoC) src/renderer/routes/plugins/components/about-section.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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 (~37 LoC) src/renderer/components/desktop-kit/sidebar/nav-secondary.tsx— no import path from any entry point (291 application, 69 tooling, 1175 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
Unused dependency '@electron/notarize' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'tslib' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'vaul' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
S1 · Web-Security Posture· Password key derivation is priced too cheaply · ×1
Password key derivation is priced too cheaply src/core/bridge/mbp1/scrypt-w.ts:32— This code fixes scrypt at N=16,384 (r=8, p=1). A key-derivation function's only defence is the cost of ONE guess, and that cost is this number — the algorithm choice does not set it. Current OWASP guidance is 1,300,000 PBKDF2 iterations with HMAC-SHA1, 600,000 with SHA-256 and 210,000 with SHA-512; scrypt at N=2^17, r=8, p=1 (or an equivalent N·r·p product); Argon2id at 19 MiB of memory and 2 iterations (or an equivalent row); bcrypt at a work factor of at least 10. This figure divides the attacker's work by a factor of tens or hundreds against the same stolen hash, on hardware they already own. Where what is derived is short or low-entropy — a PIN, a numeric parental code, a four-character token — the whole keyspace falls in the time this parameter buys, and no salt or constant-time comparison changes that. Raise the count to the current published figure for the PRF you use, measure it on the slowest hardware that must run it (a target of roughly 100 ms per derivation is the usual budget), and read the value from configuration so a deployment can raise it again without a rebuild. Where the derived value must interoperate with a format someone else fixed, the count cannot move — derive a SEPARATE value for anything you own rather than inheriting the external format's price.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×1
Untrusted text written into markup unescaped REDACTED:93— `Object.entries(THEMES).map(([theme,prefix])=>`
${prefix} [data-chart=${id}] {
${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Swallowed exception (caught, then discarded) src/renderer/routes/settings/cards/integration/use-pair-request-prompts.tsx:381— `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, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Mock-dominated test: keeps manually configured tools usable src/server/plugin/verified-ffmpeg-server.test.ts:150— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: routes task lifecycle events once to each of %i eligible sessions src/server/bridge/bootstrap.test.ts:1097— This test sets up 5 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: device-code: settle/expire push is re-emitted on the server EventBus src/server/bridge/bootstrap.test.ts:1257— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: unsubscribes the update listener when the dialog unmounts src/renderer/routes/settings/cards/about-dialog.test.tsx:650— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shows the plugin restart reminder only after a successful FFmpeg save (%s) src/renderer/routes/settings/cards/integration/integration-dialog.test.tsx:287— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: cancels both stages when navigating away src/renderer/routes/plugins/hooks/use-call-graph-preload.test.ts:45— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reports partial and whole-command failures from global actions src/renderer/routes/downloads/task-actions-menu.test.tsx:275— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: shows edit controls and dispatches numeric span actions src/renderer/routes/dashboard/components/dashboard-tile-frame.test.tsx:126— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: retains preload disposers per callback and channel without passing callbacks back across the bridge src/renderer/lib/transport/electron.test.ts:71— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: keeps completion toasts silent on %s / %s / focused=%s src/renderer/hooks/use-notification-toasts.test.tsx:218— This test sets up 3 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: stops periodic work while hidden and resynchronizes on foreground src/renderer/hooks/use-task-list.test.ts:718— This test sets up 3 test doubles (for example `vi.spyOn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: honors system reduction and renders stage actions without an animation delay src/renderer/features/legacy-import/import-motion.test.tsx:123— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reports picker activity and ignores a result after its form unmounts src/renderer/components/desktop-kit/directory-picker.test.tsx:119— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: updates drag geometry without a React update commit src/renderer/components/desktop-kit/marquee-selection/marquee-overlay.test.tsx:222— This test sets up 5 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not create a GPU context after unmounting %s src/renderer/components/desktop-kit/cubic-glass/cubic-glass-gradient.test.tsx:73— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: ignores an in-flight renderer load rejection once shutdown starts src/main/window/window-manager.test.ts:337— This test sets up 5 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: blocks navigation and redirects outside the trusted renderer URL src/main/window/window-manager.test.ts:744— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: hides macOS traffic lights after attaching the main-window preview src/main/window/window-manager.test.ts:795— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: does not enable Liquid Glass for the add-task window src/main/window/window-manager.test.ts:842— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: stops converting main-window close into hide after update quit starts src/main/window/window-manager.test.ts:996— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: ignores rejected loads from superseded navigation but reports the current failure src/main/window/window-manager.test.ts:1468— This test sets up 5 test doubles (for example `vi.fn`) against 4 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: accepts only the dev runner shutdown message src/main/quit/termination-signals.test.ts:58— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: opens add-task window with magnet in links prefill src/main/platform/protocol-manager.test.ts:400— This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: opens add-task window with url prefill for http(s)/ftp src/main/platform/protocol-manager.test.ts:431— This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: decodes motrix://new-task?uri=<http-url> and opens add-task src/main/platform/protocol-manager.test.ts:462— This test sets up 7 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Duplicated predicate src/server/bridge/remote-extension-admission-policy.ts:357— `!Array.isArray(rawHeaders) || rawHeaders.length > MAX_RAW_HEADER_ENTRIES || rawHeaders.length % 2 !== 0` appears character-identically in 2 files — src/server/bridge/remote-extension-admission-policy.ts, src/server/bridge/remote-extension-host-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 scripts/assemble-release-artifacts.mjs:480— `!Array.isArray(value.files) || value.files.length === 0` appears character-identically in 2 files — scripts/assemble-release-artifacts.mjs, scripts/verify-update-artifacts.mjs. 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 scripts/stage-electron-app.mjs:137— `!Array.isArray(values) || values.length === 0` appears character-identically in 2 files — scripts/stage-electron-app.mjs, scripts/stage-server-app.mjs. 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 scripts/release-snap-build-set.mjs:185— `!Number.isSafeInteger(attempts) || attempts < 1 || attempts > 100` appears character-identically in 2 files — scripts/release-snap-build-set.mjs, scripts/verify-snap-store-channel.mjs. 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 scripts/release-snap-build-set.mjs:188— `!Number.isSafeInteger(delayMs) || delayMs < 0 || delayMs > 300_000` appears character-identically in 2 files — scripts/release-snap-build-set.mjs, scripts/verify-snap-store-channel.mjs. 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 packages/native-host/package-flatpak-companion.mjs:333— `!Number.isSafeInteger(value) || value < 0` appears character-identically in 6 files — packages/native-host/package-flatpak-companion.mjs, scripts/electron-package-utils.mjs, scripts/server-package-utils.mjs, src/core/bridge/credential-store.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 src/core/inspector-activity/validators.ts:54— `!Number.isSafeInteger(value) || value <= 0` appears character-identically in 4 files — src/core/inspector-activity/validators.ts, src/core/lib/sqlite-integers.ts, src/server/bridge/remote-extension-admission-policy.ts, src/server/plugin/upload-store.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 src/main/plugin/verified-ffmpeg-electron.ts:35— `!['darwin', 'linux', 'win32'].includes(process.platform) || !['x64', 'arm64'].includes(process.arch)` appears character-identically in 2 files — src/main/plugin/verified-ffmpeg-electron.ts, src/server/plugin/verified-ffmpeg-server.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 src/core/legacy-import/http-request-context.ts:94— `!['http:', 'https:'].includes(url.protocol) || url.username || url.password` appears character-identically in 2 files — src/core/legacy-import/http-request-context.ts, src/core/plugin/network/plugin-http-client.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 src/renderer/components/byte-unit-sync.tsx:29— `!active || requestGeneration !== generation` appears character-identically in 2 files — src/renderer/components/byte-unit-sync.tsx, src/renderer/components/reduced-motion-sync.tsx. 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 scripts/release-snap-build-set.mjs:303— `!allowed.has(option) || value === undefined || value.startsWith('--')` appears character-identically in 2 files — scripts/release-snap-build-set.mjs, scripts/verify-snap-store-channel.mjs. 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 scripts/stage-electron-app.mjs:140— `!denied && (positive.length === 0 || positive.includes(actual))` appears character-identically in 2 files — scripts/stage-electron-app.mjs, scripts/stage-server-app.mjs. 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 src/server/bridge/remote-extension-host-policy.ts:109— `!isIssuedRemoteExtensionConfig(config) || config.status !== 'enabled'` appears character-identically in 5 files — src/server/bridge/remote-extension-host-policy.ts, src/server/bridge/remote-extension-route-policy.ts, src/server/bridge/remote-extension-startup-log.ts, src/server/bridge/remote-extension-surface-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 scripts/assemble-release-artifacts.mjs:494— `!legacyFile || legacyFile.sha512 !== value.sha512` appears character-identically in 2 files — scripts/assemble-release-artifacts.mjs, scripts/verify-update-artifacts.mjs. 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 src/renderer/routes/settings/cards/advanced-dialog.tsx:200— `!load.ready || form.formState.isSubmitting` appears character-identically in 5 files — src/renderer/routes/settings/cards/advanced-dialog.tsx, src/renderer/routes/settings/cards/appearance-dialog.tsx, src/renderer/routes/settings/cards/bit-torrent-dialog.tsx, src/renderer/routes/settings/cards/integration/integration-dialog.tsx. 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 src/renderer/features/directory-preferences/directory-preferences-section.tsx:128— `!mounted.current || current !== generation.current` appears character-identically in 2 files — src/renderer/features/directory-preferences/directory-preferences-section.tsx, src/renderer/features/directory-preferences/use-directory-preferences-draft.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 src/renderer/routes/plugins/hooks/use-plugin-graph.ts:86— `!mountedRef.current || requestVersionRef.current !== requestVersion` appears character-identically in 2 files — src/renderer/routes/plugins/hooks/use-plugin-graph.ts, src/renderer/routes/plugins/hooks/use-plugin-metadata.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 src/main/ipc/queries.ts:364— `!outputPath || typeof outputPath !== 'string'` appears character-identically in 2 files — src/main/ipc/queries.ts, src/server/ipc/queries.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 src/server/platform/nas/file-remover.ts:46— `!path.isAbsolute(candidate) || candidate.includes('\0')` appears character-identically in 3 files — src/server/platform/nas/file-remover.ts, src/server/platform/nas/files.ts, src/server/routes/torrent-creator.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 src/core/legacy-import/bt-activation-service.ts:348— `!path.isAbsolute(filename) || path.resolve(filename) !== filename || (await realpath(filename)) !== filename` appears character-identically in 2 files — src/core/legacy-import/bt-activation-service.ts, src/core/legacy-import/http-activation-service.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 src/core/settings/directory-preferences.ts:47— `!path.isAbsolute(value) || value.includes('\0')` appears character-identically in 2 files — src/core/settings/directory-preferences.ts, src/server/server-directory-service.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 REDACTED:205— `!proxyCredentials || proxyEndpoint === null` appears character-identically in 2 files — REDACTED, src/core/engine/engine-supervisor.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 src/core/legacy-import/bt-activation-service.ts:181— `!relative || relative.startsWith('..') || path.isAbsolute(relative)` appears character-identically in 4 files — src/core/legacy-import/bt-activation-service.ts, src/core/legacy-import/http-activation-service.ts, src/core/legacy-import/source-scanner.ts, src/main/legacy-import/desktop-import.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 packaging/fnos/app/lifecycle.mjs:100— `!started || exe !== (await realpath(executable)) || !matchesEntrypoint(command, entry)` appears character-identically in 2 files — packaging/fnos/app/lifecycle.mjs, packaging/synology/app/lifecycle.mjs. 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 scripts/stage-electron-app.mjs:225— `!target || (target !== canonicalRepoRoot && !isInside(canonicalRepoRoot, target))` appears character-identically in 2 files — scripts/stage-electron-app.mjs, scripts/stage-server-app.mjs. 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 scripts/fetch-builtins.mjs:141— `verifySignature` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch scripts/profile-task-inspector-activity.mts:116— `fileSize` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/bridge/file-pairing-store.ts:30— `load` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/bridge/mbp1/frames.ts:84— `base64UrlBytes` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/engine/aria2/aria2-adapter.ts:752— `getTaskPeers` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/engine/aria2/aria2-adapter.ts:1304— `getUploadLength` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/engine/aria2/aria2-process-output.ts:194— `sanitize` swallows every exception into `return '[redacted-url]'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/capabilities/http-cookies.ts:296— `cookieHeader` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/capabilities/i18n.ts:65— `readDict` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/plugin-registry.ts:185— `loadLocale` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/hooks/audit-view.ts:25— `sanitizeForAudit.uris` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/install/plugin-installer.ts:185— `loadManifestLocale` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/plugin/install/server-ack.ts:71— `parseAllowlist` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch REDACTED:318— `inAria2CidrBlock` swallows every exception into `return 'unsupported'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/session/motrix-database.ts:1588— `parseTrackers` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/session/motrix-database.ts:1600— `parseUris` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/core/session/motrix-database.ts:1612— `parsePayload` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/main/bridge/safari-bootstrap-registration.ts:46— `registerSafariBootstrap` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/renderer/routes/dashboard/tiles/transfer-tile.tsx:80— `parseByteCount` swallows every exception into `return 0n` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/renderer/routes/downloads/inspector/use-task-actions.ts:56— `errMsg` swallows every exception into `return 'unknown'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/renderer/components/add-task/pending-create-inputs.ts:25— `readPendingCreates` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/renderer/platform/web-services.ts:152— `createWebServices.readClipboard` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/shared/lib/log-redact.ts:392— `headerNames` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch src/shared/schemas/create-torrent.ts:24— `url` swallows every exception into `return false` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. 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 on the handler or in the docstring, and the row stops firing.
Disabled test e2e/application-menu.spec.ts:161— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/application-menu.spec.ts:177— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/bridge/appimage-cold-launch.spec.ts:101— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/bridge/appimage-cold-launch.spec.ts:110— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/bridge/native-messaging-registration.spec.ts:15— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/download-progress.spec.ts:31— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/hidden-window-startup.spec.ts:17— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/legacy-bt-activation.spec.ts:53— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/legacy-http-activation.spec.ts:42— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/media-settings.spec.ts:13— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/renderer-recovery-soak.spec.ts:11— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/renderer-recovery.spec.ts:421— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/task-http-resume.spec.ts:99— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test e2e/window-chrome/window-chrome.native.ts:115— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test src/core/task/direct-task-retry.integration.test.ts:105— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
Disabled test tests/integration/community-plugin-install.test.ts:13— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
redundant comment src/core/bridge-receiver/bridge-receiver.test.ts:524— "Set up resolveToMux to return a mux pair" repeats the code it sits on: 4 of its 5 words (set, resolve, mux, return) are already in `const resolveToMux = vi.fn(async (_url: string) => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/bridge-receiver/pipelines/hls-dash-pipeline.test.ts:59— "An audio media playlist" repeats the code it sits on: 3 of its 3 words (audio, media, playlist) are already in `const AUDIO_MEDIA = `#EXTM3U`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/media/dash-parser.test.ts:67— "── SegmentList (with mediaRange + Initialization) ──" repeats the code it sits on: 5 of its 5 words (segment, list, media, range, initialization) are already in `const SEGLIST_MPD = `<?xml version="1.0"?>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/media/dash-parser.test.ts:168— "── No video representations ──" repeats the code it sits on: 3 of its 3 words (no, video, representations) are already in `const NO_VIDEO_MPD = `<?xml version="1.0"?>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/media/hls-parser.test.ts:38— "VOD with fMP4 via EXT-X-MAP" repeats the code it sits on: 4 of its 4 words (vod, mp, ext, map) are already in `const MEDIA_VOD_FMP4 = `#EXTM3U`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/media/segment-decryptor.test.ts:158— "Call getKey twice with the same URI" repeats the code it sits on: 4 of its 5 words (call, get, key, uri) are already in `const result1 = await decryptor.getKey(uri)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/plugin/capabilities/http-cookies.test.ts:74— 6 comments in this file only repeat the code they sit on (lines 74, 86, 193, 217, 234, 240), for example "Max-Age overrides Expires". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/plugin/host/capability-bridge.phase.test.ts:404— "AppError.code = ErrorCode.PluginRuntimeFault = 'PLUGIN_RUNTIME_FAULT'" repeats the code it sits on: 5 of its 6 words (error, code, plugin, runtime, fault) are already in `expect(resp.error.code).toBe('PLUGIN_RUNTIME_FAULT')`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/plugin/install/source-resolver.test.ts:106— "sourceUrlEquals" repeats the code it sits on: 3 of its 3 words (source, url, equals) are already in `it('sourceUrlEquals compares exact url strings', () =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/probe/disk-probe-win32.ts:30— "Get-Volume output format: FileSystemType DriveType SizeRemaining" repeats the code it sits on: 9 of its 10 words (get, volume, format, file, system, type, drive, size, remaining) are already in `const volumeOut = await exec('powershell', [`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment src/core/task/actions/shared.test.ts:477— "First: poll detects Downloading -> Error." repeats the code it sits on: 4 of its 5 words (first, poll, downloading, error) are already in `const first = await commitPolledTerminalTransition(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
IC1 · Incompleteness & stubs· Empty method body · ×5
Empty method body src/core/plugin/host/plugin-host.ts:178— `unsubscribeLocale` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body src/core/plugin/host/plugin-host.ts:180— `unsubscribeSecurity` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body src/core/plugin/post/delivery-observability.ts:69— `emit` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body src/renderer/components/desktop-kit/cubic-glass/renderer.ts:28— `schedule` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Empty method body src/shared/i18n-resources.ts:76— `init` has an empty body — confirm it's an intentional no-op and not an unfinished method.
Interpolated log message defeats structured logging src/main/window/window-manager.ts:598— `error` at line 598 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/core/task/actions/shared.ts:230— `warn` at line 230 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/core/task/actions/shared.ts:252— `warn` at line 252 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/core/task/actions/shared.ts:384— `warn` at line 384 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
Interpolated log message defeats structured logging src/core/task/actions/shared.ts:393— `warn` at line 393 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
P2 · Observability· Console output used as the logging channel · ×4
Console output used as the logging channel src/renderer/routes/dashboard/components/tile-error-boundary.tsx:45— `src/renderer/routes/dashboard/components/tile-error-boundary.tsx` reports through `console.*` at line 45 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/renderer/lib/notification-text.ts:21— `src/renderer/lib/notification-text.ts` reports through `console.*` at line 21 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel src/core/plugin/capabilities/commands.ts:138— `src/core/plugin/capabilities/commands.ts` reports through `console.*` at line 138 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/safari-bootstrap/test-integration.mjs:113— `packages/safari-bootstrap/test-integration.mjs` reports through `console.*` at line 113 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Fat interface: EngineAdapter (35 required operations) src/core/engine/engine-adapter.ts:202— `EngineAdapter` declares 35 required operations: `setTaskBtTracker`, `connect`, `disconnect`, `getCapabilities`, `getFeatureReport`, `createDownload`, `pauseTask`, `resumeTask`, `removeTask`, `forceRemoveTask`, `getEngineTaskOptions`, `pauseAll`, `resumeAll`, `changePosition`, `getTaskStatus`, `getTaskFiles`, `changeOption`, `getTaskPieces`, `getTaskPeers`, `getGlobalStats`, `addTorrent`, `getTaskBtTracker`, `removeDownloadResult`, `removeDownloadResults`, `getUploadLength`, `listActiveAndWaiting`, `listWaitingTaskIds`, `listStopped`, `getHistoryCount`, `searchHistory`, `exportSession`, `requeueFromHistory`, `onBtDownloadComplete`, `onDownloadComplete`, `onDownloadError`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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: CapabilityHost (16 required operations) src/core/plugin/capabilities/interface.ts:53— `CapabilityHost` declares 16 required operations: `createLog`, `getTail`, `clearLog`, `setLogVerbose`, `isLogVerbose`, `getLogState`, `subscribeLog`, `appSnapshot`, `i18nSnapshot`, `setLocale`, `onLocaleChange`, `flush`, `fsTaskFor`, `fsStorageFor`, `configFor`, `cookieJarFor`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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: SelectionState (16 required operations) src/renderer/components/desktop-kit/selection/types.ts:3— `SelectionState` declares 16 required operations: `select`, `toggle`, `rangeSelect`, `selectAll`, `clearSelection`, `setItems`, `marqueeSelect`, `marqueeEnd`, `moveFocus`, `focusedSelect`, `shiftMoveFocus`, `focus`, `extendSelection`, `moveSelection`, `isSelected`, `selectedCount`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. 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.
README/code drift README.md:270— README.md names Electron 44, but the manifest declares `electron` 45.2.3. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift docs/production-builds.md:116— docs/production-builds.md names Electron 44, but the manifest declares `electron` 45.2.3. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
No app-layer HTTPS enforcement detected src/core/bridge/web-socket-bridge-server.ts:969— `http.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
No app-layer HTTPS enforcement detected src/server/platform/nas/client-gateway.ts:166— `server.listen(…)` serves plain HTTP on a network address, and nothing in its package enforces HTTPS: no TLS served (`https.createServer`, Fastify `https`, Nest `httpsOptions`), no redirect of plain requests to `https://`, no `Strict-Transport-Security` (helmet sends it by default), and no TLS-terminating proxy configuration committed beside it — so a browser may talk to it in clear text. (−2.0 on this card.)
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies src/core/bridge/web-socket-bridge-server.ts:1019— Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
No ADRs found package.json:20— 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 `package.json` makes this repository a deployable product (line 20).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 4 project(s) overshoot their size bounds, lowering Project Cohesion to 5.0/10. The most over is `(repository root)` (248811 LoC, 2645 module-visible types across 161 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
DM9 · Scattered domain decisions· Rule about [digest, identity] decided in 2 places · ×1
Rule about [digest, identity] decided in 2 places — src.core.legacy-import.source-scanner.LegacySnapshotFile's [digest, identity] are judged in src.core.legacy-import.bt-activation-service.LegacyBtActivationService, src.core.legacy-import.source-scanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [identity, root] decided in 3 places · ×1
Rule about [identity, root] decided in 3 places — src.core.legacy-import.source-scanner.LegacySource's [identity, root] are judged in src.core.legacy-import.bt-activation-service.LegacyBtActivationService, src.core.legacy-import.http-activation-service.LegacyHttpActivationService, src.core.legacy-import.import-service.LegacyImportService — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [code, details] decided in 2 places · ×1
Rule about [code, details] decided in 2 places — src.core.plugin.finalize.filesystem-adapter.FinalizeFsError's [code, details] are judged in src.core.plugin.finalize.finalize-committer.FinalizeCommitter, src.core.plugin.finalize.finalize-recovery-errors — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [downloadBytes, uploadBytes] decided in 3 places · ×1
Rule about [downloadBytes, uploadBytes] decided in 3 places — src.core.stats.transfer-stats-store.TransferDelta's [downloadBytes, uploadBytes] are judged in src.core.stats.transfer-stats-service.TransferStatsService, src.core.stats.transfer-stats-store, src.core.stats.transfer-stats-store.TransferStatsStore — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [endAt, startAt] decided in 2 places · ×1
Rule about [endAt, startAt] decided in 2 places — src.renderer.routes.downloads.inspector.activity-chart-model.ActivityPauseBand's [endAt, startAt] are judged in src.renderer.routes.downloads.inspector.activity-chart-model, src.renderer.routes.downloads.inspector.lifetime-transfer-card — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
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: `packages/finalize-fs`.
No dependency-update automation package.json:99— `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 'LOCAL_CONTEXT_FILE' · ×1
Unused export 'LOCAL_CONTEXT_FILE' scripts/obsidian-docs-lib.mjs:14— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_CREATE_CONTENT_BYTES' · ×1
Unused export 'MAX_CREATE_CONTENT_BYTES' scripts/obsidian-docs-lib.mjs:15— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'serverPackageTargets' · ×1
Unused export 'serverPackageTargets' scripts/server-package-utils.mjs:510— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_ENVELOPE_BLOCKS' · ×1
Unused export 'MAX_ENVELOPE_BLOCKS' REDACTED:59— Nothing imports this binding — it is safe to review for removal.
Unused export 'PakeBFrame' src/core/bridge/mbp1/frames.ts:188— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ConfirmAFrame' · ×1
Unused export 'ConfirmAFrame' src/core/bridge/mbp1/frames.ts:206— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ConfirmBFrame' · ×1
Unused export 'ConfirmBFrame' src/core/bridge/mbp1/frames.ts:216— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CredentialOfferFrame' · ×1
Unused export 'CredentialOfferFrame' src/core/bridge/mbp1/frames.ts:231— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CredentialAckFrame' · ×1
Unused export 'CredentialAckFrame' src/core/bridge/mbp1/frames.ts:241— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'CredentialCommittedFrame' · ×1
Unused export 'CredentialCommittedFrame' src/core/bridge/mbp1/frames.ts:250— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ReconnectResponseFrame' · ×1
Unused export 'ReconnectResponseFrame' src/core/bridge/mbp1/frames.ts:285— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_SAFE_SQLITE_INTEGER' · ×1
Unused export 'MAX_SAFE_SQLITE_INTEGER' src/core/inspector-activity/validators.ts:11— Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/inspector-activity/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/inspector-activity/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'MAX_SAMPLE_FLAGS' · ×1
Unused export 'MAX_SAMPLE_FLAGS' src/core/inspector-activity/validators.ts:19— Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/inspector-activity/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/inspector-activity/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'CookieJarError' · ×1
Unused export 'CookieJarError' src/core/plugin/capabilities/http-cookies.ts:47— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'BridgeMessageId' · ×1
Unused export 'BridgeMessageId' src/core/plugin/host/bridge-protocol.ts:22— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'BridgeHookScope' · ×1
Unused export 'BridgeHookScope' src/core/plugin/host/bridge-protocol.ts:79— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'POST_DELIVERY_TOMBSTONE_MAX_BYTES' · ×1
Unused export 'POST_DELIVERY_TOMBSTONE_MAX_BYTES' src/core/plugin/post/delivery-retention.ts:23— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'PostDeliveryQuotaTombstone' · ×1
Unused export 'PostDeliveryQuotaTombstone' src/core/plugin/post/delivery-types.ts:136— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'TRANSFER_PRUNE_INTERVAL_MS' · ×1
Unused export 'TRANSFER_PRUNE_INTERVAL_MS' src/core/stats/transfer-stats-service.ts:14— Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/stats/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/stats/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'MAX_WALL_MONOTONIC_DRIFT_MS' · ×1
Unused export 'MAX_WALL_MONOTONIC_DRIFT_MS' src/core/stats/transfer-stats-service.ts:16— Nothing ultimately consumes this binding: its only referrer is the re-export in src/core/stats/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in src/core/stats/index.ts in the same commit, or the barrel will import a name that no longer exists.
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 23/31 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X23 · Unguarded diagnostic materialisation· Diagnostic log message is built whether or not it is wanted · ×1
Diagnostic log message is built whether or not it is wanted src/core/plugin/hooks/hook-orchestrator.ts:634— `debug` at line 634 is called with an argument built by `active.map((p) => p.id)` (line 639), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Null assertions (`!`) override strict null checking — ~0.3 `!` null assertions per 1k TypeScript source lines — 60 assertion(s) across the 233188 source line(s) of the 1368 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: src/core/session/motrix-database.ts (32), src/core/plugin/capabilities/ffmpeg.ts (4), src/core/inspector-activity/task-inspector-activity-runtime.ts (3). 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.
Silent fallback default on Err packages/native-host/src/safari_bootstrap.rs:162— `motrix_safari_bootstrap_v2` turns every `Err` into `SafariBootstrapResult::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 on the arm or in the doc comment, and the row stops firing.
Skipped (documented): (unnamed test) tests/ffmpeg-public-release.test.ts:210— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/ensure-native-abi.test.ts:95— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/fnos-publication.test.ts:6— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/safari-desktop-package.test.ts:25— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) tests/scripts/snap-project.test.ts:283— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/snap-publication.test.ts:4— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/synology-package.test.ts:13— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/synology-package.test.ts:44— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/synology-package.test.ts:94— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/synology-package.test.ts:195— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) tests/scripts/workflow-release-matrix.test.ts:1084— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/server/platform/synology/files.test.ts:9— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/server/platform/fnos/routes.test.ts:22— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/server/platform/fnos/routes.test.ts:74— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/server/http/torrent-upload.integration.test.ts:38— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/main/platform/task-file-remover.test.ts:84— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/main/bridge/bootstrap-lifecycle.test.ts:479— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) src/main/bridge/bootstrap-lifecycle.test.ts:499— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) src/main/bridge/native-host-path.test.ts:163— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/main/bridge/windows-desktop-startup-recovery.test.ts:119— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Skipped (documented): (unnamed test) src/core/task/bt-direct-storage.integration.test.ts:174— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): (unnamed test) src/core/task/bt-direct-storage.integration.test.ts:329— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): reserves case-insensitive pending BT output names src/core/task/bt-output-admission.integration.test.ts:62— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): (unnamed test) src/core/task/bt-output-admission.integration.test.ts:105— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): keeps the original task and partial bytes: %j src/core/task/direct-task-retry.integration.test.ts:39— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Outdated: libc — `libc` is locked at 0.2.189 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in packages/finalize-fs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: rustix — `rustix` is locked at 1.1.4 but 1.1.6 is the current stable release on crates.io, and it already satisfies the `"1.1"` requirement declared in packages/finalize-fs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustix` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in packages/finalize-fs/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
doc comments repeat the names src/core/bridge/mbp1/frames.ts:208— 0 of 17 documented parameters and 3 of 2205 summaries in `motrix-turbo` only repeat the member or parameter name (e.g. "`confirmB` (B→A, §6.1, §6.5)." for `confirmBFrameSchema`). 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 44 file(s) — `e2e/window-chrome/vite.config.ts`, `scripts/build-fnos-package.mjs`, `scripts/prepare-fnos-project.mjs`, `scripts/prepare-synology-project.mjs`, `scripts/synology-target.mjs`, … (+39 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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 01a1d5bf-108b-70d3-879f-0a0dd0e5aa93 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 39 · Warnings: 1621 · Recommendations: 256 · Info: 57 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 13-11-2026 @ 16:30 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.