Public report of junhoyeo/tokscale, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 19:02 UTC · Survey ID cd_85266369701b4396bb16b7bc8e65523d
junhoyeo/tokscale
Measured 14 November 2026, 19:00 UTC, at code version 1ac15d3
CAI scoreAt riskNo change 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: 346,288 lines of product code in 14 projects, tests not counted · Estimated rebuild effort: about 2.5 person-years · Weakest lens: Security and Compliance, 33
Findings by how serious they are
96 critical1293 serious119 minor
15 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
14 November 2026, 19:00 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
71of 71 dimensions measured by tools.
1465of 1508 findings point to an exact file and line, so you can open each one in the code. The other 43 concern the repository as a whole, such as missing documentation.
71dimensions across 8 lenses, read from 346,288 lines of product code in 14 projects.
junhoyeo/tokscale is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because we found no encryption of stored data, no key vault and no enforced HTTPS, and two of the dependencies have a known vulnerability. It scores 46 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 33, is the weakest lens and counts most in the score. The best first step is encrypting the sensitive stored data and keeping its keys in a vault, worth about 10 points. Restoring certificate checks is another step, worth about 5 points. Raising Security and Compliance to 70 would lift the score to about 57.
Sixty-one pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Eighteen known security holes in the packages the code depends on can be used by attackers, and ten weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and the pipeline step that installs packages without pinning their versions needs the packages it installs pinned to exact versions. The form field without a label needs a label.
The product code is 346,288 lines, about €370,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 Security and Compliance rose from 33 to 70, the lowest score rated Strong, the score would rise from 46 to about 57.
Code composition: what the lines of code are
Product code 84%Tests 16%
New since the last survey: 418 findings
These 418 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FunctionTooLong: tokscale_core::sessions::qoder::extract_usage_breakdown crates/tokscale-core/src/sessions/qoder.rs
God Classes · FileTooLong: usage/copilot.rs crates/tokscale-cli/src/commands/usage/copilot.rs
Code Duplication · Near-duplicate member family (4 members, 19 shared lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Near-duplicate member family (3 members, 33 shared lines) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs
Code Duplication · Edited copy of a member (17 corresponding lines) crates/tokscale-core/src/sessions/opencode_schema.rs
Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) crates/tokscale-cli/src/tui/ui/agents.rs
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) crates/tokscale-core/src/lib.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/tokscale-core/src/cc_mirror.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
Code Duplication · Edited copy of a member (423 corresponding lines) crates/tokscale-cli/src/tui/i18n.rs
Code Duplication · Edited copy of a member (46 corresponding lines) crates/tokscale-core/src/aggregator.rs
Code Duplication · Edited copies of one member (3 members, 30+ corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copy of a member (35 corresponding lines) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Edited copy of a member (46 corresponding lines) crates/tokscale-core/src/aggregator.rs
Code Duplication · Edited copy of a member (44 corresponding lines) crates/tokscale-core/src/aggregator.rs
Code Duplication · Edited copy of a member (40 corresponding lines) crates/tokscale-cli/src/tui/data/mod.rs
Code Duplication · Edited copy of a member (48 corresponding lines) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Edited copy of a member (47 corresponding lines) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Edited copy of a member (39 corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs
Code Duplication · Edited copy of a member (37 corresponding lines) crates/tokscale-cli/src/main.rs
Code Duplication · Edited copies of one member (3 members, 39+ corresponding lines) REDACTED
Code Duplication · Edited copy of a member (34 corresponding lines) crates/tokscale-cli/src/cursor.rs
Code Duplication · Edited copy of a member (39 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copy of a member (31 corresponding lines) crates/tokscale-cli/src/tui/ui/mod.rs
Code Duplication · Edited copy of a member (17 corresponding lines) crates/tokscale-cli/src/tui/ui/projects.rs
Code Duplication · Edited copy of a member (20 corresponding lines) crates/tokscale-core/src/lib.rs
Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copy of a member (26 corresponding lines) crates/tokscale-core/src/pricing/litellm.rs
Code Duplication · Edited copy of a member (22 corresponding lines) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs
Code Duplication · Edited copy of a member (15 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copy of a member (26 corresponding lines) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Edited copy of a member (30 corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copy of a member (25 corresponding lines) crates/tokscale-core/src/sessions/lmstudio.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/tokscale-core/src/scanner.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copies of one member (3 members, 27+ corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copy of a member (22 corresponding lines) crates/tokscale-cli/src/commands/usage/mod.rs
Code Duplication · Edited copy of a member (19 corresponding lines) crates/tokscale-core/src/sessions/utils.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/tokscale-core/src/sessions/crush.rs
Code Duplication · Edited copy of a member (18 corresponding lines) crates/tokscale-core/src/claude_desktop/v8.rs
Code Duplication · Edited copy of a member (26 corresponding lines) crates/tokscale-cli/src/commands/usage/opencode_go.rs
Code Duplication · Edited copy of a member (13 corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/tokscale-cli/src/tui/cache.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/tokscale-core/src/provider_identity.rs
Code Duplication · Edited copy of a member (20 corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copy of a member (18 corresponding lines) crates/tokscale-cli/src/commands/usage/minimax.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs
Code Duplication · Edited copy of a member (14 corresponding lines) REDACTED
Code Duplication · Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/antigravity.rs
Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) crates/tokscale-cli/src/commands/usage/copilot.rs
Code Duplication · Edited copy of a member (19 corresponding lines) crates/tokscale-core/src/scanner.rs
Code Duplication · Edited copy of a member (15 corresponding lines) crates/tokscale-core/src/sessions/grok.rs
Code Duplication · Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/tui/app.rs
Code Duplication · Edited copies of one member (3 members, 17+ corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs
Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) crates/tokscale-cli/src/submission_warnings.rs
Code Duplication · Edited copy of a member (8 corresponding lines) crates/tokscale-core/src/sessions/cline.rs
Code Duplication · Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/commands/autosubmit.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs
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: 413 findings
These 413 critical or serious findings were in the previous survey, on 28 October 2026, and are gone from this one. The first 100 are listed here.
€120,000 to €620,000, for 2,052 to 6,511 hours of work, about 2.5 person-years for 1 to 5 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 46. 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: 346,288 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
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs).
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 10 points · Medium effort · Data Protection
2
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (2), REDACTED.
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
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 €370,000 to build again, about 2.5 person-years of work. Its weakest lens is Security and Compliance, at 33 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Of all the actions in this report, it raises the score most for the work it takes: about 10 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 270,661 lines over the last 90 days, which is about 1,097,681 lines a year. At that pace, the extra work comes to an estimated 109.8 to 658.6 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.
496 modules, with 560 dependencies between them. 5 loops run through 32 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 456 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.
packages.frontend.src.components.explore uses packages.frontend.src.lib.explore.types, so a change to packages.frontend.src.lib.explore.types can break packages.frontend.src.components.explore, while a change to packages.frontend.src.components.explore can't break packages.frontend.src.lib.explore.types.
Position
Below the diagonal: packages.frontend.src.components.explore uses a module listed above it, which is the healthy direction.
packages.frontend.src.components.home uses packages.frontend.src.lib.explore.types, so a change to packages.frontend.src.lib.explore.types can break packages.frontend.src.components.home, while a change to packages.frontend.src.components.home can't break packages.frontend.src.lib.explore.types.
Position
Below the diagonal: packages.frontend.src.components.home uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.embed.getUserEmbedStats uses packages.frontend.src.lib.embed.embedShared, so a change to packages.frontend.src.lib.embed.embedShared can break packages.frontend.src.lib.embed.getUserEmbedStats, while a change to packages.frontend.src.lib.embed.getUserEmbedStats can't break packages.frontend.src.lib.embed.embedShared.
Position
Below the diagonal: packages.frontend.src.lib.embed.getUserEmbedStats uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.groups uses packages.frontend.src.app.(main).groups.[slug].GroupDetailClient, so a change to packages.frontend.src.app.(main).groups.[slug].GroupDetailClient can break packages.frontend.src.lib.groups, while a change to packages.frontend.src.lib.groups can't break packages.frontend.src.app.(main).groups.[slug].GroupDetailClient.
Position
Below the diagonal: packages.frontend.src.lib.groups uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.groups uses packages.frontend.src.lib.leaderboard.types, so a change to packages.frontend.src.lib.leaderboard.types can break packages.frontend.src.lib.groups, while a change to packages.frontend.src.lib.groups can't break packages.frontend.src.lib.leaderboard.types.
Position
Below the diagonal: packages.frontend.src.lib.groups uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.types uses packages.frontend.src.lib.themes, so a change to packages.frontend.src.lib.themes can break packages.frontend.src.lib.types, while a change to packages.frontend.src.lib.types can't break packages.frontend.src.lib.themes.
Position
Below the diagonal: packages.frontend.src.lib.types uses a module listed above it, which is the healthy direction.
18→28 tokscale_core.pricing uses tokscale_core.sessionspart of a loop✕
Connections
3 pairs of types, where a type in tokscale_core.pricing uses a type in tokscale_core.sessions.
tokscale_core.pricing uses tokscale_core.sessions, so a change to tokscale_core.sessions can break tokscale_core.pricing, while a change to tokscale_core.pricing can't break tokscale_core.sessions.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→33 tokscale_core.pricing uses tokscale_corepart of a loop✕
Connections
4 pairs of types, where a type in tokscale_core.pricing uses a type in tokscale_core.
tokscale_core.pricing uses tokscale_core, so a change to tokscale_core can break tokscale_core.pricing, while a change to tokscale_core.pricing can't break tokscale_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_core.scanner uses tokscale_core.clients, so a change to tokscale_core.clients can break tokscale_core.scanner, while a change to tokscale_core.scanner can't break tokscale_core.clients.
Position
Below the diagonal: tokscale_core.scanner uses a module listed above it, which is the healthy direction.
packages.frontend.src.components uses packages.frontend.src.lib.types, so a change to packages.frontend.src.lib.types can break packages.frontend.src.components, while a change to packages.frontend.src.components can't break packages.frontend.src.lib.types.
Position
Below the diagonal: packages.frontend.src.components uses a module listed above it, which is the healthy direction.
packages.frontend.src.components.profile uses packages.frontend.src.lib.embed.embedShared, so a change to packages.frontend.src.lib.embed.embedShared can break packages.frontend.src.components.profile, while a change to packages.frontend.src.components.profile can't break packages.frontend.src.lib.embed.embedShared.
Position
Below the diagonal: packages.frontend.src.components.profile uses a module listed above it, which is the healthy direction.
packages.frontend.src.components.profile uses packages.frontend.src.lib.themes, so a change to packages.frontend.src.lib.themes can break packages.frontend.src.components.profile, while a change to packages.frontend.src.components.profile can't break packages.frontend.src.lib.themes.
Position
Below the diagonal: packages.frontend.src.components.profile uses a module listed above it, which is the healthy direction.
packages.frontend.src.components.profile uses packages.frontend.src.lib.types, so a change to packages.frontend.src.lib.types can break packages.frontend.src.components.profile, while a change to packages.frontend.src.components.profile can't break packages.frontend.src.lib.types.
Position
Below the diagonal: packages.frontend.src.components.profile uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib uses packages.frontend.src.lib.themes, so a change to packages.frontend.src.lib.themes can break packages.frontend.src.lib, while a change to packages.frontend.src.lib can't break packages.frontend.src.lib.themes.
Position
Below the diagonal: packages.frontend.src.lib uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib uses packages.frontend.src.lib.types, so a change to packages.frontend.src.lib.types can break packages.frontend.src.lib, while a change to packages.frontend.src.lib can't break packages.frontend.src.lib.types.
Position
Below the diagonal: packages.frontend.src.lib uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.db uses packages.frontend.src.lib.explore.types, so a change to packages.frontend.src.lib.explore.types can break packages.frontend.src.lib.db, while a change to packages.frontend.src.lib.db can't break packages.frontend.src.lib.explore.types.
Position
Below the diagonal: packages.frontend.src.lib.db uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.db uses packages.frontend.src.lib.types, so a change to packages.frontend.src.lib.types can break packages.frontend.src.lib.db, while a change to packages.frontend.src.lib.db can't break packages.frontend.src.lib.types.
Position
Below the diagonal: packages.frontend.src.lib.db uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.embed uses packages.frontend.src.lib.embed.embedShared, so a change to packages.frontend.src.lib.embed.embedShared can break packages.frontend.src.lib.embed, while a change to packages.frontend.src.lib.embed can't break packages.frontend.src.lib.embed.embedShared.
Position
Below the diagonal: packages.frontend.src.lib.embed uses a module listed above it, which is the healthy direction.
packages.frontend.src.lib.embed uses packages.frontend.src.lib.embed.getUserEmbedStats, so a change to packages.frontend.src.lib.embed.getUserEmbedStats can break packages.frontend.src.lib.embed, while a change to packages.frontend.src.lib.embed can't break packages.frontend.src.lib.embed.getUserEmbedStats.
Position
Below the diagonal: packages.frontend.src.lib.embed uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.settings uses tokscale_cli.tui.themes, so a change to tokscale_cli.tui.themes can break tokscale_cli.tui.settings, while a change to tokscale_cli.tui.settings can't break tokscale_cli.tui.themes.
Position
Below the diagonal: tokscale_cli.tui.settings uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.settings uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_cli.tui.settings, while a change to tokscale_cli.tui.settings can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_cli.tui.settings uses a module listed above it, which is the healthy direction.
25→29 tokscale_cli.tui.settings uses tokscale_cli.tui.i18npart of a loop✕
Connections
1 pair of types, where a type in tokscale_cli.tui.settings uses a type in tokscale_cli.tui.i18n.
tokscale_cli.tui.settings uses tokscale_cli.tui.i18n, so a change to tokscale_cli.tui.i18n can break tokscale_cli.tui.settings, while a change to tokscale_cli.tui.settings can't break tokscale_cli.tui.i18n.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_core.bucket_tz uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_core.bucket_tz, while a change to tokscale_core.bucket_tz can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_core.bucket_tz uses a module listed above it, which is the healthy direction.
tokscale_cli.ui_glyphs uses tokscale_cli.tui.settings, so a change to tokscale_cli.tui.settings can break tokscale_cli.ui_glyphs, while a change to tokscale_cli.ui_glyphs can't break tokscale_cli.tui.settings.
Position
Below the diagonal: tokscale_cli.ui_glyphs uses a module listed above it, which is the healthy direction.
tokscale_core.sessions uses tokscale_core.sessions.shared_str, so a change to tokscale_core.sessions.shared_str can break tokscale_core.sessions, while a change to tokscale_core.sessions can't break tokscale_core.sessions.shared_str.
Position
Below the diagonal: tokscale_core.sessions uses a module listed above it, which is the healthy direction.
tokscale_core.sessions uses tokscale_core.pricing, so a change to tokscale_core.pricing can break tokscale_core.sessions, while a change to tokscale_core.sessions can't break tokscale_core.pricing.
Position
Below the diagonal: tokscale_core.sessions uses a module listed above it, which is the healthy direction.
tokscale_core.sessions uses tokscale_core.bucket_tz, so a change to tokscale_core.bucket_tz can break tokscale_core.sessions, while a change to tokscale_core.sessions can't break tokscale_core.bucket_tz.
Position
Below the diagonal: tokscale_core.sessions uses a module listed above it, which is the healthy direction.
28→32 tokscale_core.sessions uses tokscale_core.message_cachepart of a loop✕
Connections
4 pairs of types, where a type in tokscale_core.sessions uses a type in tokscale_core.message_cache.
tokscale_core.sessions uses tokscale_core.message_cache, so a change to tokscale_core.message_cache can break tokscale_core.sessions, while a change to tokscale_core.sessions can't break tokscale_core.message_cache.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
28→33 tokscale_core.sessions uses tokscale_corepart of a loop✕
Connections
1 pair of types, where a type in tokscale_core.sessions uses a type in tokscale_core.
tokscale_core.sessions uses tokscale_core, so a change to tokscale_core can break tokscale_core.sessions, while a change to tokscale_core.sessions can't break tokscale_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_cli.tui.i18n uses tokscale_cli.ui_glyphs, so a change to tokscale_cli.ui_glyphs can break tokscale_cli.tui.i18n, while a change to tokscale_cli.tui.i18n can't break tokscale_cli.ui_glyphs.
Position
Below the diagonal: tokscale_cli.tui.i18n uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog uses tokscale_cli.tui.themes, so a change to tokscale_cli.tui.themes can break tokscale_cli.tui.ui.dialog, while a change to tokscale_cli.tui.ui.dialog can't break tokscale_cli.tui.themes.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog uses tokscale_cli.ui_glyphs, so a change to tokscale_cli.ui_glyphs can break tokscale_cli.tui.ui.dialog, while a change to tokscale_cli.tui.ui.dialog can't break tokscale_cli.ui_glyphs.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog uses a module listed above it, which is the healthy direction.
tokscale_core.sessions.opencode_schema uses tokscale_core.sessions.shared_str, so a change to tokscale_core.sessions.shared_str can break tokscale_core.sessions.opencode_schema, while a change to tokscale_core.sessions.opencode_schema can't break tokscale_core.sessions.shared_str.
Position
Below the diagonal: tokscale_core.sessions.opencode_schema uses a module listed above it, which is the healthy direction.
tokscale_core.sessions.opencode_schema uses tokscale_core.sessions, so a change to tokscale_core.sessions can break tokscale_core.sessions.opencode_schema, while a change to tokscale_core.sessions.opencode_schema can't break tokscale_core.sessions.
Position
Below the diagonal: tokscale_core.sessions.opencode_schema uses a module listed above it, which is the healthy direction.
31→33 tokscale_core.sessions.opencode_schema uses tokscale_corepart of a loop✕
Connections
1 pair of types, where a type in tokscale_core.sessions.opencode_schema uses a type in tokscale_core.
tokscale_core.sessions.opencode_schema uses tokscale_core, so a change to tokscale_core can break tokscale_core.sessions.opencode_schema, while a change to tokscale_core.sessions.opencode_schema can't break tokscale_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_core.message_cache uses tokscale_core.clients, so a change to tokscale_core.clients can break tokscale_core.message_cache, while a change to tokscale_core.message_cache can't break tokscale_core.clients.
Position
Below the diagonal: tokscale_core.message_cache uses a module listed above it, which is the healthy direction.
tokscale_core.message_cache uses tokscale_core.sessions, so a change to tokscale_core.sessions can break tokscale_core.message_cache, while a change to tokscale_core.message_cache can't break tokscale_core.sessions.
Position
Below the diagonal: tokscale_core.message_cache uses a module listed above it, which is the healthy direction.
tokscale_core.message_cache uses tokscale_core.sessions.opencode_schema, so a change to tokscale_core.sessions.opencode_schema can break tokscale_core.message_cache, while a change to tokscale_core.message_cache can't break tokscale_core.sessions.opencode_schema.
Position
Below the diagonal: tokscale_core.message_cache uses a module listed above it, which is the healthy direction.
32→33 tokscale_core.message_cache uses tokscale_corepart of a loop✕
Connections
3 pairs of types, where a type in tokscale_core.message_cache uses a type in tokscale_core.
tokscale_core.message_cache uses tokscale_core, so a change to tokscale_core can break tokscale_core.message_cache, while a change to tokscale_core.message_cache can't break tokscale_core.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_core uses tokscale_core.clients, so a change to tokscale_core.clients can break tokscale_core, while a change to tokscale_core can't break tokscale_core.clients.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.sessions.shared_str, so a change to tokscale_core.sessions.shared_str can break tokscale_core, while a change to tokscale_core can't break tokscale_core.sessions.shared_str.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.pricing, so a change to tokscale_core.pricing can break tokscale_core, while a change to tokscale_core can't break tokscale_core.pricing.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_core, while a change to tokscale_core can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.bucket_tz, so a change to tokscale_core.bucket_tz can break tokscale_core, while a change to tokscale_core can't break tokscale_core.bucket_tz.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.sessions, so a change to tokscale_core.sessions can break tokscale_core, while a change to tokscale_core can't break tokscale_core.sessions.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.message_cache, so a change to tokscale_core.message_cache can break tokscale_core, while a change to tokscale_core can't break tokscale_core.message_cache.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.report uses tokscale_core.sessions.shared_str, so a change to tokscale_core.sessions.shared_str can break tokscale_cli.commands.report, while a change to tokscale_cli.commands.report can't break tokscale_core.sessions.shared_str.
Position
Below the diagonal: tokscale_cli.commands.report uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.report uses tokscale_core.pricing, so a change to tokscale_core.pricing can break tokscale_cli.commands.report, while a change to tokscale_cli.commands.report can't break tokscale_core.pricing.
Position
Below the diagonal: tokscale_cli.commands.report uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.report uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_cli.commands.report, while a change to tokscale_cli.commands.report can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_cli.commands.report uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.report uses tokscale_core.bucket_tz, so a change to tokscale_core.bucket_tz can break tokscale_cli.commands.report, while a change to tokscale_cli.commands.report can't break tokscale_core.bucket_tz.
Position
Below the diagonal: tokscale_cli.commands.report uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.report uses tokscale_core, so a change to tokscale_core can break tokscale_cli.commands.report, while a change to tokscale_cli.commands.report can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.commands.report uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.cache uses tokscale_core, so a change to tokscale_core can break tokscale_cli.tui.cache, while a change to tokscale_cli.tui.cache can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.tui.cache uses a module listed above it, which is the healthy direction.
35→36 tokscale_cli.tui.cache uses tokscale_cli.commands.usage.opencode_gopart of a loop✕
Connections
2 pairs of types, where a type in tokscale_cli.tui.cache uses a type in tokscale_cli.commands.usage.opencode_go.
tokscale_cli.tui.cache uses tokscale_cli.commands.usage.opencode_go, so a change to tokscale_cli.commands.usage.opencode_go can break tokscale_cli.tui.cache, while a change to tokscale_cli.tui.cache can't break tokscale_cli.commands.usage.opencode_go.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
35→38 tokscale_cli.tui.cache uses tokscale_cli.tui.datapart of a loop✕
Connections
13 pairs of types, where a type in tokscale_cli.tui.cache uses a type in tokscale_cli.tui.data.
tokscale_cli.tui.cache uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_cli.tui.cache, while a change to tokscale_cli.tui.cache can't break tokscale_cli.tui.data.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_cli.commands.usage.opencode_go uses tokscale_cli.commands.usage, so a change to tokscale_cli.commands.usage can break tokscale_cli.commands.usage.opencode_go, while a change to tokscale_cli.commands.usage.opencode_go can't break tokscale_cli.commands.usage.
Position
Below the diagonal: tokscale_cli.commands.usage.opencode_go uses a module listed above it, which is the healthy direction.
tokscale_cli.commands.usage.opencode_go uses tokscale_cli.tui.cache, so a change to tokscale_cli.tui.cache can break tokscale_cli.commands.usage.opencode_go, while a change to tokscale_cli.commands.usage.opencode_go can't break tokscale_cli.tui.cache.
Position
Below the diagonal: tokscale_cli.commands.usage.opencode_go uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.commands.usage, so a change to tokscale_cli.commands.usage can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.commands.usage.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.tui.themes, so a change to tokscale_cli.tui.themes can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.tui.themes.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_core.clients, so a change to tokscale_core.clients can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_core.clients.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.tui.settings, so a change to tokscale_cli.tui.settings can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.tui.settings.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.ui_glyphs, so a change to tokscale_cli.ui_glyphs can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.ui_glyphs.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.tui.i18n, so a change to tokscale_cli.tui.i18n can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.tui.i18n.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_core, so a change to tokscale_core can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.app uses tokscale_cli.commands.usage.opencode_go, so a change to tokscale_cli.commands.usage.opencode_go can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.commands.usage.opencode_go.
Position
Below the diagonal: tokscale_cli.tui.app uses a module listed above it, which is the healthy direction.
37→38 tokscale_cli.tui.app uses tokscale_cli.tui.datapart of a loop✕
Connections
11 pairs of types, where a type in tokscale_cli.tui.app uses a type in tokscale_cli.tui.data.
tokscale_cli.tui.app uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_cli.tui.app, while a change to tokscale_cli.tui.app can't break tokscale_cli.tui.data.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
tokscale_cli.tui.data uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_cli.tui.data, while a change to tokscale_cli.tui.data can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_cli.tui.data uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.data uses tokscale_core.sessions, so a change to tokscale_core.sessions can break tokscale_cli.tui.data, while a change to tokscale_cli.tui.data can't break tokscale_core.sessions.
Position
Below the diagonal: tokscale_cli.tui.data uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.data uses tokscale_core, so a change to tokscale_core can break tokscale_cli.tui.data, while a change to tokscale_cli.tui.data can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.tui.data uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.data uses tokscale_cli.tui.cache, so a change to tokscale_cli.tui.cache can break tokscale_cli.tui.data, while a change to tokscale_cli.tui.data can't break tokscale_cli.tui.cache.
Position
Below the diagonal: tokscale_cli.tui.data uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.data uses tokscale_cli.tui.app, so a change to tokscale_cli.tui.app can break tokscale_cli.tui.data, while a change to tokscale_cli.tui.data can't break tokscale_cli.tui.app.
Position
Below the diagonal: tokscale_cli.tui.data uses a module listed above it, which is the healthy direction.
tokscale_cli uses tokscale_core.clients, so a change to tokscale_core.clients can break tokscale_cli, while a change to tokscale_cli can't break tokscale_core.clients.
Position
Below the diagonal: tokscale_cli uses a module listed above it, which is the healthy direction.
tokscale_cli uses tokscale_core.scanner, so a change to tokscale_core.scanner can break tokscale_cli, while a change to tokscale_cli can't break tokscale_core.scanner.
Position
Below the diagonal: tokscale_cli uses a module listed above it, which is the healthy direction.
tokscale_cli uses tokscale_cli.tui.settings, so a change to tokscale_cli.tui.settings can break tokscale_cli, while a change to tokscale_cli can't break tokscale_cli.tui.settings.
Position
Below the diagonal: tokscale_cli uses a module listed above it, which is the healthy direction.
tokscale_cli uses tokscale_cli.commands.report, so a change to tokscale_cli.commands.report can break tokscale_cli, while a change to tokscale_cli can't break tokscale_cli.commands.report.
Position
Below the diagonal: tokscale_cli uses a module listed above it, which is the healthy direction.
tokscale_cli uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_cli, while a change to tokscale_cli can't break tokscale_cli.tui.data.
Position
Below the diagonal: tokscale_cli uses a module listed above it, which is the healthy direction.
tokscale_cli.tui uses tokscale_core, so a change to tokscale_core can break tokscale_cli.tui, while a change to tokscale_cli.tui can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.tui uses a module listed above it, which is the healthy direction.
tokscale_cli.tui uses tokscale_cli.tui.cache, so a change to tokscale_cli.tui.cache can break tokscale_cli.tui, while a change to tokscale_cli.tui can't break tokscale_cli.tui.cache.
Position
Below the diagonal: tokscale_cli.tui uses a module listed above it, which is the healthy direction.
tokscale_cli.tui uses tokscale_cli.commands.usage.opencode_go, so a change to tokscale_cli.commands.usage.opencode_go can break tokscale_cli.tui, while a change to tokscale_cli.tui can't break tokscale_cli.commands.usage.opencode_go.
Position
Below the diagonal: tokscale_cli.tui uses a module listed above it, which is the healthy direction.
tokscale_cli.tui uses tokscale_cli.tui.app, so a change to tokscale_cli.tui.app can break tokscale_cli.tui, while a change to tokscale_cli.tui can't break tokscale_cli.tui.app.
Position
Below the diagonal: tokscale_cli.tui uses a module listed above it, which is the healthy direction.
tokscale_cli.tui uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_cli.tui, while a change to tokscale_cli.tui can't break tokscale_cli.tui.data.
Position
Below the diagonal: tokscale_cli.tui uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 63% · Adequate · gated by 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
98
High / Critical
A03:2025 — Software Supply Chain Failures
67
High / Critical
A02:2025 — Security Misconfiguration
7
High / Critical
Roadmap
Top priorities: Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.); Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off; Resolve the 1 finding(s) in DR & Backup.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.).
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
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 — 96
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 — 1293
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 — 119
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 15
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 71 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 — 71 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, 1465 of 1508 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 packages/frontend/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), 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 — a coverage step in CI (`cargo tarpaulin`) shows coverage is measured in your own CI.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,890 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 28 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for packages/frontend/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), 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 packages/frontend/ was NOT MEASURED: the dependency install for packages/frontend/ failed in the analyzer sandbox (npm error Cannot read properties of null (reading 'edgesOut')), 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 REDACTED, 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.
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.
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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated 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.
D27 Navigability — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — 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. `packages/benchmarks/runner.ts`, `packages/frontend/scripts/capital/import-epoch.ts`, `packages/frontend/scripts/capital/lib/source-cache.ts`, `packages/frontend/src/components/profile/usageChartData.ts`, `packages/frontend/src/lib/capital/ledger/index.ts`, … (+1 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 17 — an image could not be built) — app Pulling app Warning pull access denied for tokscale, repository does not exist or may require 'docker login': denied: requested access to the resource is denied failed to solve: process "/bin/sh -c bun run build && test -f .next/standalone/packages/frontend/server.js" did not complete successfully: exit code: 1; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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. 141 further occurrence(s) are not listed individually; the score already reflects all 181.
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. 125 further occurrence(s) are not listed individually; the score already reflects all 165.
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. 12 further occurrence(s) are not listed individually; the score already reflects all 52.
R4 Test Coverage — 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. 53 further occurrence(s) are not listed individually; the score already reflects all 93.
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. 13 further occurrence(s) are not listed individually; the score already reflects all 53.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
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.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
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.
112 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was tokscale_core::parse_all_messages_streaming at 178. A further 20 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 tokscale_cli::tui::i18n::tr_en at 351 — they are counted neither in the figure above nor in this dimension's score. 3 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crates/tokscale-cli/src/tui/i18n.rs (tokscale_cli::tui::i18n::tr_en at 351), crates/tokscale-core/src/claude_desktop/v8.rs (Reader::read_value at 31), crates/tokscale-cli/src/tui/ui/widgets.rs (tokscale_cli::tui::ui::widgets::get_client_color at 29). 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.
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with tokscale_core::parse_all_messages_streaming (cyclomatic 178), tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cyclomatic 162), tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cyclomatic 122). — 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 Cyclomatic Complexity from 5.0 to about 6.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
233 method(s) exceeded the cognitive complexity threshold of 15; the worst was tokscale_core::sessions::codex::parse_codex_reader_with_record_limit at 413.
+ 19 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 Cognitive Complexity — start with tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cognitive 413), tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cognitive 332), tokscale_core::parse_all_messages_streaming (cognitive 304). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cognitive Complexity from 2.0 to about 2.7/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.9 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 78 FunctionTooLong finding(s) in God Classes — start with main.rs (9), kiro.rs (4), lib.rs (3). — One of this dimension's main actionable groups (78 warning-level).
Resolve the 45 FileTooLong finding(s) in God Classes — start with mod.rs (4), antigravity.rs (2), cursor.rs (2). — One of this dimension's main actionable groups (45 warning-level).
Resolve the 10 MethodTooLong finding(s) in God Classes — start with app.rs (2), custom.rs (2), mod.rs. — One of this dimension's main actionable groups (10 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.
276 duplicated block group(s) detected. 3.1 % of the production lines (10,879 of 346,288) are in a reported copy. A further 132 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 3 of the 408 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.
+ 150 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 24 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with antigravity.rs (4), cursor.rs (2), import.rs. — One of this dimension's main actionable groups (24 warning-level).
Resolve the 19 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (2), footer.rs (2), hourly.rs (2). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 17 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with codex.rs (4), lib.rs (2), lookup.rs (2). — One of this dimension's main actionable groups (17 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
14 production modules (Cargo+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 3 of the 14 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).
Unstable project @tokscale/cli
Off the main sequence: tokscale-core
What to do
Resolve the 1 Unstable project @tokscale/cli finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with mod.rs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ 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.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1890 tests. Measured on the JavaScript/TypeScript suite only — at least 28 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
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.
19 outdated, 0 yanked direct Cargo dependencies. 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: anyhow · ×19
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 430 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 REDACTED, 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: crates/tokscale-core/src/lib.rs (101×287=28987); crates/tokscale-core/src/scanner.rs (46×162=7452); REDACTED (102×59=6018) Repeated repair below the complexity floor: crates/tokscale-cli/src/commands/usage/antigravity.rs (10 of 14 changes were fixes); crates/tokscale-core/src/sessions/antigravity_cli.rs (10 of 12 changes were fixes); crates/tokscale-core/src/sessions/fx.rs (8 of 12 changes were fixes)
Resolve the 70 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), REDACTED (2), lib.rs. — One of this dimension's main actionable groups (70 warning-level).
Resolve the 27 Repeated repair finding(s) in Churn × Complexity Hotspots — start with cursor.rs (2), antigravity.rs, antigravity_cli.rs. — One of this dimension's main actionable groups (27 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.8 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
53 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/tokscale-cli/src/commands/apple_fm.rs. Counted over 448 of the 578 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 deducted task-comment markers across 346288 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.
TodoCommentpackages/benchmarks/runner.ts:399
What to do
Resolve the 1 TodoComment finding(s) in Explicit Debt — start with runner.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
2 of 2 documentation facets pass in full. 20 document(s) read across 14 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 REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
3 naming inconsistencies among 101 declarations measured against a convention their peers follow.
`sessionID` spells `ID` where 98 names in the project spell it `Id`packages/benchmarks/generate.ts:152
`modelID` spells `ID` where 98 names in the project spell it `Id`packages/benchmarks/generate.ts:154
`providerID` spells `ID` where 98 names in the project spell it `Id`packages/benchmarks/generate.ts:155
What to do
Resolve the 1 `sessionID` spells `ID` where 98 names in the project spell it `Id` finding(s) in Naming Consistency — start with generate.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `modelID` spells `ID` where 98 names in the project spell it `Id` finding(s) in Naming Consistency — start with generate.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 `providerID` spells `ID` where 98 names in the project spell it `Id` finding(s) in Naming Consistency — start with generate.ts. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
2 of 5 build units (Cargo, 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: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret 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.
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).
98 finding(s): 0 critical, 74 high, 24 medium, 0 low. 61 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 19 file(s) — `crates/tokscale-cli/src/commands/autosubmit.rs` (line 1289), `crates/tokscale-core/src/fs_atomic.rs` (line 24, lines 75–76), `crates/tokscale-core/src/sessions/copilot.rs` (line 1330, line 1331, line 1332), `packages/benchmarks/runner.ts` (line 167, line 190, line 234), `packages/frontend/__tests__/lib/parserHighWater.test.ts` (line 242, line 277, line 318, …), … (+14 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 2 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
+ 7 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 61 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (61 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (17). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 16 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (14), REDACTED, REDACTED. — One of this dimension's main actionable groups (16 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 5 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-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.
6 of 448 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/tokscale-core/src/model_alias.rs. Counted over 448 of the 578 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with SourceLogo.tsx. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 8 Change coupling finding(s) in Change Coupling — start with clients.rs (2), LeaderboardClient.tsx, mod.rs. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with client_ui.rs, constants.ts. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
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 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ 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 alternatives10.0 / 10Exemplary○ Nothing flagged
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.
Do you agree with this assessment?
AC2 · Forms & labels7.0 / 10Strong✓ 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. — packages/frontend/src/app/(main)/groups/new/CreateGroupClient.tsx:235
This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. — packages/frontend/src/app/(main)/groups/new/CreateGroupClient.tsx:244
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.
Do you agree with this assessment?
AC3 · Page structure7.8 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — packages/frontend/scripts/gallery/gallery.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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.
A styled-components/emotion style declares a foreground/background colour pair below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — packages/frontend/src/app/u/[username]/not-found.tsx:41
`input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:293
`svg` moves (`animation: _______ 1s linear infinite`) 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. — packages/frontend/src/components/DataInput.tsx:459
`.css-in-js` moves (`animation: spin 60s linear infinite`) 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. — packages/frontend/src/components/layout/Footer.tsx:179
`svg` moves (`transition: transform 0.2s ease`) 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. — packages/frontend/src/components/landing/sections/HeroSection.tsx:479
`a ____________ img` moves (`transition: transform 160ms ease, box-shadow 160ms ease`) 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. — packages/frontend/src/components/home/InstagramSection.tsx:139
`.css-in-js ____________ span[aria-hidden]` moves (`transition: transform 120ms ease`) 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. — packages/frontend/src/components/home/primitives.tsx:132
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 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?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No encryption usage (RustCrypto's aes-gcm/chacha20poly1305 encrypting, ring or aws-lc-rs aead sealing, orion, libsodium's secretbox, openssl symm, age, SQLCipher keyed by PRAGMA key, pgcrypto, MongoDB client-side field-level encryption, the OS keyring) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore. — packages/frontend/src/lib/db/migrations/0000_add_user_id_unique_constraint.sql:78
What to do
Encrypt sensitive data at rest (encrypt the fields with aes-gcm or chacha20poly1305 before they are written, or open the store encrypted — SQLCipher for rusqlite/sqlx, MongoDB CSFLE) and manage keys in a vault (AWS KMS / Secrets Manager through aws-sdk-kms, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault through vaultrs). Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS on the server that receives this data: terminate TLS in it (axum-server/actix bind_rustls, tonic ServerTlsConfig, a tokio-rustls acceptor) and send Strict-Transport-Security, or run it behind a TLS-terminating proxy, so data in transit is always encrypted.
Do you agree with this assessment?
C4 · Data Retention6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a scheduled task that deletes rows past their retention — diesel::delete(….filter(created_at.lt(cutoff))), purge_expired… / delete_old…), a documented retention period / data-expiry.
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 2/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/cli`, `packages/frontend`, `packages/tokscale`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
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.
`REDACTED` 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`. — REDACTED:19
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 & Backup0.0 / 10Critical✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
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.
`existsSync` in `leaderboardPage` 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/frontend/scripts/stealth/fetch-profiles.ts:46
`readFileSync` in `leaderboardPage` 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/frontend/scripts/stealth/fetch-profiles.ts:50
`mkdirSync` in `main` 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/frontend/scripts/stealth/fetch-profiles.ts:66
`existsSync` in `main` 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/frontend/scripts/stealth/fetch-profiles.ts:74
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.9 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
37 duplicated blocks under packages/frontend/src/app/(main)/capital/ have copies in at least two of the sibling directories _components, companies, compute, deals, investors, methodology (+3 more sibling(s) not listed) — 31 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 37 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 37 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 37 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/frontend/src/app/(main)/capital/compute/page.tsx:40
27 duplicated blocks under packages/frontend/src/ have copies in at least two of the sibling directories app, components, lib — 14 of them are reported below, and 13 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 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 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 27 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/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75
15 duplicated blocks under packages/frontend/src/app/api/ have copies in at least two of the sibling directories admin, auth, badge, embed, groups, leaderboard (+4 more sibling(s) not listed) — 10 of them are reported below, and 5 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 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 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 15 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. — REDACTED:24
9 duplicated blocks under packages/frontend/src/app/(main)/ have copies in at least two of the sibling directories capital, groups, leaderboard, methodology, privacy, terms — 5 of them are reported below, and 4 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 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 9 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/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818
5 of the duplicated blocks reported below have copies in at least two of the sibling directories invite, leaderboard, leave, members, transfer-ownership under packages/frontend/src/app/api/groups/[slug]/. That concentration is one structural fact, not 5 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 5 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/frontend/src/app/api/groups/[slug]/leave/route.ts:9
5 duplicated blocks under packages/frontend/src/components/ have copies in at least two of the sibling directories explore, home, landing, layout, leaderboard, ui — 4 of them are reported below, and 1 is 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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/frontend/src/components/landing/sections/FooterSection.tsx:11
5 duplicated blocks under packages/frontend/src/lib/ have copies in at least two of the sibling directories auth, embed, explore, groups, leaderboard — 3 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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/frontend/src/lib/auth/session.ts:39
packages/frontend/src/components/explore/UsageBoards.tsx:380 · packages/frontend/src/components/explore/UsageBoards.tsx:510 — the two spans are one implementation copied and then locally edited — 762 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. — packages/frontend/src/components/explore/UsageBoards.tsx:380
packages/frontend/scripts/capital/build-org-ids.ts:91 · packages/frontend/scripts/capital/lib/sec-client.ts:125 — the two spans are one implementation copied and then locally edited — 635 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. — packages/frontend/scripts/capital/build-org-ids.ts:91
packages/frontend/src/app/api/groups/[slug]/members/route.ts:26 · packages/frontend/src/app/api/groups/[slug]/route.ts:56 — the two spans are one implementation copied and then locally edited — 484 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. — packages/frontend/src/app/api/groups/[slug]/members/route.ts:26
packages/frontend/src/lib/db/dailyBreakdownReported.ts:42 · packages/frontend/src/lib/db/deviceClientTotals.ts:77 — the two spans are one implementation copied and then locally edited — 459 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. — packages/frontend/src/lib/db/dailyBreakdownReported.ts:42
packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25 · packages/frontend/src/lib/embed/renderTerminalEmbedSvg.ts:25 — the two spans are one implementation copied and then locally edited — 352 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. — packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25
packages/frontend/src/lib/embed/renderGraphEmbedSvg.ts:31 · packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:34 — the two spans are one implementation copied and then locally edited — 254 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. — packages/frontend/src/lib/embed/renderGraphEmbedSvg.ts:31
packages/frontend/src/app/(main)/capital/compute/page.tsx:40 · packages/frontend/src/app/(main)/capital/rounds/page.tsx:33 — the two spans are one implementation copied and then locally edited — 486 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. — packages/frontend/src/app/(main)/capital/compute/page.tsx:40
packages/frontend/src/lib/groups/queries.ts:39 · packages/frontend/src/lib/groups/queries.ts:85 — 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. — packages/frontend/src/lib/groups/queries.ts:39
packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:448 · packages/frontend/src/app/(main)/capital/compute/page.tsx:141 — the two spans are one implementation copied and then locally edited — 336 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. — packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:448
packages/frontend/src/components/Skeleton.tsx:95 · packages/frontend/src/components/Skeleton.tsx:206 — the two spans are one implementation copied and then locally edited — 262 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. — packages/frontend/src/components/Skeleton.tsx:95
packages/frontend/src/app/(main)/capital/deals/[slug]/page.tsx:10 · packages/frontend/src/app/(main)/capital/rounds/[slug]/page.tsx:10 — 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. — packages/frontend/src/app/(main)/capital/deals/[slug]/page.tsx:10
packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75 · packages/frontend/src/lib/publicProfileDevices.ts:45 — the two spans are one implementation copied and then locally edited — 281 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. — packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75
packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:36 · packages/frontend/src/app/api/groups/[slug]/members/route.ts:80 — the two spans are one implementation copied and then locally edited — 328 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. — packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:36
packages/frontend/src/components/explore/ScoreTimeline.tsx:418 · packages/frontend/src/components/explore/TrendChart.tsx:216 — the two spans are one implementation copied and then locally edited — 230 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. — packages/frontend/src/components/explore/ScoreTimeline.tsx:418
packages/frontend/src/components/TokenGraph2D.tsx:266 · packages/frontend/src/components/TokenGraph3D.tsx:269 — the two spans are one implementation copied and then locally edited — 279 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. — packages/frontend/src/components/TokenGraph2D.tsx:266
packages/frontend/src/components/profile/ProfileDevices.tsx:91 · packages/frontend/src/components/profile/ProfileModels.tsx:95 — the two spans are one implementation copied and then locally edited — 212 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. — packages/frontend/src/components/profile/ProfileDevices.tsx:91
packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1363 — 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. — packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818
REDACTED:24 · REDACTED:40 — the two spans are one implementation copied and then locally edited — 194 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. — REDACTED:24
packages/cli/src/index.ts:101 · packages/cli/src/index.ts:135 — 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. — packages/cli/src/index.ts:101
packages/frontend/src/app/(main)/models/all/page.tsx:26 · packages/frontend/src/app/(main)/models/page.tsx:25 — the two spans are one implementation copied and then locally edited — 198 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. — packages/frontend/src/app/(main)/models/all/page.tsx:26
packages/frontend/src/components/landing/sections/QuickstartSection.tsx:26 · packages/frontend/src/components/landing/sections/WorldwideSection.tsx:75 — 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. — packages/frontend/src/components/landing/sections/QuickstartSection.tsx:26
packages/frontend/src/lib/db/antigravityTransition.ts:87 · packages/frontend/src/lib/db/micodeTransition.ts:47 — 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. — packages/frontend/src/lib/db/antigravityTransition.ts:87
packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:170 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:104 — 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. — packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:170
packages/frontend/src/app/api/settings/account/route.ts:41 · packages/frontend/src/app/api/settings/submitted-data/route.ts:36 — the two spans are one implementation copied and then locally edited — 156 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. — packages/frontend/src/app/api/settings/account/route.ts:41
packages/frontend/src/app/api/me/stats/route.ts:48 · packages/frontend/src/app/api/submit/route.ts:507 — 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. — packages/frontend/src/app/api/me/stats/route.ts:48
packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:100 · packages/frontend/src/components/home/HomePage.tsx:38 — 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. — packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:100
packages/frontend/src/components/landing/hooks/useSquircleClip.ts:44 · packages/frontend/src/components/landing/hooks/useSquircleClip.ts:74 — 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. — packages/frontend/src/components/landing/hooks/useSquircleClip.ts:44
packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:27 · packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25 · packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:26 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:26 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:27
packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:296 · packages/frontend/src/components/home/HomePage.tsx:87 — 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. — packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:296
packages/frontend/src/app/api/auth/token/route.ts:5 · packages/frontend/src/app/api/me/stats/route.ts:65 · packages/frontend/src/app/api/submit/route.ts:523 — 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. — packages/frontend/src/app/api/auth/token/route.ts:5
packages/frontend/src/app/api/groups/[slug]/leaderboard/route.ts:9 · REDACTED:10 — the two spans are one implementation copied and then locally edited — 190 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. — packages/frontend/src/app/api/groups/[slug]/leaderboard/route.ts:9
packages/frontend/src/app/device/DeviceClient.tsx:293 · packages/frontend/src/app/device/DeviceClient.tsx:328 — all 2 copies are in the same file, 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. — packages/frontend/src/app/device/DeviceClient.tsx:293
packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:484 · packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:511 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:484
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.
packages/frontend/scripts/verify-ui-regressions.ts:13 imports packages/frontend/__tests__/support/localExport.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. — packages/frontend/scripts/verify-ui-regressions.ts:13
What to do
Fix the listed violations: 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.
(anonymous) has cyclomatic complexity 174 and cognitive complexity 296; 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. — packages/frontend/src/app/api/submit/route.ts:628
getPublicProfileResponse has cyclomatic complexity 117 and cognitive complexity 188; 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. — packages/frontend/src/lib/publicProfileData.ts:107
main has cyclomatic complexity 109 and cognitive complexity 189; 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. — packages/frontend/scripts/capital/build-org-ids.ts:820
planParserHighWaterSubmission has cyclomatic complexity 60 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. — packages/frontend/src/lib/db/parserHighWater.ts:1527
(anonymous) has cyclomatic complexity 52 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 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:305
LeaderboardClient has cyclomatic complexity 52 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. — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:927
validateLedgerContent has cyclomatic complexity 46 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. — packages/frontend/src/lib/capital/ledger/content.ts:79
buildCompany has cyclomatic complexity 45 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. — packages/frontend/scripts/capital/build-capex.ts:258
HeaderFacts has cyclomatic complexity 39 and cognitive complexity 32; 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. — packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:86
validateSubmission has cyclomatic complexity 38 and cognitive complexity 69; 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. — packages/frontend/src/lib/validation/submission.ts:397
V2Profile has cyclomatic complexity 38 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. — packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:587
antigravityPriorCoverage has cyclomatic complexity 35 and cognitive complexity 82; 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. — packages/frontend/src/lib/db/antigravityStateCoverage.ts:496
PATCH has cyclomatic complexity 35 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 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. — packages/frontend/src/app/api/groups/[slug]/route.ts:83
createContributionCalendar has cyclomatic complexity 34 and cognitive complexity 45; 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. — packages/frontend/src/components/profile/ProfileContributionGraph.tsx:579
EventDetail has cyclomatic complexity 34 and cognitive complexity 32; 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. — packages/frontend/src/app/(main)/capital/_components/EventDetail.tsx:92
remixAccount has cyclomatic complexity 32 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. — REDACTED:271
handleKeyDown has cyclomatic complexity 32 and cognitive complexity 30; 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. — packages/frontend/src/components/ui/Select.tsx:276
ProfileUsageChart has cyclomatic complexity 32 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/components/profile/ProfileUsageChart.tsx:866
valuationRatio has cyclomatic complexity 30 and cognitive complexity 31; 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. — packages/frontend/src/lib/capital/ledger/ratio.ts:21
POST has cyclomatic complexity 29 and cognitive complexity 31; 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. — packages/frontend/src/app/api/submit/route.ts:523
renderProfileCardSvg has cyclomatic complexity 29 and cognitive complexity 28; 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. — packages/frontend/src/lib/embed/renderProfileEmbedSvg.ts:41
getWithholdingUsageTotals has cyclomatic complexity 27 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. — packages/frontend/src/lib/moderation/withholding.ts:138
company has cyclomatic complexity 27 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 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. — packages/frontend/src/lib/capital/ledger/model.ts:434
FundingRow has cyclomatic complexity 27 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:340
scoreCandidate has cyclomatic complexity 26 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 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. — packages/frontend/src/lib/moderation/heuristics.ts:484
ProfilePageClient has cyclomatic complexity 26 and cognitive complexity 24; 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. — packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:138
GroupDetailClient has cyclomatic complexity 26 and cognitive complexity 22; 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. — packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:517
main has cyclomatic complexity 25 and cognitive complexity 32; 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. — packages/frontend/scripts/capital/verify-quotes.ts:158
ResultRowView has cyclomatic complexity 25 and cognitive complexity 24; 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. — packages/frontend/src/components/explore/BenchmarkDetailView.tsx:743
GET has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:117
orgView has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/capital/ledger/model.ts:226
renderOrbitEmbedSvg has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:40
POST has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/app/api/groups/[slug]/invite/route.ts:71
executeSql has cyclomatic complexity 23 and cognitive complexity 36; 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. — packages/frontend/__tests__/api/submitMiCodeTransition.test.ts:89
buildPeriodRollup has cyclomatic complexity 23 and cognitive complexity 32; 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. — packages/frontend/src/lib/explore/rollup.ts:181
InstantTooltip has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/components/ui/InstantTooltip.tsx:122
detectLibcKind has cyclomatic complexity 23 and cognitive complexity 25; 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. — packages/cli/src/index.ts:27
applyRecountProofToCell has cyclomatic complexity 23 and cognitive complexity 25; 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. — packages/frontend/src/lib/db/parserHighWater.ts:777
ProfileContributionGraph has cyclomatic complexity 23 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2047
eventView has cyclomatic complexity 22 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/capital/ledger/model.ts:307
Do you agree with this assessment?
R3 · Large Files4.1 / 10Weak✓ 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.
packages/frontend/src/components/profile/ProfileContributionGraph.tsx has 2381 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/profile/ProfileContributionGraph.tsx:1
packages/frontend/src/app/api/submit/route.ts has 1887 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/api/submit/route.ts:1
packages/frontend/src/lib/db/parserHighWater.ts has 1792 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/db/parserHighWater.ts:1
packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx has 1342 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1
packages/frontend/src/components/profile/ProfileUsageChart.tsx has 1296 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/profile/ProfileUsageChart.tsx:1
packages/frontend/src/app/settings/SettingsClient.tsx has 1136 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/settings/SettingsClient.tsx:1
packages/frontend/src/components/profile/ProfileEmbedDialog.tsx has 1117 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:1
packages/frontend/scripts/capital/build-org-ids.ts has 1075 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/scripts/capital/build-org-ids.ts:1
packages/frontend/src/components/explore/BenchmarkDetailView.tsx has 978 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/BenchmarkDetailView.tsx:1
packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx has 943 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:1
packages/frontend/src/components/profile/usageChartData.ts has 888 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/profile/usageChartData.ts:1
packages/frontend/src/lib/db/schema.ts has 866 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/db/schema.ts:1
packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx has 853 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:1
packages/frontend/src/app/u/[username]/ProfilePageClient.tsx has 836 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:1
packages/frontend/src/components/explore/ModelsDashboard.tsx has 780 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/ModelsDashboard.tsx:1
packages/frontend/src/lib/publicProfileData.ts has 777 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/publicProfileData.ts:1
packages/frontend/src/lib/capital/ledger/model.ts has 759 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/capital/ledger/model.ts:1
packages/frontend/src/components/ui/Select.tsx has 727 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/ui/Select.tsx:1
packages/frontend/src/lib/moderation/candidates.ts has 724 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/moderation/candidates.ts:1
packages/frontend/src/lib/embed/embedShared.ts has 687 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/embed/embedShared.ts:1
packages/frontend/src/lib/db/antigravityStateCoverage.ts has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/db/antigravityStateCoverage.ts:1
packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx has 651 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:1
packages/frontend/src/lib/validation/submission.ts has 622 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/validation/submission.ts:1
packages/frontend/src/lib/moderation/heuristics.ts has 619 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/moderation/heuristics.ts:1
packages/frontend/src/components/home/CapitalPreview.tsx has 617 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/home/CapitalPreview.tsx:1
packages/frontend/src/components/explore/UsageBoards.tsx has 579 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/UsageBoards.tsx:1
packages/frontend/src/lib/db/deviceClientTotals.ts has 576 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/db/deviceClientTotals.ts:1
packages/frontend/src/components/layout/Navigation.tsx has 570 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/layout/Navigation.tsx:1
packages/frontend/src/components/explore/ScoreTimeline.tsx has 552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/ScoreTimeline.tsx:1
packages/frontend/src/lib/db/helpers.ts has 550 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/db/helpers.ts:1
packages/frontend/src/components/explore/ModelDetailView.tsx has 545 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/ModelDetailView.tsx:1
packages/frontend/scripts/capital/build-capex.ts has 535 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/scripts/capital/build-capex.ts:1
REDACTED has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
packages/frontend/src/components/landing/sections/WorldwideSection.tsx has 507 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/landing/sections/WorldwideSection.tsx:1
packages/frontend/src/components/explore/ModelCatalog.tsx has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/explore/ModelCatalog.tsx:1
packages/frontend/src/components/landing/sections/HeroSection.tsx has 504 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/landing/sections/HeroSection.tsx:1
packages/frontend/src/lib/leaderboard/getLeaderboard.ts has 492 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/leaderboard/getLeaderboard.ts:1
packages/frontend/src/lib/capital/ledger/epoch.ts has 479 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/lib/capital/ledger/epoch.ts:1
packages/frontend/src/components/DataInput.tsx has 477 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/DataInput.tsx:1
packages/frontend/src/components/profile/ProfileOverview.tsx has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/frontend/src/components/profile/ProfileOverview.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage7.3 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
packages/frontend/__tests__/lib/clientRegistry.test.ts:16 imports '../../../../.github/assets/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/frontend/__tests__/lib/clientRegistry.test.ts:16
packages/frontend/src/lib/capital/__tests__/epoch.test.ts:31 imports '../../../content/capital/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — packages/frontend/src/lib/capital/__tests__/epoch.test.ts:31
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. (×38) — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1, packages/frontend/src/app/settings/SettingsClient.tsx:1, packages/frontend/scripts/capital/build-org-ids.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
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 REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but packages/frontend/__tests__/lib/clientRegistry.test.ts and 1 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — packages/frontend/__tests__/lib/clientRegistry.test.ts:16
Do you agree with this assessment?
R7 · Dead Code7.3 / 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 125 application, 12 tooling and 181 test entry point(s) detected in this repo. Gate removals on `bun run build` — an undetected custom entry would make these reachable.
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×5) — packages/frontend/src/components/landing/sections/HeroSection.tsx, packages/frontend/src/components/landing/sections/WorldwideSection.tsx, packages/frontend/src/components/landing/sections/FollowSection.tsx, …
no import path from any entry point (125 application, 12 tooling, 181 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 (×9) — packages/frontend/scripts/capital/import-epoch.ts, packages/frontend/src/components/BlackholeHero.tsx, packages/frontend/src/lib/useSquircleBorder.ts, …
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 2 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/hooks/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/hooks/useSquircleClip.ts
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/components/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/components/SquircleBorder.tsx
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/hooks/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/hooks/useCopy.ts
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/LandingPage.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/sections/index.ts
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (packages/frontend/src/components/landing/components/SquircleBorder.tsx, packages/frontend/src/components/landing/sections/QuickstartSection.tsx, packages/frontend/src/components/landing/sections/WorldwideSection.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/hooks/index.ts
no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/frontend/src/components/landing/sections/QuickstartSection.tsx, packages/frontend/src/components/landing/sections/WorldwideSection.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — packages/frontend/src/components/landing/components/index.ts
Nothing imports this binding — it is safe to review for removal. (×10) — packages/frontend/src/app/(main)/tracker/EmbedShowcase.tsx:33, packages/frontend/src/app/(main)/tracker/TuiShowcase.tsx:53, packages/frontend/src/components/Skeleton.tsx:190, …
Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists. (×7) — packages/frontend/src/lib/capital/ledger/format.ts:86, packages/frontend/src/lib/capital/ledger/labels.ts:99, packages/frontend/src/lib/capital/ledger/schema.ts:381, …
Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/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 packages/frontend/src/lib/capital/index.ts in the same commit, or the barrel will import a name that no longer exists. (×2) — packages/frontend/src/lib/capital/urls.ts:30, packages/frontend/src/lib/capital/urls.ts:31
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.
Declared in the root REDACTED 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.
Declared in REDACTED 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. (×4)
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.
Other · Security — Read from this repository's Rust 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. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are read from a Rust server this repository starts itself, and its production Rust starts none. What serves its HTTP is outside the Rust source, and only what this card names about it was assessed.
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.
`.danger_accept_invalid_certs(true)` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on. — crates/tokscale-cli/src/antigravity.rs:2692
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — packages/frontend/vercel.json:1
What to do
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
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 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 5/15 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.
`fetchArrayBuffer` 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 })`. — packages/frontend/src/lib/og/fonts.ts:62
`loadManrope` 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 })`. — packages/frontend/src/lib/og/fonts.ts:72
`exchangeCodeForToken` 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 })`. — packages/frontend/src/lib/auth/github.ts:32
`getGitHubUser` 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 })`. — packages/frontend/src/lib/auth/github.ts:61
`getGitHubUserEmail` 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 })`. — packages/frontend/src/lib/auth/github.ts:79
`onConfirm` 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 })`. (×2) — packages/frontend/src/app/settings/SettingsClient.tsx:542, packages/frontend/src/app/settings/SettingsClient.tsx:579
`fetchApiTokens` 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 })`. — packages/frontend/src/app/settings/SettingsClient.tsx:697
`fetchDevices` 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 })`. — packages/frontend/src/app/settings/SettingsClient.tsx:703
`loadSettings` 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 })`. — packages/frontend/src/app/settings/SettingsClient.tsx:740
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.
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.
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 `REDACTED` 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.
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.7 `!` null assertions per 1k TypeScript source lines — 54 assertion(s) across the 79998 source line(s) of the 344 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: packages/frontend/scripts/capital/build-org-ids.ts (10), packages/frontend/src/lib/capital/ledger/model.ts (7), packages/frontend/scripts/capital/verify-quotes.ts (4). 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 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 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 — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 9 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 38 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Repo shows no audit-logging mechanism (an audit-log table or model — a struct, Diesel table, SeaORM entity or SQL migration table named for it — a SeaORM ActiveModelBehavior hook or database trigger that records each change, or an event-sourced store beside one) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 56 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.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No 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
AX6 Interface segregation — AX6 reached only 0% of this repository's production lines — rust (267,134 lines), python (1,060 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
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 17 — an image could not be built) — app Pulling app Warning pull access denied for tokscale, repository does not exist or may require 'docker login': denied: requested access to the resource is denied failed to solve: process "/bin/sh -c bun run build && test -f .next/standalone/packages/frontend/server.js" did not complete successfully: exit code: 1; 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.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust, 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
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 6 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 20 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one
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 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Python, Rust source, so there is no service whose uptime a failing dependency could take down
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 `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, 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.
R5 Dependency Freshness — uses a bun lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — X12 reached only 1% of this repository's production lines — rust (267,134 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — rust (267,134 lines), python (1,060 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 1% of this repository's production lines — rust (267,134 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X25 Inert configuration knob — X25 reached only 1% of this repository's production lines — rust (267,134 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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
X3 Exception handling — X3 reached only 1% of this repository's production lines — rust (267,134 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label packages/frontend/src/app/(main)/groups/new/CreateGroupClient.tsx:244— This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
Boundary-crossing change coupling: SourceLogo.tsx ↔ submission.ts packages/frontend/src/components/SourceLogo.tsx:1— `packages/frontend/src/components/SourceLogo.tsx` (context components) and `packages/frontend/src/lib/validation/submission.ts` (context validation) sit in DIFFERENT parts of the tree yet change together 52% of the time (13 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `24c4dae6` fix(submit): accept Zed usage payloads (#534); `c86f6353` feat(kiro): add Kiro client support (#525); `925e4206` fix(frontend): address top codebase contract issues (#432) — run `git show` on any of them.
TLS certificate validation disabled crates/tokscale-cli/src/antigravity.rs:2692— `.danger_accept_invalid_certs(true)` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cognitive 413) crates/tokscale-core/src/sessions/codex.rs:1077— tokscale_core::sessions::codex::parse_codex_reader_with_record_limit has cognitive complexity 413 (threshold 15). Drivers by points: if/else 93 (369 pts), boolean chains 22, match/switch 5 (21 pts), loops 1 (nesting depth added 292). 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.
tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cognitive 332) crates/tokscale-core/src/scanner.rs:2240— tokscale_core::scanner::scan_all_clients_with_env_strategy_inner has cognitive complexity 332 (threshold 15). Drivers by points: if/else 130 (251 pts), loops 31 (65 pts), boolean chains 13, match/switch 2 (3 pts) (nesting depth added 156). Of this number, 328 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::parse_all_messages_streaming (cognitive 304) crates/tokscale-core/src/lib.rs:1904— tokscale_core::parse_all_messages_streaming has cognitive complexity 304 (threshold 15). Drivers by points: if/else 175 (343 pts), loops 63 (81 pts), boolean chains 40, match/switch 12 (20 pts) (nesting depth added 194). To reduce it, split the body into named stages: move each independent 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: 5 other methods here (tokscale_core::parse_all_messages_streaming::load_or_parse_resumable_source, tokscale_core::parse_all_messages_streaming::load_or_parse_prime_source, tokscale_core::parse_all_messages_streaming::load_or_parse_micode_source, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokscale_core::sessions::claudecode::parse_claude_lines (cognitive 194) crates/tokscale-core/src/sessions/claudecode.rs:809— tokscale_core::sessions::claudecode::parse_claude_lines has cognitive complexity 194 (threshold 15). Drivers by points: if/else 44 (159 pts), match/switch 5 (19 pts), boolean chains 9, loops 4 (7 pts) (nesting depth added 132). 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.
tokscale_core::parse_local_clients (cognitive 129) crates/tokscale-core/src/lib.rs:7703— tokscale_core::parse_local_clients has cognitive complexity 129 (threshold 15). Drivers by points: if/else 51 (82 pts), loops 18 (24 pts), boolean chains 21, match/switch 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.
tokscale_core::sessions::dsh::parse_dsh_lines (cognitive 108) crates/tokscale-core/src/sessions/dsh.rs:74— tokscale_core::sessions::dsh::parse_dsh_lines has cognitive complexity 108 (threshold 15). Drivers by points: if/else 37 (95 pts), match/switch 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::pi::parse_pi_format_file_inner (cognitive 96) crates/tokscale-core/src/sessions/pi.rs:815— tokscale_core::sessions::pi::parse_pi_format_file_inner has cognitive complexity 96 (threshold 15). Drivers by points: if/else 42 (76 pts), boolean chains 12, match/switch 4 (8 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.
tokscale_core::sessions::qoder::parse_qoder_file (cognitive 93) crates/tokscale-core/src/sessions/qoder.rs:503— tokscale_core::sessions::qoder::parse_qoder_file has cognitive complexity 93 (threshold 15). Drivers by points: if/else 39 (79 pts), match/switch 5 (9 pts), boolean chains 5 (nesting depth added 44). 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.
tokscale_core::message_cache::read_shard_with_limit_unchecked (cognitive 92) REDACTED:4272— tokscale_core::message_cache::read_shard_with_limit_unchecked has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (41 pts), match/switch 16 (29 pts), loops 4 (14 pts), boolean chains 8 (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::grok::parse_grok_unified_log_snapshot (cognitive 78) crates/tokscale-core/src/sessions/grok.rs:714— tokscale_core::sessions::grok::parse_grok_unified_log_snapshot has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (69 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::claude_desktop::parse_tree (cognitive 75) crates/tokscale-core/src/claude_desktop/mod.rs:253— tokscale_core::claude_desktop::parse_tree has cognitive complexity 75 (threshold 15). Drivers by points: if/else 15 (58 pts), loops 5 (16 pts), boolean chains 1 (nesting depth added 54). 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.
tokscale_core::sessions::kiro::parse_kiro_ide_session_file (cognitive 75) crates/tokscale-core/src/sessions/kiro.rs:612— tokscale_core::sessions::kiro::parse_kiro_ide_session_file has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (64 pts), match/switch 5 (8 pts), boolean chains 3 (nesting depth added 44). 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.
tokscale_core::sessions::grok::parse_grok_updates_file (cognitive 72) crates/tokscale-core/src/sessions/grok.rs:487— tokscale_core::sessions::grok::parse_grok_updates_file has cognitive complexity 72 (threshold 15). Drivers by points: if/else 29 (67 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::mcode::parse_mcode_file (cognitive 70) crates/tokscale-core/src/sessions/mcode.rs:29— tokscale_core::sessions::mcode::parse_mcode_file has cognitive complexity 70 (threshold 15). Drivers by points: if/else 22 (64 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::opencode_schema::rescan_opencode_schema_sqlite_with_session_clients (cognitive 69) crates/tokscale-core/src/sessions/opencode_schema.rs:1756— tokscale_core::sessions::opencode_schema::rescan_opencode_schema_sqlite_with_session_clients has cognitive complexity 69 (threshold 15). Drivers by points: if/else 22 (50 pts), loops 8 (13 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::prime_agent::reconcile_prime_agent_messages (cognitive 67) crates/tokscale-core/src/sessions/prime_agent.rs:850— tokscale_core::sessions::prime_agent::reconcile_prime_agent_messages has cognitive complexity 67 (threshold 15). Drivers by points: loops 18 (33 pts), if/else 11 (28 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 35). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
tokscale_core::sessions::copilot_session_state::parse_copilot_session_state_file_into (cognitive 52) crates/tokscale-core/src/sessions/copilot_session_state.rs:57— tokscale_core::sessions::copilot_session_state::parse_copilot_session_state_file_into has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 4 (9 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_core::sessions::prime_agent::min_cost_max_matching (cognitive 52) crates/tokscale-core/src/sessions/prime_agent.rs:633— tokscale_core::sessions::prime_agent::min_cost_max_matching has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (35 pts), loops 8 (16 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::scanner::scan_directory (cognitive 50) crates/tokscale-core/src/scanner.rs:519— tokscale_core::scanner::scan_directory has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 26, if/else 17 (21 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
tokscale_core::sessions::copilot_vscode::parse_file_into (cognitive 50) crates/tokscale-core/src/sessions/copilot_vscode.rs:94— tokscale_core::sessions::copilot_vscode::parse_file_into has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (43 pts), match/switch 3 (4 pts), loops 2, boolean chains 1 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_core::sessions::grok::prefer_unified_log_messages (cognitive 49) crates/tokscale-core/src/sessions/grok.rs:1150— tokscale_core::sessions::grok::prefer_unified_log_messages has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 5, match/switch 2 (5 pts), loops 4 (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.
tokscale_core::sessions::claudecode::build_parent_subagent_type_lookup (cognitive 47) crates/tokscale-core/src/sessions/claudecode.rs:290— tokscale_core::sessions::claudecode::build_parent_subagent_type_lookup has cognitive complexity 47 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 6 (17 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::sessions::kiro::parse_kiro_file (cognitive 47) crates/tokscale-core/src/sessions/kiro.rs:186— tokscale_core::sessions::kiro::parse_kiro_file has cognitive complexity 47 (threshold 15). Drivers by points: if/else 27 (35 pts), match/switch 5, loops 3 (4 pts), boolean chains 3 (nesting depth added 9). 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.
tokscale_core::sessions::proma::reconcile_sources (cognitive 47) crates/tokscale-core/src/sessions/proma.rs:228— tokscale_core::sessions::proma::reconcile_sources has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (33 pts), loops 4 (6 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_core::scanner::discover_copilot_vscode_sessions (cognitive 44) crates/tokscale-core/src/scanner.rs:2077— tokscale_core::scanner::discover_copilot_vscode_sessions has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 5 (9 pts), match/switch 3 (7 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::run_models_report (cognitive 111) crates/tokscale-cli/src/main.rs:2389— tokscale_cli::run_models_report has cognitive complexity 111 (threshold 15). Drivers by points: if/else 32 (66 pts), loops 9 (36 pts), match/switch 3 (8 pts), boolean chains 1 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::run_pricing_lookup (cognitive 93) crates/tokscale-cli/src/main.rs:3927— tokscale_cli::run_pricing_lookup has cognitive complexity 93 (threshold 15). Drivers by points: if/else 41 (74 pts), match/switch 4 (8 pts), loops 2 (6 pts), boolean chains 5 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::tui::ui::bar_chart::render_stacked_bar_chart (cognitive 76) crates/tokscale-cli/src/tui/ui/bar_chart.rs:29— tokscale_cli::tui::ui::bar_chart::render_stacked_bar_chart has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (51 pts), loops 8 (17 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 39). 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.
tokscale_cli::commands::import::parse_ccusage_export (cognitive 68) crates/tokscale-cli/src/commands/import.rs:654— tokscale_cli::commands::import::parse_ccusage_export has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (52 pts), loops 4 (12 pts), boolean chains 4 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::cursor::fetch_cursor_usage_events_json_merging (cognitive 63) crates/tokscale-cli/src/cursor.rs:2074— tokscale_cli::cursor::fetch_cursor_usage_events_json_merging has cognitive complexity 63 (threshold 15). Drivers by points: if/else 22 (49 pts), match/switch 5 (10 pts), boolean chains 3, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::run_clients_command (cognitive 59) crates/tokscale-cli/src/main.rs:4664— tokscale_cli::run_clients_command has cognitive complexity 59 (threshold 15). Drivers by points: if/else 23 (44 pts), loops 5 (12 pts), boolean chains 2, match/switch 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::commands::wrapped::format_model_name (cognitive 58) crates/tokscale-cli/src/commands/wrapped.rs:1478— tokscale_cli::commands::wrapped::format_model_name has cognitive complexity 58 (threshold 15). Drivers by points: if/else 51 (52 pts), boolean chains 6 (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.
tokscale_cli::tui::ui::footer::render_help_row (cognitive 57) crates/tokscale-cli/src/tui/ui/footer.rs:246— tokscale_cli::tui::ui::footer::render_help_row has cognitive complexity 57 (threshold 15). Drivers by points: if/else 45 (55 pts), match/switch 1 (2 pts) (nesting depth added 11). 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.
tokscale_cli::run_hourly_report (cognitive 47) crates/tokscale-cli/src/main.rs:3607— tokscale_cli::run_hourly_report has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (40 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::run_submit_command (cognitive 47) crates/tokscale-cli/src/main.rs:7228— tokscale_cli::run_submit_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 26 (39 pts), boolean chains 4, match/switch 3 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::hindsight::sync_hindsight_ledger (cognitive 45) crates/tokscale-cli/src/hindsight.rs:344— tokscale_cli::hindsight::sync_hindsight_ledger has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 6 (11 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::commands::usage::kimi::fetch (cognitive 43) crates/tokscale-cli/src/commands/usage/kimi.rs:192— tokscale_cli::commands::usage::kimi::fetch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 27). 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.
tokscale_cli::tui::ui::stats::render_graph (cognitive 43) crates/tokscale-cli/src/tui/ui/stats.rs:126— tokscale_cli::tui::ui::stats::render_graph has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 5 (6 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 21). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_cli::commands::import::parse_clawdboard_export (cognitive 39) crates/tokscale-cli/src/commands/import.rs:190— tokscale_cli::commands::import::parse_clawdboard_export has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 2 (4 pts), boolean chains 3 (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.
tokscale_cli::commands::usage::copilot::parse_usage_response (cognitive 39) crates/tokscale-cli/src/commands/usage/copilot.rs:778— tokscale_cli::commands::usage::copilot::parse_usage_response has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 2 (8 pts), loops 2 (5 pts), boolean chains 2 (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.
tokscale_cli::commands::wrapped::generate_wrapped_image (cognitive 38) crates/tokscale-cli/src/commands/wrapped.rs:411— tokscale_cli::commands::wrapped::generate_wrapped_image has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_cli::cursor::remove_account_in_home (cognitive 37) crates/tokscale-cli/src/cursor.rs:1373— tokscale_cli::cursor::remove_account_in_home has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 2 (5 pts) (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_cli::tui::ui::daily::render (cognitive 37) crates/tokscale-cli/src/tui/ui/daily.rs:162— tokscale_cli::tui::ui::daily::render has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26 (32 pts), match/switch 2 (3 pts), boolean chains 2 (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.
tokscale_cli::commands::report::cluster_titles (cognitive 36) crates/tokscale-cli/src/commands/report.rs:626— tokscale_cli::commands::report::cluster_titles has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 7 (12 pts), match/switch 1 (4 pts), boolean chains 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.
tokscale_cli::post_submission (cognitive 35) crates/tokscale-cli/src/main.rs:7571— tokscale_cli::post_submission has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (8 pts), match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::tui::ui::hourly::render_table (cognitive 35) crates/tokscale-cli/src/tui/ui/hourly.rs:117— tokscale_cli::tui::ui::hourly::render_table has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 3, match/switch 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.
tokscale_cli::tui::ui::monthly::render_detail (cognitive 35) crates/tokscale-cli/src/tui/ui/monthly.rs:386— tokscale_cli::tui::ui::monthly::render_detail has cognitive complexity 35 (threshold 15). Drivers by points: if/else 24 (30 pts), match/switch 2 (3 pts), boolean chains 2 (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.
tokscale_cli::run_trae_command (cognitive 33) crates/tokscale-cli/src/main.rs:7932— tokscale_cli::run_trae_command has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 4 (9 pts), loops 3 (7 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
tokscale_cli::commands::wrapped::load_wrapped_data (cognitive 33) crates/tokscale-cli/src/commands/wrapped.rs:154— tokscale_cli::commands::wrapped::load_wrapped_data has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokscale_cli::tui::codex_login::sanitize_codex_login_line (cognitive 33) crates/tokscale-cli/src/tui/codex_login.rs:257— tokscale_cli::tui::codex_login::sanitize_codex_login_line has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 3 (9 pts), match/switch 1 (3 pts), boolean chains 2 (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.
FunctionTooLong: tokscale_core::parse_all_messages_streaming crates/tokscale-core/src/lib.rs:1904— FunctionTooLong — tokscale_core::parse_all_messages_streaming runs 2418 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 2318 over it, 24.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::parse_local_clients crates/tokscale-core/src/lib.rs:7703— FunctionTooLong — tokscale_core::parse_local_clients runs 1120 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 1020 over it, 11.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_models_report crates/tokscale-cli/src/main.rs:2389— FunctionTooLong — tokscale_cli::run_models_report runs 753 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 653 over it, 7.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: tokscale_core::scanner::scan_all_clients_with_env_strategy_inner crates/tokscale-core/src/scanner.rs:2240— FunctionTooLong — tokscale_core::scanner::scan_all_clients_with_env_strategy_inner runs 707 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 607 over it, 7.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::sessions::codex::parse_codex_reader_with_record_limit crates/tokscale-core/src/sessions/codex.rs:1077— FunctionTooLong — tokscale_core::sessions::codex::parse_codex_reader_with_record_limit runs 505 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 405 over it, 5.05× 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: tokscale_core::sessions::claudecode::parse_claude_lines crates/tokscale-core/src/sessions/claudecode.rs:809— FunctionTooLong — tokscale_core::sessions::claudecode::parse_claude_lines runs 372 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 272 over it, 3.72× 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: tokscale_cli::main crates/tokscale-cli/src/main.rs:695— FunctionTooLong — tokscale_cli::main runs 370 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 270 over it, 3.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_clients_command crates/tokscale-cli/src/main.rs:4664— FunctionTooLong — tokscale_cli::run_clients_command runs 356 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 256 over it, 3.56× 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: tokscale_core::sessions::qoder::parse_qoder_file crates/tokscale-core/src/sessions/qoder.rs:503— FunctionTooLong — tokscale_core::sessions::qoder::parse_qoder_file runs 338 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 238 over it, 3.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_pricing_lookup crates/tokscale-cli/src/main.rs:3927— FunctionTooLong — tokscale_cli::run_pricing_lookup runs 289 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 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::commands::wrapped::generate_wrapped_image crates/tokscale-cli/src/commands/wrapped.rs:411— FunctionTooLong — tokscale_cli::commands::wrapped::generate_wrapped_image runs 270 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 170 over it, 2.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_monthly_report crates/tokscale-cli/src/main.rs:3295— FunctionTooLong — tokscale_cli::run_monthly_report runs 260 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 160 over it, 2.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::sessions::pi::parse_pi_format_file_inner crates/tokscale-core/src/sessions/pi.rs:815— FunctionTooLong — tokscale_core::sessions::pi::parse_pi_format_file_inner runs 252 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 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_submit_command crates/tokscale-cli/src/main.rs:7228— FunctionTooLong — tokscale_cli::run_submit_command runs 240 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 140 over it, 2.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: tokscale_core::sessions::dsh::parse_dsh_lines crates/tokscale-core/src/sessions/dsh.rs:74— FunctionTooLong — tokscale_core::sessions::dsh::parse_dsh_lines runs 239 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 139 over it, 2.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::tui::ui::footer::render_help_row crates/tokscale-cli/src/tui/ui/footer.rs:246— FunctionTooLong — tokscale_cli::tui::ui::footer::render_help_row runs 235 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 135 over it, 2.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.
FunctionTooLong: tokscale_cli::tui::ui::stats::render_stats_panel crates/tokscale-cli/src/tui/ui/stats.rs:256— FunctionTooLong — tokscale_cli::tui::ui::stats::render_stats_panel runs 235 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 135 over it, 2.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.
FunctionTooLong: tokscale_core::message_cache::read_shard_with_limit_unchecked REDACTED:4272— FunctionTooLong — tokscale_core::message_cache::read_shard_with_limit_unchecked runs 230 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 130 over it, 2.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: tokscale_cli::run_hourly_report crates/tokscale-cli/src/main.rs:3607— FunctionTooLong — tokscale_cli::run_hourly_report runs 221 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 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::sessions::kiro::parse_kiro_ide_session_file crates/tokscale-core/src/sessions/kiro.rs:612— FunctionTooLong — tokscale_core::sessions::kiro::parse_kiro_ide_session_file runs 213 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 113 over it, 2.13× 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: tokscale_core::sessions::bb::scan_bb_sqlite crates/tokscale-core/src/sessions/bb.rs:546— FunctionTooLong — tokscale_core::sessions::bb::scan_bb_sqlite runs 209 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 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_import_command crates/tokscale-cli/src/main.rs:6343— FunctionTooLong — tokscale_cli::run_import_command runs 202 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 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::tui::ui::hourly_profile::render crates/tokscale-cli/src/tui/ui/hourly_profile.rs:32— FunctionTooLong — tokscale_cli::tui::ui::hourly_profile::render runs 202 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 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::tui::ui::models::render crates/tokscale-cli/src/tui/ui/models.rs:249— FunctionTooLong — tokscale_cli::tui::ui::models::render runs 195 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 95 over it, 1.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::tui::ui::overview::render_top_models crates/tokscale-cli/src/tui/ui/overview.rs:235— FunctionTooLong — tokscale_cli::tui::ui::overview::render_top_models runs 190 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 90 over it, 1.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.
Hotspot: crates/tokscale-core/src/lib.rs crates/tokscale-core/src/lib.rs:1904— crates/tokscale-core/src/lib.rs changed 101 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 287 in tokscale_core::parse_all_messages_streaming at line 1904. 58 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/lib.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: crates/tokscale-core/src/scanner.rs crates/tokscale-core/src/scanner.rs:2240— crates/tokscale-core/src/scanner.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 162 in tokscale_core::scanner::scan_all_clients_with_env_strategy_inner at line 2240. 21 of those changes were fix/bug commits, and the other 25 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/scanner.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: REDACTED REDACTED:4272— REDACTED changed 102 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in tokscale_core::message_cache::read_shard_with_limit_unchecked at line 4272. 69 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00: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: crates/tokscale-cli/src/main.rs crates/tokscale-cli/src/main.rs:695— crates/tokscale-cli/src/main.rs changed 70 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in tokscale_cli::main at line 695. 36 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/main.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: packages/frontend/src/app/api/submit/route.ts packages/frontend/src/app/api/submit/route.ts:523— packages/frontend/src/app/api/submit/route.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 171 in route.POST at line 523. 14 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/app/api/submit/route.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: crates/tokscale-cli/src/tui/data/mod.rs crates/tokscale-cli/src/tui/data/mod.rs:801— crates/tokscale-cli/src/tui/data/mod.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in DataLoader::aggregate_messages at line 801. 6 of those changes were fix/bug commits, and the other 25 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/data/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.
Hotspot: crates/tokscale-core/src/sessions/codex.rs crates/tokscale-core/src/sessions/codex.rs:1077— crates/tokscale-core/src/sessions/codex.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 122 in tokscale_core::sessions::codex::parse_codex_reader_with_record_limit at line 1077. 13 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/codex.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: crates/tokscale-core/src/pricing/lookup.rs crates/tokscale-core/src/pricing/lookup.rs:909— crates/tokscale-core/src/pricing/lookup.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in PricingLookup::lookup_auto at line 909. 21 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/pricing/lookup.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: packages/frontend/src/lib/publicProfileData.ts packages/frontend/src/lib/publicProfileData.ts:107— packages/frontend/src/lib/publicProfileData.ts changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 158 in publicProfileData.getPublicProfileResponse at line 107. 4 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/lib/publicProfileData.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: crates/tokscale-cli/src/tui/app.rs crates/tokscale-cli/src/tui/app.rs:896— crates/tokscale-cli/src/tui/app.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in App::handle_key_event at line 896. 5 of those changes were fix/bug commits, and the other 11 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/app.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: crates/tokscale-core/src/sessions/pi.rs crates/tokscale-core/src/sessions/pi.rs:815— crates/tokscale-core/src/sessions/pi.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in tokscale_core::sessions::pi::parse_pi_format_file_inner at line 815. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/pi.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: packages/frontend/src/lib/db/parserHighWater.ts packages/frontend/src/lib/db/parserHighWater.ts:1527— packages/frontend/src/lib/db/parserHighWater.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in parserHighWater.planParserHighWaterSubmission at line 1527. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/lib/db/parserHighWater.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: crates/tokscale-core/src/sessions/claudecode.rs crates/tokscale-core/src/sessions/claudecode.rs:809— crates/tokscale-core/src/sessions/claudecode.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in tokscale_core::sessions::claudecode::parse_claude_lines at line 809. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/claudecode.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: crates/tokscale-core/src/sessions/opencode_schema.rs crates/tokscale-core/src/sessions/opencode_schema.rs:1756— crates/tokscale-core/src/sessions/opencode_schema.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in tokscale_core::sessions::opencode_schema::rescan_opencode_schema_sqlite_with_session_clients at line 1756. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/opencode_schema.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: packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:517— packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in GroupDetailClient.GroupDetailClient at line 517. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.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: crates/tokscale-core/src/sessions/dsh.rs crates/tokscale-core/src/sessions/dsh.rs:74— crates/tokscale-core/src/sessions/dsh.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in tokscale_core::sessions::dsh::parse_dsh_lines at line 74. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/dsh.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: crates/tokscale-cli/src/tui/ui/footer.rs crates/tokscale-cli/src/tui/ui/footer.rs:246— crates/tokscale-cli/src/tui/ui/footer.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in tokscale_cli::tui::ui::footer::render_help_row at line 246. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/ui/footer.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: crates/tokscale-cli/src/cursor.rs crates/tokscale-cli/src/cursor.rs:2074— crates/tokscale-cli/src/cursor.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in tokscale_cli::cursor::fetch_cursor_usage_events_json_merging at line 2074. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/cursor.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: packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:927— packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 93 in LeaderboardClient.LeaderboardClient at line 927. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.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: crates/tokscale-cli/src/antigravity.rs crates/tokscale-cli/src/antigravity.rs:357— crates/tokscale-cli/src/antigravity.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in tokscale_cli::antigravity::sync_antigravity_cache_impl_with_deadline at line 357. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/antigravity.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: crates/tokscale-core/src/pricing/mod.rs crates/tokscale-core/src/pricing/mod.rs:866— crates/tokscale-core/src/pricing/mod.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in PricingService::explain_message at line 866. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/pricing/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.
Hotspot: packages/frontend/src/lib/validation/submission.ts packages/frontend/src/lib/validation/submission.ts:397— packages/frontend/src/lib/validation/submission.ts changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in submission.validateSubmission at line 397. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/lib/validation/submission.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: crates/tokscale-cli/src/commands/wrapped.rs crates/tokscale-cli/src/commands/wrapped.rs:154— crates/tokscale-cli/src/commands/wrapped.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in tokscale_cli::commands::wrapped::load_wrapped_data at line 154. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/wrapped.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: crates/tokscale-core/src/sessions/kiro.rs crates/tokscale-core/src/sessions/kiro.rs:612— crates/tokscale-core/src/sessions/kiro.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in tokscale_core::sessions::kiro::parse_kiro_ide_session_file at line 612. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/kiro.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: crates/tokscale-cli/src/tui/ui/daily.rs crates/tokscale-cli/src/tui/ui/daily.rs:162— crates/tokscale-cli/src/tui/ui/daily.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in tokscale_cli::tui::ui::daily::render at line 162. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/ui/daily.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.
tokscale_core::parse_all_messages_streaming (cyclomatic 178) crates/tokscale-core/src/lib.rs:1904— tokscale_core::parse_all_messages_streaming has cyclomatic complexity 178 (threshold 15). To reduce it, separate the cases: extract each independent 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 (tokscale_core::parse_all_messages_streaming::load_or_parse_resumable_source, tokscale_core::parse_all_messages_streaming::load_or_parse_codex_source) 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.
tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cyclomatic 162) crates/tokscale-core/src/scanner.rs:2240— tokscale_core::scanner::scan_all_clients_with_env_strategy_inner has cyclomatic complexity 162 (threshold 15). Of this number, 160 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.
tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cyclomatic 122) crates/tokscale-core/src/sessions/codex.rs:1077— tokscale_core::sessions::codex::parse_codex_reader_with_record_limit has cyclomatic complexity 122 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::parse_local_clients (cyclomatic 86) crates/tokscale-core/src/lib.rs:7703— tokscale_core::parse_local_clients has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::scanner::scan_directory (cyclomatic 84) crates/tokscale-core/src/scanner.rs:519— tokscale_core::scanner::scan_directory has cyclomatic complexity 84 (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.
tokscale_core::sessions::claudecode::parse_claude_lines (cyclomatic 62) crates/tokscale-core/src/sessions/claudecode.rs:809— tokscale_core::sessions::claudecode::parse_claude_lines has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::message_cache::read_shard_with_limit_unchecked (cyclomatic 59) REDACTED:4272— tokscale_core::message_cache::read_shard_with_limit_unchecked has cyclomatic complexity 59 (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.
tokscale_core::sessions::pi::parse_pi_format_file_inner (cyclomatic 52) crates/tokscale-core/src/sessions/pi.rs:815— tokscale_core::sessions::pi::parse_pi_format_file_inner has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::qoder::parse_qoder_file (cyclomatic 50) crates/tokscale-core/src/sessions/qoder.rs:503— tokscale_core::sessions::qoder::parse_qoder_file has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::dsh::parse_dsh_lines (cyclomatic 42) crates/tokscale-core/src/sessions/dsh.rs:74— tokscale_core::sessions::dsh::parse_dsh_lines 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.
tokscale_core::sessions::grok::parse_grok_unified_log_snapshot (cyclomatic 39) crates/tokscale-core/src/sessions/grok.rs:714— tokscale_core::sessions::grok::parse_grok_unified_log_snapshot 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.
tokscale_core::sessions::kiro::parse_kiro_ide_session_file (cyclomatic 37) crates/tokscale-core/src/sessions/kiro.rs:612— tokscale_core::sessions::kiro::parse_kiro_ide_session_file has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::opencode_schema::rescan_opencode_schema_sqlite_with_session_clients (cyclomatic 34) crates/tokscale-core/src/sessions/opencode_schema.rs:1756— tokscale_core::sessions::opencode_schema::rescan_opencode_schema_sqlite_with_session_clients 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.
tokscale_core::sessions::prime_agent::reconcile_prime_agent_messages (cyclomatic 34) crates/tokscale-core/src/sessions/prime_agent.rs:850— tokscale_core::sessions::prime_agent::reconcile_prime_agent_messages has cyclomatic complexity 34 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
tokscale_core::sessions::grok::parse_grok_updates_file (cyclomatic 33) crates/tokscale-core/src/sessions/grok.rs:487— tokscale_core::sessions::grok::parse_grok_updates_file has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::kiro::parse_kiro_file (cyclomatic 33) crates/tokscale-core/src/sessions/kiro.rs:186— tokscale_core::sessions::kiro::parse_kiro_file has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tokscale_core::pricing::lookup::uncovered_required_request_tiers (cyclomatic 30) crates/tokscale-core/src/pricing/lookup.rs:2348— tokscale_core::pricing::lookup::uncovered_required_request_tiers 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.
tokscale_core::sessions::magpie::attribute_client_responses (cyclomatic 28) crates/tokscale-core/src/sessions/magpie.rs:75— tokscale_core::sessions::magpie::attribute_client_responses 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.
tokscale_core::parse_all_messages_streaming::load_or_parse_resumable_source (cyclomatic 27) crates/tokscale-core/src/lib.rs:2201— tokscale_core::parse_all_messages_streaming::load_or_parse_resumable_source has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (tokscale_core::parse_all_messages_streaming, tokscale_core::parse_all_messages_streaming::load_or_parse_codex_source) 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.
tokscale_core::sessions::copilot_session_state::parse_copilot_session_state_file_into (cyclomatic 27) crates/tokscale-core/src/sessions/copilot_session_state.rs:57— tokscale_core::sessions::copilot_session_state::parse_copilot_session_state_file_into has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::grok::prefer_unified_log_messages (cyclomatic 26) crates/tokscale-core/src/sessions/grok.rs:1150— tokscale_core::sessions::grok::prefer_unified_log_messages 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.
tokscale_core::provider_identity::inferred_provider_from_model_inner (cyclomatic 25) crates/tokscale-core/src/provider_identity.rs:268— tokscale_core::provider_identity::inferred_provider_from_model_inner 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.
tokscale_core::sessions::mcode::parse_mcode_file (cyclomatic 25) crates/tokscale-core/src/sessions/mcode.rs:29— tokscale_core::sessions::mcode::parse_mcode_file 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.
tokscale_core::sessions::commandcode::parse_commandcode_file (cyclomatic 24) crates/tokscale-core/src/sessions/commandcode.rs:191— tokscale_core::sessions::commandcode::parse_commandcode_file 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.
tokscale_core::opencode_model_name::strip_jsonc_syntax (cyclomatic 23) crates/tokscale-core/src/opencode_model_name.rs:113— tokscale_core::opencode_model_name::strip_jsonc_syntax 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.
FileTooLong: src/lib.rs crates/tokscale-core/src/lib.rs— FileTooLong — 6313 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 100 free functions. The bar is 500 significant lines; this is 5813 over it, 12.63× 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: src/main.rs crates/tokscale-cli/src/main.rs— FileTooLong — 6015 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 119 free functions. The bar is 500 significant lines; this is 5515 over it, 12.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2593 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 48 free functions. The bar is 500 significant lines; this is 2093 over it, 5.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: pricing/lookup.rs crates/tokscale-core/src/pricing/lookup.rs— FileTooLong — 2579 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 89 free functions. The bar is 500 significant lines; this is 2079 over it, 5.16× 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: src/antigravity.rs crates/tokscale-cli/src/antigravity.rs— FileTooLong — 2331 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 115 free functions. The bar is 500 significant lines; this is 1831 over it, 4.66× 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: ui/usage.rs crates/tokscale-cli/src/tui/ui/usage.rs— FileTooLong — 2252 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 116 free functions. The bar is 500 significant lines; this is 1752 over it, 4.50× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tui/app.rs crates/tokscale-cli/src/tui/app.rs— FileTooLong — 2095 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: App (2 blocks, 318-3014). The bar is 500 significant lines; this is 1595 over it, 4.19× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/scanner.rs crates/tokscale-core/src/scanner.rs— FileTooLong — 1900 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 64 free functions. The bar is 500 significant lines; this is 1400 over it, 3.80× 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: src/cursor.rs crates/tokscale-cli/src/cursor.rs— FileTooLong — 1857 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 117 free functions. The bar is 500 significant lines; this is 1357 over it, 3.71× 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: sessions/claudecode.rs crates/tokscale-core/src/sessions/claudecode.rs— FileTooLong — 1603 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 1103 over it, 3.21× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sessions/codex.rs crates/tokscale-core/src/sessions/codex.rs— FileTooLong — 1548 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 1048 over it, 3.10× 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: data/mod.rs crates/tokscale-cli/src/tui/data/mod.rs— FileTooLong — 1452 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 952 over it, 2.90× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: usage/codex.rs crates/tokscale-cli/src/commands/usage/codex.rs— FileTooLong — 1425 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 82 free functions. The bar is 500 significant lines; this is 925 over it, 2.85× 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: commands/wrapped.rs crates/tokscale-cli/src/commands/wrapped.rs— FileTooLong — 1357 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 47 free functions. The bar is 500 significant lines; this is 857 over it, 2.71× 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: sessions/grok.rs crates/tokscale-core/src/sessions/grok.rs— FileTooLong — 1189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 58 free functions. The bar is 500 significant lines; this is 689 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: sessions/opencode_schema.rs crates/tokscale-core/src/sessions/opencode_schema.rs— FileTooLong — 1187 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 687 over it, 2.37× 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: sessions/kiro.rs crates/tokscale-core/src/sessions/kiro.rs— FileTooLong — 1174 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 674 over it, 2.35× 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: commands/autosubmit.rs crates/tokscale-cli/src/commands/autosubmit.rs— FileTooLong — 1136 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 636 over it, 2.27× 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: commands/report.rs crates/tokscale-cli/src/commands/report.rs— FileTooLong — 1088 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 36 free functions. The bar is 500 significant lines; this is 588 over it, 2.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sessions/copilot.rs crates/tokscale-core/src/sessions/copilot.rs— FileTooLong — 870 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 370 over it, 1.74× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/clients.rs crates/tokscale-core/src/clients.rs— FileTooLong — 834 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 334 over it, 1.67× 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: src/trae.rs crates/tokscale-cli/src/trae.rs— FileTooLong — 723 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 223 over it, 1.45× 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: sessions/pi.rs crates/tokscale-core/src/sessions/pi.rs— FileTooLong — 705 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 205 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: sessions/mod.rs crates/tokscale-core/src/sessions/mod.rs— FileTooLong — 697 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 197 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: usage/grok.rs crates/tokscale-cli/src/commands/usage/grok.rs— FileTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 190 over it, 1.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.
tokscale_cli::commands::wrapped::format_model_name (cyclomatic 57) crates/tokscale-cli/src/commands/wrapped.rs:1478— tokscale_cli::commands::wrapped::format_model_name has cyclomatic complexity 57 (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.
tokscale_cli::main (cyclomatic 51) crates/tokscale-cli/src/main.rs:695— tokscale_cli::main has cyclomatic complexity 51 (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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::run_pricing_lookup (cyclomatic 47) crates/tokscale-cli/src/main.rs:3927— tokscale_cli::run_pricing_lookup has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent 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: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::run_models_report (cyclomatic 39) crates/tokscale-cli/src/main.rs:2389— tokscale_cli::run_models_report 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::run_clients_command (cyclomatic 34) crates/tokscale-cli/src/main.rs:4664— tokscale_cli::run_clients_command 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::run_submit_command (cyclomatic 32) crates/tokscale-cli/src/main.rs:7228— tokscale_cli::run_submit_command 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::tui::ui::daily::render (cyclomatic 32) crates/tokscale-cli/src/tui/ui/daily.rs:162— tokscale_cli::tui::ui::daily::render 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.
tokscale_cli::tui::ui::bar_chart::render_stacked_bar_chart (cyclomatic 31) crates/tokscale-cli/src/tui/ui/bar_chart.rs:29— tokscale_cli::tui::ui::bar_chart::render_stacked_bar_chart 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.
tokscale_cli::tui::ui::hourly::render_table (cyclomatic 31) crates/tokscale-cli/src/tui/ui/hourly.rs:117— tokscale_cli::tui::ui::hourly::render_table 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.
tokscale_cli::tui::ui::footer::render_help_row (cyclomatic 30) crates/tokscale-cli/src/tui/ui/footer.rs:246— tokscale_cli::tui::ui::footer::render_help_row 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.
tokscale_cli::tui::ui::monthly::render_detail (cyclomatic 30) crates/tokscale-cli/src/tui/ui/monthly.rs:386— tokscale_cli::tui::ui::monthly::render_detail 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.
tokscale_cli::cursor::fetch_cursor_usage_events_json_merging (cyclomatic 29) crates/tokscale-cli/src/cursor.rs:2074— tokscale_cli::cursor::fetch_cursor_usage_events_json_merging 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.
tokscale_cli::tui::ui::monthly::render (cyclomatic 28) crates/tokscale-cli/src/tui/ui/monthly.rs:179— tokscale_cli::tui::ui::monthly::render has cyclomatic complexity 28 (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.
tokscale_cli::commands::import::parse_ccusage_export (cyclomatic 26) crates/tokscale-cli/src/commands/import.rs:654— tokscale_cli::commands::import::parse_ccusage_export 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.
tokscale_cli::tui::ui::hourly_profile::render (cyclomatic 26) crates/tokscale-cli/src/tui/ui/hourly_profile.rs:32— tokscale_cli::tui::ui::hourly_profile::render has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
tokscale_cli::tui::ui::minutely::render (cyclomatic 25) crates/tokscale-cli/src/tui/ui/minutely.rs:110— tokscale_cli::tui::ui::minutely::render 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.
tokscale_cli::run_import_command (cyclomatic 24) crates/tokscale-cli/src/main.rs:6343— tokscale_cli::run_import_command 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 63) 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 function is counted neither in this dimension's figures nor in its score.
tokscale_cli::tui::data::accumulate_session_entry (cyclomatic 24) crates/tokscale-cli/src/tui/data/mod.rs:288— tokscale_cli::tui::data::accumulate_session_entry has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_cli::tui::ui::stats::render_graph (cyclomatic 23) crates/tokscale-cli/src/tui/ui/stats.rs:126— tokscale_cli::tui::ui::stats::render_graph 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.
tokscale_cli::tui::ui::stats::render_stats_panel (cyclomatic 23) crates/tokscale-cli/src/tui/ui/stats.rs:256— tokscale_cli::tui::ui::stats::render_stats_panel has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
tokscale_cli::hindsight::sync_hindsight_ledger (cyclomatic 22) crates/tokscale-cli/src/hindsight.rs:344— tokscale_cli::hindsight::sync_hindsight_ledger 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.
tokscale_cli::tui::ui::footer::render_status_row (cyclomatic 22) crates/tokscale-cli/src/tui/ui/footer.rs:592— tokscale_cli::tui::ui::footer::render_status_row 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.
tokscale_cli::tui::ui::usage::render_selected_account (cyclomatic 22) crates/tokscale-cli/src/tui/ui/usage.rs:1656— tokscale_cli::tui::ui::usage::render_selected_account 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.
tokscale_cli::commands::wrapped::load_wrapped_data (cyclomatic 21) crates/tokscale-cli/src/commands/wrapped.rs:154— tokscale_cli::commands::wrapped::load_wrapped_data 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.
tokscale_cli::tui::ui::models::render (cyclomatic 21) crates/tokscale-cli/src/tui/ui/models.rs:249— tokscale_cli::tui::ui::models::render 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.
+ 19 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×38
No test reaches this file packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.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/frontend/src/app/settings/SettingsClient.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/frontend/scripts/capital/build-org-ids.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 packages/frontend/src/components/explore/ModelsDashboard.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/frontend/scripts/capital/build-capex.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 packages/frontend/src/components/explore/ModelCatalog.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/frontend/src/components/landing/sections/HeroSection.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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/frontend/src/components/landing/sections/WorldwideSection.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/frontend/src/lib/capital/ledger/epoch.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 packages/frontend/scripts/capital/lib/source-cache.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 packages/frontend/src/components/explore/CapabilityCharts.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 REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/frontend/src/app/(main)/leaderboard/GroupsBrowser.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/frontend/scripts/capital/import-epoch.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 packages/frontend/src/components/landing/sections/FollowSection.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/frontend/src/components/landing/sections/QuickstartSection.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/frontend/scripts/check-migrations.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 packages/frontend/src/components/BlackholeHero.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/frontend/src/app/device/DeviceClient.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/frontend/src/app/(main)/leaderboard/page.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/frontend/src/app/(main)/capital/page.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/frontend/scripts/capital/lib/sec-client.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 packages/frontend/src/components/Skeleton.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/frontend/src/app/(main)/groups/new/CreateGroupClient.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.
Repeated repair: crates/tokscale-cli/src/commands/usage/antigravity.rs crates/tokscale-cli/src/commands/usage/antigravity.rs:474— crates/tokscale-cli/src/commands/usage/antigravity.rs changed 14 times in last 90 days and 10 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 tokscale_cli::commands::usage::antigravity::parse_session_content at line 474), 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(usage): persist only verified Antigravity environment sessions (#1635)”; “fix(usage): sync Antigravity session across lifecycle hooks and active environments (#1630)”; “fix(core,submit): add an Antigravity generation boundary and correct BB, Qoder and OMP attribution (#1621)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/antigravity.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: crates/tokscale-core/src/sessions/antigravity_cli.rs crates/tokscale-core/src/sessions/antigravity_cli.rs:241— crates/tokscale-core/src/sessions/antigravity_cli.rs changed 12 times in last 90 days and 10 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 SessionModels::from_blobs at line 241), 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(core,submit): add an Antigravity generation boundary and correct BB, Qoder and OMP attribution (#1621)”; “fix(antigravity): map protobuf usage fields and add transition recount proofs (#1611)”; “fix(cli): correct usage accounting, long-context pricing and sync settings (#1431)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/antigravity_cli.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: crates/tokscale-core/src/sessions/fx.rs crates/tokscale-core/src/sessions/fx.rs:264— crates/tokscale-core/src/sessions/fx.rs changed 12 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 tokscale_core::sessions::fx::parse_fx_file at line 264), 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(bb): count Claude and Codex responses mirrored by BB once (#1608)”; “fix(copilot): merge duplicate OTEL snapshots across files (#1434)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”; “fix(clients): Codex tier source, Antigravity ledger reconciliation, import backfill, recovery ledger docs (#1365)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/fx.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: crates/tokscale-core/src/sessions/cursor.rs crates/tokscale-core/src/sessions/cursor.rs:668— crates/tokscale-core/src/sessions/cursor.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 13 (its worst body is tokscale_core::sessions::cursor::try_parse_cursor_csv_file at line 668), 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(cursor): keep the Cursor cache under TOKSCALE_CONFIG_DIR (#1569)”; “fix(submit): heal inflated Cursor history with a recount proof (#1552)”; “fix(cursor): reconcile legacy snapshots with event ids (#1550)”; “fix(cursor): count each Cursor usage event once across its snapshots (#1544)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/cursor.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: crates/tokscale-core/src/sessions/utils.rs crates/tokscale-core/src/sessions/utils.rs:408— crates/tokscale-core/src/sessions/utils.rs changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is tokscale_core::sessions::utils::sqlite_for_each_row_on_with_params at line 408), 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(cache): stop replaying legacy OpenCode and MiMo entries over complete scans (#1540)”; “fix(codex): support reading and caching zstd-compressed transcripts (#1423)”; “fix(claude): count advisor model usage (#1398)”; “fix(claudecode): don't max a bare prompt snapshot against a real cache split (#1392)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/utils.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: crates/tokscale-core/src/pricing/aliases.rs crates/tokscale-core/src/pricing/aliases.rs:275— crates/tokscale-core/src/pricing/aliases.rs changed 8 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 3 (its worst body is tokscale_core::pricing::aliases::resolve_alias at line 275), 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(pricing): price Kimi K3.1 Pro at the Moonshot API card (#1615)”; “fix(pricing): map Claude 5.5 reasoning tiers and aliases to canonical models (#1425)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”; “fix(pricing): resolve stealth preview shorthands to canonical upstream keys (#1277)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/pricing/aliases.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: crates/tokscale-cli/src/commands/usage/claude.rs crates/tokscale-cli/src/commands/usage/claude.rs:639— crates/tokscale-cli/src/commands/usage/claude.rs changed 8 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 12 (its worst body is tokscale_cli::commands::usage::claude::usage_metrics at line 639), 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(usage): keep Claude backoff when 429 carries Retry-After: 0 (#1595)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(usage): prefer fresher Claude Keychain login over stale credentials file (#1401)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/claude.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: crates/tokscale-core/src/sessions/senpi.rs crates/tokscale-core/src/sessions/senpi.rs:25— crates/tokscale-core/src/sessions/senpi.rs changed 6 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 1 (its worst body is tokscale_core::sessions::senpi::parse_senpi_file 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(cli): correct usage accounting, long-context pricing and sync settings (#1431)”; “fix(senpi): discover OmO agent sessions and extra path task children (#1409)”; “ci(rustdoc): gate cargo doc and fix broken intra-doc links (#1307)”; “fix(senpi): discover OmO task children of every project, not just the cwd (#1248)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/senpi.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: crates/tokscale-cli/src/commands/usage/zai.rs crates/tokscale-cli/src/commands/usage/zai.rs:184— crates/tokscale-cli/src/commands/usage/zai.rs changed 6 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 12 (its worst body is tokscale_cli::commands::usage::zai::build_metrics at line 184), 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(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(zai): parse quota reset times and subscription renewal (#1283)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/zai.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: crates/tokscale-core/src/pricing/litellm.rs crates/tokscale-core/src/pricing/litellm.rs:235— crates/tokscale-core/src/pricing/litellm.rs changed 6 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 15 (its worst body is ModelPricing::with_missing_rates_from at line 235), 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(pricing): inherit input rate for pre-5.6 OpenAI cache writes (#1543)”; “fix(cli): correct usage accounting, long-context pricing and sync settings (#1431)”; “fix: review follow-ups for #1374/#1368 — Antigravity family cost floor + sparse hourly pricing (#1376)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/pricing/litellm.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: crates/tokscale-cli/src/commands/usage/opencode_go.rs crates/tokscale-cli/src/commands/usage/opencode_go.rs:230— crates/tokscale-cli/src/commands/usage/opencode_go.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is tokscale_cli::commands::usage::opencode_go::fetch_blocking_with_cap at line 230), 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(usage): stop reporting unknown OpenCode Go quota as 0% used (#1572)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”; “fix(cursor): key sessions by conversationId from usage-events JSON (#1247)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/opencode_go.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: crates/tokscale-core/src/sessions/roocode.rs crates/tokscale-core/src/sessions/roocode.rs:62— crates/tokscale-core/src/sessions/roocode.rs 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 12 (its worst body is tokscale_core::sessions::roocode::parse_roo_kilo_file at line 62), 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(kilocode): count Kilo Code usage, cost and provider correctly (#1406)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”; “fix(cline): resolve model identity from per-message modelInfo (#1340)”; “ci(rustdoc): gate cargo doc and fix broken intra-doc links (#1307)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/roocode.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: crates/tokscale-cli/src/commands/usage/cursor.rs crates/tokscale-cli/src/commands/usage/cursor.rs:671— crates/tokscale-cli/src/commands/usage/cursor.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 12 (its worst body is tokscale_cli::commands::usage::cursor::refreshed_bearer at line 671), 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(cursor): reject mismatched database refresh grants (#1634)”; “fix(usage): keep foreign Cursor refresh tokens isolated (#1624)”; “fix(usage): redact Cursor OAuth tokens in auth struct Debug output (#1623)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/cursor.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: crates/tokscale-cli/src/commands/usage/codex.rs crates/tokscale-cli/src/commands/usage/codex.rs:917— crates/tokscale-cli/src/commands/usage/codex.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 14 (its worst body is tokscale_cli::commands::usage::codex::save_account_from_auth_at_path at line 917), 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(usage): stop reporting unknown Codex quota as 0% used (#1570)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/codex.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/frontend/src/lib/db/helpers.ts packages/frontend/src/lib/db/helpers.ts:425— packages/frontend/src/lib/db/helpers.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 13 (its worst body is helpers.addClientCostFloor at line 425), 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(submit): scope per-day preserve notices to the bounded submit window (#1515)”; “fix: review follow-ups for #1374/#1368 — Antigravity family cost floor + sparse hourly pricing (#1376)”; “fix(submit): reconcile Droid snapshot costs across days (#1311)”; “fix(droid): show transcript-dated usage on the web graph (#1267)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/lib/db/helpers.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: crates/tokscale-core/src/sessions/cline.rs crates/tokscale-core/src/sessions/cline.rs:136— crates/tokscale-core/src/sessions/cline.rs 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 15 (its worst body is tokscale_core::sessions::cline::parse_cline_cli_file at line 136), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(kilocode): count Kilo Code usage, cost and provider correctly (#1406)”; “fix(cline): clamp residual input tokens before aggregation (#1399)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/cline.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: crates/tokscale-core/src/sessions/qwen.rs crates/tokscale-core/src/sessions/qwen.rs:52— crates/tokscale-core/src/sessions/qwen.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is tokscale_core::sessions::qwen::qwen_token_breakdown at line 52), 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(qwen): keep reasoning inside candidates when the recorded total is 0 (#1531)”; “fix(qwen): stop counting cached and reasoning tokens twice (#1527)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/qwen.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: crates/tokscale-cli/src/commands/usage/grok.rs crates/tokscale-cli/src/commands/usage/grok.rs:599— crates/tokscale-cli/src/commands/usage/grok.rs changed 4 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 11 (its worst body is tokscale_cli::commands::usage::grok::fetch_network_usage at line 599), 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(usage): read unwrapped legacy Grok credits responses (#1620)”; “fix(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/grok.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: crates/tokscale-core/src/sessions/opencodex.rs crates/tokscale-core/src/sessions/opencodex.rs:571— crates/tokscale-core/src/sessions/opencodex.rs changed 4 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 14 (its worst body is tokscale_core::sessions::opencodex::attribute_codex_messages_with_claims at line 571), 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(codex): attribute response usage from Magpie evidence (#1580)”; “fix(codex): match OpenCodex rows strict-first, late window second (#1530)”; “fix(codex): tolerate delayed OpenCodex combo usage timestamps (#1526)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/opencodex.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: crates/tokscale-core/src/sessions/freebuff.rs crates/tokscale-core/src/sessions/freebuff.rs:135— crates/tokscale-core/src/sessions/freebuff.rs changed 4 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 11 (its worst body is tokscale_core::sessions::freebuff::parse_freebuff_file at line 135), 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(freebuff): match free root agent segment instead of base2-free prefix (#1589)”; “fix(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”; “ci(rustdoc): gate cargo doc and fix broken intra-doc links (#1307)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/freebuff.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: crates/tokscale-cli/src/commands/usage/amp.rs crates/tokscale-cli/src/commands/usage/amp.rs:341— crates/tokscale-cli/src/commands/usage/amp.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is tokscale_cli::commands::usage::amp::fetch at line 341), 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(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/amp.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/frontend/src/lib/leaderboard/getLeaderboard.ts packages/frontend/src/lib/leaderboard/getLeaderboard.ts:165— packages/frontend/src/lib/leaderboard/getLeaderboard.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is getLeaderboard.resultQuery at line 165), 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(ranking): align profile and embed ranks with UTC windows (#1537)”; “fix(leaderboard): sum matching usage for all-time client and model filters (#1390)”; “fix(leaderboard): exclude hidden users from site-wide totals (#1377)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- packages/frontend/src/lib/leaderboard/getLeaderboard.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: crates/tokscale-cli/src/bin/fake_codex.rs crates/tokscale-cli/src/bin/fake_codex.rs:77— crates/tokscale-cli/src/bin/fake_codex.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is tokscale_cli::bin::fake_codex::main at line 77), 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(cli): explain cloud session coverage in client diagnostics (#1525)”; “fix: close two hang/double-count gaps found by adversarial review (#1173)”; “fix(cli): do not wait on stdout pump thread if headless capture times out (#1166)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/bin/fake_codex.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: crates/tokscale-cli/src/commands/usage/minimax.rs crates/tokscale-cli/src/commands/usage/minimax.rs:145— crates/tokscale-cli/src/commands/usage/minimax.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is tokscale_cli::commands::usage::minimax::fetch at line 145), 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(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/minimax.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: crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs:152— crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs changed 3 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 7 (its worst body is tokscale_cli::commands::usage::minimax_tokenplan::fetch_all at line 152), 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(usage): cache Claude quotas without blocking TUI startup (#1557)”; “fix(usage): bound quota HTTP requests (#1506)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”. 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-15..2026-11-13, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-15 07:28:23 +00:00' --until='2026-11-13 07:28:23 +00:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/minimax_tokenplan.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.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/antigravity.rs:771— crates/tokscale-cli/src/antigravity.rs:771-778 | crates/tokscale-cli/src/trae.rs:1134-1141 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `cache_dir` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/antigravity.rs:787— crates/tokscale-cli/src/antigravity.rs:787-794 | crates/tokscale-cli/src/trae.rs:1145-1152 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:787` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/antigravity.rs:2153— crates/tokscale-cli/src/antigravity.rs:2153-2160 | crates/tokscale-cli/src/antigravity.rs:2197-2204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/commands/import.rs:244— crates/tokscale-cli/src/commands/import.rs:244-251 | crates/tokscale-cli/src/commands/import.rs:264-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/commands/report.rs:1301— crates/tokscale-cli/src/commands/report.rs:1301-1308 | crates/tokscale-cli/src/commands/report.rs:1384-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/commands/report.rs:1309` calls `contains` and `crates/tokscale-cli/src/commands/report.rs:1392` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:1389— crates/tokscale-cli/src/commands/usage/codex.rs:1389-1397 | crates/tokscale-cli/src/commands/usage/codex.rs:1868-1875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/cursor.rs:1663— crates/tokscale-cli/src/cursor.rs:1663-1670 | crates/tokscale-cli/src/hindsight.rs:165-172 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-cli/src/cursor.rs:1663` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/hindsight.rs:375— crates/tokscale-cli/src/hindsight.rs:375-382 | crates/tokscale-cli/src/hindsight.rs:449-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/hindsight.rs:375` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:486— crates/tokscale-cli/src/tui/ui/daily.rs:486-493 | crates/tokscale-cli/src/tui/ui/models.rs:281-288 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/models.rs:280` calls `borrow`, `clone` and `crates/tokscale-cli/src/tui/ui/daily.rs:485` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crates/tokscale-core/src/legacy_graph.rs:256— crates/tokscale-core/src/legacy_graph.rs:256-263 | crates/tokscale-core/src/legacy_graph.rs:272-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/legacy_graph.rs:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `GraphResult` in one and `crate::GraphResultV2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/tokscale-core/src/lib.rs:9222— crates/tokscale-core/src/lib.rs:9222-9229 | crates/tokscale-core/src/lib.rs:9578-9585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `msg` to `&UnifiedMessage` in one and `&ParsedMessage` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/tokscale-core/src/machine_label.rs:256— crates/tokscale-core/src/machine_label.rs:256-263 | crates/tokscale-core/src/model_alias.rs:55-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/commandcode.rs:253— crates/tokscale-core/src/sessions/commandcode.rs:253-260 | crates/tokscale-core/src/sessions/zcode.rs:129-137 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/commandcode.rs:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/fx.rs:305— crates/tokscale-core/src/sessions/fx.rs:305-312 | crates/tokscale-core/src/sessions/fx.rs:372-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-core/src/wiki.rs:442— crates/tokscale-core/src/wiki.rs:442-449 | crates/tokscale-core/src/wiki.rs:484-491 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/wiki.rs:442` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/commands/usage/cursor.rs:685— crates/tokscale-cli/src/commands/usage/cursor.rs:685-692 | crates/tokscale-cli/src/commands/usage/cursor.rs:704-711 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/antigravity_cli.rs:970— crates/tokscale-core/src/sessions/antigravity_cli.rs:970-977 | crates/tokscale-core/src/sessions/grok.rs:1776-1783 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/augment.rs:91— crates/tokscale-core/src/sessions/augment.rs:91-98 | crates/tokscale-core/src/sessions/jcode.rs:90-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/junie.rs:168— crates/tokscale-core/src/sessions/junie.rs:168-175 | crates/tokscale-core/src/sessions/muse.rs:201-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/trae.rs:437— crates/tokscale-cli/src/trae.rs:437-448 | crates/tokscale-cli/src/trae.rs:1073-1080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/trae.rs:437` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/copilot_vscode.rs:362— crates/tokscale-core/src/sessions/copilot_vscode.rs:362-370 | crates/tokscale-core/src/sessions/qoder.rs:822-829 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-core/src/sessions/copilot_vscode.rs:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/antigravity.rs:877— crates/tokscale-cli/src/antigravity.rs:877-884 | crates/tokscale-cli/src/trae.rs:1229-1236 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:877` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `lock_path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/commands/usage/zai.rs:150— crates/tokscale-cli/src/commands/usage/zai.rs:150-157 | crates/tokscale-cli/src/commands/usage/zai.rs:163-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/usage/zai.rs:150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/main.rs:5051— crates/tokscale-cli/src/main.rs:5051-5058 | crates/tokscale-cli/src/main.rs:5064-5071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:5051` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/main.rs:5049` calls `is_empty` and `crates/tokscale-cli/src/main.rs:5061` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/commands/import.rs:198— crates/tokscale-cli/src/commands/import.rs:198-206 | crates/tokscale-cli/src/commands/import.rs:662-670 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/commands/usage/mod.rs:131— crates/tokscale-cli/src/commands/usage/mod.rs:131-139 | crates/tokscale-cli/src/tui/app.rs:259-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/tui/ui/agents.rs:92— crates/tokscale-cli/src/tui/ui/agents.rs:92-100 | crates/tokscale-cli/src/tui/ui/daily.rs:480-488 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/tui/ui/footer.rs:275— crates/tokscale-cli/src/tui/ui/footer.rs:275-283 | crates/tokscale-cli/src/tui/ui/footer.rs:295-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/tui/ui/footer.rs:436— crates/tokscale-cli/src/tui/ui/footer.rs:436-444 | crates/tokscale-cli/src/tui/ui/footer.rs:447-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/footer.rs:436` 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) crates/tokscale-cli/src/tui/ui/hourly.rs:274— crates/tokscale-cli/src/tui/ui/hourly.rs:274-282 | crates/tokscale-cli/src/tui/ui/minutely.rs:218-226 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/hourly.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/tui/ui/hourly.rs:299— crates/tokscale-cli/src/tui/ui/hourly.rs:299-307 | crates/tokscale-cli/src/tui/ui/hourly.rs:313-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/hourly.rs:299` it does not close everything it opens, so those exact lines 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) crates/tokscale-cli/src/tui/ui/monthly.rs:222— crates/tokscale-cli/src/tui/ui/monthly.rs:222-230 | crates/tokscale-cli/src/tui/ui/monthly.rs:435-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/tokscale-cli/src/tui/ui/projects.rs:366— crates/tokscale-cli/src/tui/ui/projects.rs:366-374 | crates/tokscale-cli/src/tui/ui/sessions.rs:679-687 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/projects.rs:366` 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) crates/tokscale-core/src/content_extractor.rs:95— crates/tokscale-core/src/content_extractor.rs:95-103 | crates/tokscale-core/src/content_extractor.rs:156-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/content_extractor.rs:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-core/src/content_extractor.rs:94` calls `contains` and `crates/tokscale-core/src/content_extractor.rs:155` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/tokscale-core/src/legacy_graph.rs:142— crates/tokscale-core/src/legacy_graph.rs:142-150 | crates/tokscale-core/src/legacy_graph.rs:155-163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `DailyContribution` in one and `crate::DailyContributionV2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crates/tokscale-core/src/lib.rs:8120— crates/tokscale-core/src/lib.rs:8120-8128 | crates/tokscale-core/src/lib.rs:8140-8148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:8120` 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) crates/tokscale-core/src/lib.rs:9322— crates/tokscale-core/src/lib.rs:9322-9330 | crates/tokscale-core/src/lib.rs:9464-9472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:9322` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-core/src/lib.rs:9473` calls `take_cost_estimate_source` and `crates/tokscale-core/src/lib.rs:9331` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) crates/tokscale-core/src/pricing/mod.rs:224— crates/tokscale-core/src/pricing/mod.rs:224-232 | crates/tokscale-core/src/pricing/mod.rs:452-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/pricing/mod.rs:224` 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) crates/tokscale-core/src/scanner.rs:229— crates/tokscale-core/src/scanner.rs:229-237 | crates/tokscale-core/src/scanner.rs:252-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/tokscale-core/src/sessions/amp.rs:165— crates/tokscale-core/src/sessions/amp.rs:165-173 | crates/tokscale-core/src/sessions/amp.rs:214-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/amp.rs:165` 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) crates/tokscale-core/src/sessions/copilot_vscode.rs:283— crates/tokscale-core/src/sessions/copilot_vscode.rs:283-291 | crates/tokscale-core/src/sessions/copilot_vscode.rs:309-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/copilot_vscode.rs:283` 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) crates/tokscale-core/src/sessions/prime_agent.rs:659— crates/tokscale-core/src/sessions/prime_agent.rs:659-667 | crates/tokscale-core/src/sessions/prime_agent.rs:777-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/prime_agent.rs:659` 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) scripts/check-release-workflow-safety.py:59— scripts/check-release-workflow-safety.py:59-67 | scripts/check-workflow-toolchain-paths.py:34-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×17
Duplicated block (11 lines × 2) crates/tokscale-cli/src/antigravity.rs:1206— crates/tokscale-cli/src/antigravity.rs:1206-1216 | crates/tokscale-cli/src/cursor.rs:615-625 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/cursor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:1206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/import.rs:717— crates/tokscale-cli/src/commands/import.rs:717-727 | crates/tokscale-cli/src/commands/import.rs:775-785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/import.rs:717` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/commands/import.rs:716` calls `attribute` and `crates/tokscale-cli/src/commands/import.rs:774` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:469— crates/tokscale-cli/src/commands/usage/codex.rs:469-479 | crates/tokscale-cli/src/commands/usage/opencode_go.rs:76-86 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:806— crates/tokscale-cli/src/commands/usage/codex.rs:806-816 | crates/tokscale-cli/src/cursor.rs:1293-1303 — 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 `crates/tokscale-cli/src/commands/usage/codex.rs:806` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `store` to `&CodexCredentialsStore` in one and `&CursorCredentialsStore` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:1428— crates/tokscale-cli/src/commands/usage/codex.rs:1428-1438 | crates/tokscale-cli/src/commands/usage/codex.rs:1905-1915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:2046— crates/tokscale-cli/src/commands/usage/codex.rs:2046-2056 | crates/tokscale-cli/src/cursor.rs:3065-3075 — 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 `crates/tokscale-cli/src/commands/usage/codex.rs:2046` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/main.rs:3728— crates/tokscale-cli/src/main.rs:3728-3738 | crates/tokscale-cli/src/main.rs:3778-3788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3728` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:1807— crates/tokscale-cli/src/tui/data/mod.rs:1807-1817 | crates/tokscale-cli/src/tui/data/mod.rs:1839-1849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/data/mod.rs:1807` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/tui/ui/bar_chart.rs:91— crates/tokscale-cli/src/tui/ui/bar_chart.rs:91-101 | crates/tokscale-cli/src/tui/ui/bar_chart.rs:150-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/bar_chart.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 (11 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:307— crates/tokscale-cli/src/tui/ui/daily.rs:307-317 | crates/tokscale-cli/src/tui/ui/daily.rs:330-340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:118— crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:118-128 | crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:130-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/tui/ui/stats.rs:47— crates/tokscale-cli/src/tui/ui/stats.rs:47-57 | crates/tokscale-cli/src/tui/ui/stats.rs:62-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/stats.rs:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/stats.rs:44` calls `contribution_cell` and `crates/tokscale-cli/src/tui/ui/stats.rs:60` 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) crates/tokscale-core/src/lib.rs:3503— crates/tokscale-core/src/lib.rs:3503-3513 | crates/tokscale-core/src/lib.rs:5314-5324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/tokscale-core/src/lib.rs:4366— crates/tokscale-core/src/lib.rs:4366-4376 | crates/tokscale-core/src/lib.rs:8262-8272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/tokscale-core/src/pricing/lookup.rs:1080— crates/tokscale-core/src/pricing/lookup.rs:1080-1090 | crates/tokscale-core/src/pricing/lookup.rs:1123-1133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/tokscale-core/src/pricing/lookup.rs:1971— crates/tokscale-core/src/pricing/lookup.rs:1971-1981 | crates/tokscale-core/src/pricing/mod.rs:702-712 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-core/src/pricing/lookup.rs:1971` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/tokscale-core/src/scanner.rs:1436— crates/tokscale-core/src/scanner.rs:1436-1446 | crates/tokscale-core/src/scanner.rs:1580-1590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/scanner.rs:1436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/commands/autosubmit.rs:703— crates/tokscale-cli/src/commands/autosubmit.rs:703-709 | crates/tokscale-cli/src/main.rs:1933-1939 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/main.rs:2649— crates/tokscale-cli/src/main.rs:2649-2656 | crates/tokscale-cli/src/main.rs:2905-2911 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2649` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/main.rs:3409— crates/tokscale-cli/src/main.rs:3409-3415 | crates/tokscale-cli/src/main.rs:3726-3732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3409` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/app.rs:2889— crates/tokscale-cli/src/tui/app.rs:2889-2895 | crates/tokscale-cli/src/tui/app.rs:2897-2903 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/app.rs:2889` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:942— crates/tokscale-cli/src/tui/data/mod.rs:942-948 | crates/tokscale-core/src/lib.rs:5992-5998 — 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 `crates/tokscale-cli/src/tui/data/mod.rs:942` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:193— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:193-199 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:121-127 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/ui/hourly_profile.rs:137— crates/tokscale-cli/src/tui/ui/hourly_profile.rs:137-143 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:192-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/hourly_profile.rs:137` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/ui/hourly_profile.rs:166— crates/tokscale-cli/src/tui/ui/hourly_profile.rs:166-172 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:233-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/hourly_profile.rs:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) crates/tokscale-core/src/lib.rs:7659— crates/tokscale-core/src/lib.rs:7659-7665 | crates/tokscale-core/src/lib.rs:7709-7715 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:7659` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-core/src/lib.rs:8288— crates/tokscale-core/src/lib.rs:8288-8294 | crates/tokscale-core/src/lib.rs:8650-8656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:8288` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-core/src/pricing/cache.rs:92— crates/tokscale-core/src/pricing/cache.rs:92-98 | crates/tokscale-core/src/sessions/opencode.rs:234-240 — 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 `crates/tokscale-core/src/pricing/cache.rs:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:40— crates/tokscale-cli/src/tui/data/mod.rs:40-46 | crates/tokscale-core/src/lib.rs:341-349 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/tokscale-core/src/sessions/junie.rs:253— crates/tokscale-core/src/sessions/junie.rs:253-259 | crates/tokscale-core/src/sessions/muse.rs:273-279 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) crates/tokscale-core/src/sessions/kiro.rs:709— crates/tokscale-core/src/sessions/kiro.rs:709-715 | crates/tokscale-core/src/sessions/kiro.rs:737-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/kiro.rs:709` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/tokscale-cli/src/main.rs:5874— crates/tokscale-cli/src/main.rs:5874-5884 | crates/tokscale-cli/src/main.rs:5887-5893 — both copies are in the same file, so extract the 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) crates/tokscale-cli/src/tui/ui/projects.rs:126— crates/tokscale-cli/src/tui/ui/projects.rs:126-132 | crates/tokscale-cli/src/tui/ui/sessions.rs:170-176 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/sessions.rs:178` calls `tr` and `crates/tokscale-cli/src/tui/ui/projects.rs:134` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/amp.rs:113— crates/tokscale-cli/src/amp.rs:113-122 | crates/tokscale-cli/src/commands/wrapped.rs:1221-1230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/commands/wrapped.rs:1133— crates/tokscale-cli/src/commands/wrapped.rs:1133-1142 | crates/tokscale-cli/src/commands/wrapped.rs:1156-1165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/main.rs:2765— crates/tokscale-cli/src/main.rs:2765-2774 | crates/tokscale-cli/src/main.rs:2967-2976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2765` 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) crates/tokscale-cli/src/tui/app.rs:2426— crates/tokscale-cli/src/tui/app.rs:2426-2435 | crates/tokscale-cli/src/tui/app.rs:2440-2449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/app.rs:2426` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:164— crates/tokscale-cli/src/tui/ui/daily.rs:164-173 | crates/tokscale-cli/src/tui/ui/monthly.rs:181-190 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/monthly.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 350 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/tui/ui/minutely.rs:298— crates/tokscale-cli/src/tui/ui/minutely.rs:298-307 | crates/tokscale-cli/src/tui/ui/sessions.rs:754-763 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/minutely.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 113 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/minutely.rs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/tui/ui/stats.rs:379— crates/tokscale-cli/src/tui/ui/stats.rs:379-388 | crates/tokscale-cli/src/tui/ui/stats.rs:501-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/stats.rs:379` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) crates/tokscale-core/src/aggregator.rs:650— crates/tokscale-core/src/aggregator.rs:650-659 | crates/tokscale-core/src/aggregator.rs:840-849 — both copies are in the same file, so extract the 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) crates/tokscale-core/src/lib.rs:2561— crates/tokscale-core/src/lib.rs:2561-2570 | crates/tokscale-core/src/lib.rs:2599-2608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:2561` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/tokscale-core/src/lib.rs:9322— crates/tokscale-core/src/lib.rs:9322-9331 | crates/tokscale-core/src/lib.rs:9411-9420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:9322` 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) crates/tokscale-core/src/sessions/kiro.rs:1130— crates/tokscale-core/src/sessions/kiro.rs:1130-1139 | crates/tokscale-core/src/sessions/kiro.rs:1347-1356 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/kiro.rs:1130` 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) crates/tokscale-core/src/sessions/qoder.rs:165— crates/tokscale-core/src/sessions/qoder.rs:165-174 | crates/tokscale-core/src/sessions/qwen.rs:81-90 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-core/src/sessions/qoder.rs:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-core/src/sessions/qoder.rs:176` calls `Some` and `crates/tokscale-core/src/sessions/qwen.rs:92` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/tokscale-core/src/sessions/commandcode.rs:582— crates/tokscale-core/src/sessions/commandcode.rs:582-591 | crates/tokscale-core/src/sessions/zcode.rs:574-583 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/antigravity.rs:706— crates/tokscale-cli/src/antigravity.rs:706-719 | crates/tokscale-cli/src/commands/usage/codex.rs:369-378 — 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 `crates/tokscale-cli/src/antigravity.rs:706` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) crates/tokscale-core/src/sessions/synthetic.rs:188— crates/tokscale-core/src/sessions/synthetic.rs:188-197 | crates/tokscale-core/src/sessions/synthetic.rs:241-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/synthetic.rs:188` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/main.rs:2699— crates/tokscale-cli/src/main.rs:2699-2703 | crates/tokscale-cli/src/main.rs:3066-3070 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/main.rs:3013— crates/tokscale-cli/src/main.rs:3013-3019 | crates/tokscale-cli/src/main.rs:3534-3538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3013` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/tui/ui/projects.rs:488— crates/tokscale-cli/src/tui/ui/projects.rs:488-492 | crates/tokscale-cli/src/tui/ui/sessions.rs:837-841 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/projects.rs:488` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/tui/ui/usage.rs:2366— crates/tokscale-cli/src/tui/ui/usage.rs:2366-2370 | crates/tokscale-cli/src/tui/ui/usage.rs:2410-2414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/usage.rs:2366` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-core/src/recovery.rs:440— crates/tokscale-core/src/recovery.rs:440-444 | crates/tokscale-core/src/recovery.rs:449-454 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/recovery.rs:449` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-core/src/sessions/codebuff.rs:287— crates/tokscale-core/src/sessions/codebuff.rs:287-291 | crates/tokscale-core/src/sessions/codebuff.rs:329-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/codebuff.rs:287` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-core/src/sessions/claudecode.rs:1542— crates/tokscale-core/src/sessions/claudecode.rs:1542-1546 | crates/tokscale-core/src/sessions/codex.rs:2200-2204 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/tokscale-core/src/sessions/copilot_session_state.rs:51— crates/tokscale-core/src/sessions/copilot_session_state.rs:51-55 | crates/tokscale-core/src/sessions/copilot_vscode.rs:9-13 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/main.rs:6038— crates/tokscale-cli/src/main.rs:6038-6042 | crates/tokscale-core/src/sessions/opencode.rs:224-232 — 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 `crates/tokscale-cli/src/main.rs:6038` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-core/src/scanner.rs:1747— crates/tokscale-core/src/scanner.rs:1747-1751 | crates/tokscale-core/src/scanner.rs:1768-1772 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/main.rs:6035— crates/tokscale-cli/src/main.rs:6035-6039 | crates/tokscale-cli/src/tui/settings.rs:834-838 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/commands/usage/antigravity.rs:604— crates/tokscale-cli/src/commands/usage/antigravity.rs:604-608 | crates/tokscale-cli/src/commands/usage/antigravity.rs:745-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/usage/antigravity.rs:604` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/commands/usage/sakana.rs:331— crates/tokscale-cli/src/commands/usage/sakana.rs:331-335 | crates/tokscale-cli/src/commands/usage/sakana.rs:366-370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/tokscale-core/src/pricing/litellm.rs:171— crates/tokscale-core/src/pricing/litellm.rs:171-175 | crates/tokscale-core/src/pricing/litellm.rs:189-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/tokscale-core/src/sessions/bb.rs:657— crates/tokscale-core/src/sessions/bb.rs:657-661 | crates/tokscale-core/src/sessions/devin.rs:306-310 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/auth.rs:291— crates/tokscale-cli/src/auth.rs:291-304 | crates/tokscale-cli/src/auth.rs:370-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/auth.rs:291` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:1184— crates/tokscale-cli/src/commands/usage/codex.rs:1184-1195 | crates/tokscale-cli/src/commands/usage/codex.rs:1205-1216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/tui/ui/agents.rs:86— crates/tokscale-cli/src/tui/ui/agents.rs:86-97 | crates/tokscale-cli/src/tui/ui/models.rs:268-279 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/models.rs:280` calls `borrow`, `clone` and `crates/tokscale-cli/src/tui/ui/agents.rs:98` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:220— crates/tokscale-cli/src/tui/ui/daily.rs:220-231 | crates/tokscale-cli/src/tui/ui/monthly.rs:441-452 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/monthly.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 350 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/tui/ui/usage.rs:2342— crates/tokscale-cli/src/tui/ui/usage.rs:2342-2353 | crates/tokscale-cli/src/tui/ui/usage.rs:2388-2399 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/tokscale-core/src/content_extractor.rs:81— crates/tokscale-core/src/content_extractor.rs:81-92 | crates/tokscale-core/src/content_extractor.rs:146-157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/content_extractor.rs:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-core/src/content_extractor.rs:94` calls `contains` and `crates/tokscale-core/src/content_extractor.rs:159` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/tokscale-core/src/legacy_graph.rs:168— crates/tokscale-core/src/legacy_graph.rs:168-179 | crates/tokscale-core/src/legacy_graph.rs:184-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `SessionContribution` in one and `crate::SessionContributionV2` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) crates/tokscale-core/src/lib.rs:4081— crates/tokscale-core/src/lib.rs:4081-4092 | crates/tokscale-core/src/lib.rs:5418-5429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4081` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/tokscale-core/src/scanner.rs:2936— crates/tokscale-core/src/scanner.rs:2936-2947 | crates/tokscale-core/src/scanner.rs:2954-2965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/scanner.rs:2936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/tokscale-core/src/sessions/mcode.rs:91— crates/tokscale-core/src/sessions/mcode.rs:91-102 | crates/tokscale-core/src/sessions/mcode.rs:118-129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/mcode.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 (12 lines × 2) crates/tokscale-cli/src/commands/autosubmit.rs:1480— crates/tokscale-cli/src/commands/autosubmit.rs:1480-1491 | crates/tokscale-cli/src/commands/autosubmit.rs:1575-1586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/autosubmit.rs:1480` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/tokscale-cli/src/commands/usage/opencode_go.rs:195— crates/tokscale-cli/src/commands/usage/opencode_go.rs:195-206 | crates/tokscale-cli/src/cursor.rs:2349-2360 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/main.rs:2624— crates/tokscale-cli/src/main.rs:2624-2629 | crates/tokscale-cli/src/main.rs:2875-2880 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2624` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/tui/app.rs:2875— crates/tokscale-cli/src/tui/app.rs:2875-2880 | crates/tokscale-cli/src/tui/app.rs:2882-2887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/app.rs:2875` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/tui/ui/hourly.rs:145— crates/tokscale-cli/src/tui/ui/hourly.rs:145-150 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:50-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-cli/src/tui/ui/hourly.rs:145` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/tui/ui/usage.rs:2355— crates/tokscale-cli/src/tui/ui/usage.rs:2355-2361 | crates/tokscale-cli/src/tui/ui/usage.rs:2401-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/usage.rs:2355` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/tokscale-core/src/lib.rs:3434— crates/tokscale-core/src/lib.rs:3434-3439 | crates/tokscale-core/src/lib.rs:7720-7725 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/tokscale-core/src/scanner.rs:2122— crates/tokscale-core/src/scanner.rs:2122-2127 | crates/tokscale-core/src/scanner.rs:2153-2158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/scanner.rs:2122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) REDACTED:271— REDACTED:271-276 | crates/tokscale-core/src/sessions/proma.rs:133-139 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:277` calls `Some`, `get`, `and_then` and `crates/tokscale-core/src/sessions/proma.rs:140` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crates/tokscale-core/src/sessions/gjc.rs:99— crates/tokscale-core/src/sessions/gjc.rs:99-104 | crates/tokscale-core/src/sessions/pi.rs:831-836 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/commands/report.rs:100— crates/tokscale-cli/src/commands/report.rs:100-105 | crates/tokscale-cli/src/commands/report.rs:107-112 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/report.rs:100` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/tokscale-core/src/sessions/kiro.rs:987— crates/tokscale-core/src/sessions/kiro.rs:987-992 | crates/tokscale-core/src/sessions/kiro.rs:994-999 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/kiro.rs:987` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/tokscale-core/src/pricing/custom.rs:293— crates/tokscale-core/src/pricing/custom.rs:293-298 | crates/tokscale-core/src/pricing/custom.rs:314-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/antigravity.rs:904— crates/tokscale-cli/src/antigravity.rs:904-909 | crates/tokscale-cli/src/trae.rs:1185-1190 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/antigravity.rs:1869— crates/tokscale-cli/src/antigravity.rs:1869-1881 | crates/tokscale-cli/src/antigravity.rs:2780-2792 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:1869` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/tui/cache.rs:372— crates/tokscale-cli/src/tui/cache.rs:372-384 | crates/tokscale-cli/src/tui/cache.rs:441-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `CachedDailyModelInfo` in one and `CachedHourlyModelInfo` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/tui/ui/minutely.rs:246— crates/tokscale-cli/src/tui/ui/minutely.rs:246-258 | crates/tokscale-cli/src/tui/ui/minutely.rs:271-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/minutely.rs:246` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/tui/ui/projects.rs:431— crates/tokscale-cli/src/tui/ui/projects.rs:431-443 | crates/tokscale-cli/src/tui/ui/sessions.rs:758-770 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/projects.rs:431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/tui/ui/stats.rs:409— crates/tokscale-cli/src/tui/ui/stats.rs:409-421 | crates/tokscale-cli/src/tui/ui/stats.rs:462-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/stats.rs:409` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/tokscale-core/src/lib.rs:4148— crates/tokscale-core/src/lib.rs:4148-4160 | crates/tokscale-core/src/lib.rs:4179-4191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4148` 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) crates/tokscale-core/src/lib.rs:4973— crates/tokscale-core/src/lib.rs:4973-4985 | crates/tokscale-core/src/lib.rs:4996-5008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4973` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) REDACTED:3104— REDACTED:3104-3116 | REDACTED:3155-3167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:3104` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `LegacyCachedSourceEntryV5` in one and `LegacyCachedSourceEntryV6` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) crates/tokscale-core/src/pricing/lookup.rs:1055— crates/tokscale-core/src/pricing/lookup.rs:1055-1067 | crates/tokscale-core/src/pricing/lookup.rs:1110-1122 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/tokscale-core/src/lib.rs:4241— crates/tokscale-core/src/lib.rs:4241-4253 | crates/tokscale-core/src/lib.rs:8179-8191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/tokscale-core/src/wiki.rs:161— crates/tokscale-core/src/wiki.rs:161-173 | crates/tokscale-core/src/wiki.rs:177-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
MethodTooLong: DataLoader.aggregate_messages crates/tokscale-cli/src/tui/data/mod.rs:801— MethodTooLong — aggregate_messages runs 744 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 644 over it, 7.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: Theme.from_name_with_color_mode crates/tokscale-cli/src/tui/themes.rs:225— MethodTooLong — from_name_with_color_mode runs 227 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 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PricingLookup.lookup_auto crates/tokscale-core/src/pricing/lookup.rs:909— MethodTooLong — lookup_auto runs 211 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 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SessionDetailDialog.build_lines crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:51— MethodTooLong — build_lines runs 197 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 97 over it, 1.97× 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: SchemaAccumulator.ingest crates/tokscale-core/src/sessions/opencode_schema.rs:906— MethodTooLong — ingest runs 174 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 74 over it, 1.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: App.handle_key_event crates/tokscale-cli/src/tui/app.rs:896— MethodTooLong — handle_key_event runs 154 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 54 over it, 1.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: App.new_with_cached_data_and_ambient_width crates/tokscale-cli/src/tui/app.rs:444— MethodTooLong — new_with_cached_data_and_ambient_width runs 140 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 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SourceMessageCache.save_if_dirty_with_limit REDACTED:3966— MethodTooLong — save_if_dirty_with_limit runs 128 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 28 over it, 1.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: CustomPricing.load_from_str crates/tokscale-core/src/pricing/custom.rs:412— MethodTooLong — load_from_str runs 125 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 25 over it, 1.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CustomModelPricing.into_model_pricing crates/tokscale-core/src/pricing/custom.rs:147— MethodTooLong — into_model_pricing runs 113 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 13 over it, 1.13× 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×10
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
X2 · Cancellation propagation· Async function without AbortSignal · ×10
Async function without AbortSignal: fetchArrayBuffer packages/frontend/src/lib/og/fonts.ts:62— `fetchArrayBuffer` 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: loadManrope packages/frontend/src/lib/og/fonts.ts:72— `loadManrope` 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: exchangeCodeForToken packages/frontend/src/lib/auth/github.ts:32— `exchangeCodeForToken` 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: getGitHubUser packages/frontend/src/lib/auth/github.ts:61— `getGitHubUser` 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: getGitHubUserEmail packages/frontend/src/lib/auth/github.ts:79— `getGitHubUserEmail` 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: onConfirm packages/frontend/src/app/settings/SettingsClient.tsx:542— `onConfirm` 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: onConfirm packages/frontend/src/app/settings/SettingsClient.tsx:579— `onConfirm` 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: fetchApiTokens packages/frontend/src/app/settings/SettingsClient.tsx:697— `fetchApiTokens` 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: fetchDevices packages/frontend/src/app/settings/SettingsClient.tsx:703— `fetchDevices` 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: loadSettings packages/frontend/src/app/settings/SettingsClient.tsx:740— `loadSettings` 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 })`.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×9
Edited copy of a member (11 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:3211— crates/tokscale-core/src/pricing/lookup.rs:3211-3221 | crates/tokscale-core/src/pricing/lookup.rs:3589-3610 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/antigravity.rs:3580— crates/tokscale-cli/src/antigravity.rs:3580-3590 | crates/tokscale-cli/src/antigravity.rs:3592-3606 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-core/src/legacy_graph.rs:255— crates/tokscale-core/src/legacy_graph.rs:255-267 | crates/tokscale-core/src/legacy_graph.rs:271-281 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/commands/usage/grok.rs:138— crates/tokscale-cli/src/commands/usage/grok.rs:138-148 | crates/tokscale-cli/src/commands/usage/sakana.rs:484-500 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/cursor.rs:2573— crates/tokscale-cli/src/cursor.rs:2573-2583 | crates/tokscale-cli/src/cursor.rs:2739-2749 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/commands/usage/sakana.rs:376— crates/tokscale-cli/src/commands/usage/sakana.rs:376-389 | crates/tokscale-cli/src/commands/usage/sakana.rs:392-402 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/tui/app.rs:1997— crates/tokscale-cli/src/tui/app.rs:1997-2007 | crates/tokscale-cli/src/tui/app.rs:2009-2020 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-core/src/sessions/hermes.rs:730— crates/tokscale-core/src/sessions/hermes.rs:730-747 | REDACTED:596-606 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/tokscale-cli/src/cursor.rs:367— crates/tokscale-cli/src/cursor.rs:367-377 | crates/tokscale-cli/src/cursor.rs:382-395 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Change coupling: LeaderboardClient.tsx ↔ REDACTED packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1— `packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx` and `REDACTED` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `63e6e785` perf(leaderboard): move leaderboard aggregation into PostgreSQL (#871); `4cb06e2f` feat(leaderboard): drop estimated time as a public metric (#860); `14c17b64` fix(leaderboard): preserve filters and paginate groups — run `git show` on any of them.
Change coupling: clients.rs ↔ mod.rs crates/tokscale-core/src/clients.rs:1— `crates/tokscale-core/src/clients.rs` and `crates/tokscale-core/src/sessions/mod.rs` change together 63% of the time (46 of the 73 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 46 shared commits counted here, the most recent 3 are `2f981776` feat(qoder): add support for Qoder and Qoder CN client (#1609) (#1612); `7ba974f7` feat(bb): add support for BB client (#1561) (#1588); `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539) — run `git show` on any of them.
Change coupling: mod.rs ↔ widgets.rs crates/tokscale-cli/src/tui/data/mod.rs:1— `crates/tokscale-cli/src/tui/data/mod.rs` and `crates/tokscale-cli/src/tui/ui/widgets.rs` change together 59% of the time (24 of the 41 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 24 shared commits counted here, the most recent 3 are `2f981776` feat(qoder): add support for Qoder and Qoder CN client (#1609) (#1612); `7ba974f7` feat(bb): add support for BB client (#1561) (#1588); `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539) — run `git show` on any of them.
Change coupling: clients.rs ↔ types.ts crates/tokscale-core/src/clients.rs:1— `crates/tokscale-core/src/clients.rs` and `packages/frontend/src/lib/types.ts` change together 58% of the time (36 of the 62 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 36 shared commits counted here, the most recent 3 are `2f981776` feat(qoder): add support for Qoder and Qoder CN client (#1609) (#1612); `7ba974f7` feat(bb): add support for BB client (#1561) (#1588); `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539) — run `git show` on any of them.
Change coupling: scanner.rs ↔ types.ts crates/tokscale-core/src/scanner.rs:1— `crates/tokscale-core/src/scanner.rs` and `packages/frontend/src/lib/types.ts` change together 56% of the time (35 of the 62 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 35 shared commits counted here, the most recent 3 are `2f981776` feat(qoder): add support for Qoder and Qoder CN client (#1609) (#1612); `7ba974f7` feat(bb): add support for BB client (#1561) (#1588); `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539) — run `git show` on any of them.
Change coupling: aggregator.rs ↔ sessionize.rs crates/tokscale-core/src/aggregator.rs:1— `crates/tokscale-core/src/aggregator.rs` and `crates/tokscale-core/src/sessionize.rs` change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e9cf1041` fix(bb): count Claude and Codex responses mirrored by BB once (#1608); `82e20b0e` fix(copilot): merge duplicate OTEL snapshots across files (#1434); `7ffa5df7` feat(pi): show session titles and roll subagents into parents (#1382) — run `git show` on any of them.
Change coupling: wrapped.rs ↔ mod.rs crates/tokscale-cli/src/commands/wrapped.rs:1— `crates/tokscale-cli/src/commands/wrapped.rs` and `crates/tokscale-cli/src/tui/data/mod.rs` change together 56% of the time (28 of the 50 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 28 shared commits counted here, the most recent 3 are `d409ee07` feat(muse): add Muse Code CLI session tracking; `3fdaf158` fix(reports): preserve reasoning totals and client display metadata (…; `e306ef57` feat(clients): add Freebuff session parsing (#1064) — run `git show` on any of them.
Change coupling: REDACTED ↔ REDACTED packages/frontend/src/app/api/submit/route.ts:1— `packages/frontend/src/app/api/submit/route.ts` and `REDACTED` change together 55% of the time (16 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `a3e26aba` fix(leaderboard): widen cost casts to match numeric(18,4) columns (#780); `e644f966` feat: display MCP servers in profile Statistics panel (#675); `157ab041` chore(db): drop dead columns + redundant indexes + unique constraint … — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×8
Edited copy of a member (12 corresponding lines) crates/tokscale-core/src/scanner.rs:1741— crates/tokscale-core/src/scanner.rs:1741-1756 | crates/tokscale-core/src/scanner.rs:1765-1776 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-cli/src/commands/autosubmit.rs:1339— crates/tokscale-cli/src/commands/autosubmit.rs:1339-1350 | crates/tokscale-cli/src/commands/autosubmit.rs:1352-1367 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-cli/src/main.rs:4513— crates/tokscale-cli/src/main.rs:4513-4524 | crates/tokscale-cli/src/tui/ui/widgets.rs:94-105 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-core/src/sessions/kiro.rs:118— crates/tokscale-core/src/sessions/kiro.rs:118-129 | crates/tokscale-core/src/sessions/kiro.rs:1934-1946 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-core/src/sessions/magpie.rs:36— crates/tokscale-core/src/sessions/magpie.rs:36-49 | crates/tokscale-core/src/sessions/magpie.rs:51-62 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-cli/src/commands/report.rs:1675— crates/tokscale-cli/src/commands/report.rs:1675-1686 | crates/tokscale-cli/src/tui/ui/widgets.rs:14-26 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/tokscale-core/src/sessions/kiro.rs:520— crates/tokscale-core/src/sessions/kiro.rs:520-531 | crates/tokscale-core/src/sessions/utils.rs:654-665 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) scripts/check-release-workflow-safety.py:47— scripts/check-release-workflow-safety.py:47-67 | scripts/check-workflow-toolchain-paths.py:31-42 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×8
Edited copy of a member (7 corresponding lines) crates/tokscale-cli/src/antigravity.rs:903— crates/tokscale-cli/src/antigravity.rs:903-909 | crates/tokscale-cli/src/trae.rs:1184-1190 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) REDACTED:715— REDACTED:715-721 | REDACTED:734-740 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-core/src/claude_desktop/v8.rs:598— crates/tokscale-core/src/claude_desktop/v8.rs:598-604 | crates/tokscale-core/src/claude_desktop/v8.rs:606-613 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-core/src/sessions/antigravity.rs:6— crates/tokscale-core/src/sessions/antigravity.rs:6-12 | crates/tokscale-core/src/sessions/antigravity_cli.rs:917-923 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-cli/src/auth.rs:90— crates/tokscale-cli/src/auth.rs:90-98 | crates/tokscale-cli/src/trae.rs:194-200 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-core/src/clients.rs:23— crates/tokscale-core/src/clients.rs:23-29 | crates/tokscale-core/src/scanner.rs:880-886 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-core/src/sessions/kimi.rs:112— crates/tokscale-core/src/sessions/kimi.rs:112-118 | crates/tokscale-core/src/sessions/roocode.rs:211-218 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (7 corresponding lines) crates/tokscale-cli/src/commands/usage/cursor.rs:432— crates/tokscale-cli/src/commands/usage/cursor.rs:432-439 | crates/tokscale-core/src/sessions/cursor.rs:445-451 — 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.
Duplicated block (14 lines × 2) crates/tokscale-cli/src/tui/ui/hourly_profile.rs:145— crates/tokscale-cli/src/tui/ui/hourly_profile.rs:145-158 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:207-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/hourly_profile.rs:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/tokscale-cli/src/tui/ui/models.rs:423— crates/tokscale-cli/src/tui/ui/models.rs:423-436 | crates/tokscale-cli/src/tui/ui/models.rs:461-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/models.rs:423` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/tokscale-core/src/lib.rs:2531— crates/tokscale-core/src/lib.rs:2531-2544 | crates/tokscale-core/src/lib.rs:2872-2885 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:2531` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crates/tokscale-core/src/lib.rs:5089— crates/tokscale-core/src/lib.rs:5089-5103 | crates/tokscale-core/src/lib.rs:5246-5259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:5089` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/tokscale-core/src/sessions/dsh.rs:164— crates/tokscale-core/src/sessions/dsh.rs:164-177 | crates/tokscale-core/src/sessions/dsh.rs:186-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/dsh.rs:164` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/tokscale-core/src/sessions/junie.rs:273— crates/tokscale-core/src/sessions/junie.rs:273-286 | crates/tokscale-core/src/sessions/muse.rs:293-306 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) crates/tokscale-core/src/content_extractor.rs:340— crates/tokscale-core/src/content_extractor.rs:340-353 | crates/tokscale-core/src/content_extractor.rs:363-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyFields: App crates/tokscale-cli/src/tui/app.rs:318— TooManyFields — 71 stored fields beside 114 methods. The bar is 30 stored fields; this is 41 over it, 2.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CodexParseState crates/tokscale-core/src/sessions/codex.rs:305— TooManyFields — 35 stored fields beside 6 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CustomModelPricing crates/tokscale-core/src/pricing/custom.rs:53— TooManyFields — 35 stored fields beside 2 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Glyphs crates/tokscale-cli/src/ui_glyphs.rs:20— TooManyFields — 34 stored fields beside 4 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LegacyCodexStateV19 REDACTED:1294— TooManyFields — 33 stored fields. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LegacyCodexStateV15 REDACTED:1152— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×6
Edited copy of a member (19 corresponding lines) crates/tokscale-core/src/sessions/utils.rs:103— crates/tokscale-core/src/sessions/utils.rs:103-121 | crates/tokscale-core/src/sessions/utils.rs:156-181 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/antigravity.rs:1972— crates/tokscale-cli/src/antigravity.rs:1972-1992 | crates/tokscale-cli/src/antigravity.rs:1995-2013 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/tokscale-core/src/scanner.rs:1428— crates/tokscale-core/src/scanner.rs:1428-1448 | crates/tokscale-core/src/scanner.rs:1574-1592 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/tui/app.rs:1404— crates/tokscale-cli/src/tui/app.rs:1404-1422 | crates/tokscale-cli/src/tui/app.rs:1424-1442 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/commands/autosubmit.rs:1157— crates/tokscale-cli/src/commands/autosubmit.rs:1157-1175 | crates/tokscale-cli/src/commands/autosubmit.rs:1189-1210 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (19 corresponding lines) crates/tokscale-cli/src/tui/data/mod.rs:1806— crates/tokscale-cli/src/tui/data/mod.rs:1806-1824 | crates/tokscale-cli/src/tui/data/mod.rs:1838-1856 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×6
Edited copy of a member (14 corresponding lines) REDACTED:242— REDACTED:242-255 | crates/tokscale-core/src/sessions/qwen.rs:205-220 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/tokscale-cli/src/commands/usage/grok.rs:123— crates/tokscale-cli/src/commands/usage/grok.rs:123-136 | crates/tokscale-cli/src/commands/usage/grok.rs:739-755 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/tokscale-cli/src/cursor.rs:1660— crates/tokscale-cli/src/cursor.rs:1660-1674 | crates/tokscale-cli/src/hindsight.rs:163-176 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/tokscale-cli/src/tui/ui/stats.rs:876— crates/tokscale-cli/src/tui/ui/stats.rs:876-889 | crates/tokscale-cli/src/tui/ui/widgets.rs:130-143 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/tokscale-cli/src/tui/app.rs:2984— crates/tokscale-cli/src/tui/app.rs:2984-2997 | crates/tokscale-cli/src/tui/app.rs:2999-3013 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (14 corresponding lines) crates/tokscale-cli/src/cursor.rs:2386— crates/tokscale-cli/src/cursor.rs:2386-2399 | crates/tokscale-cli/src/cursor.rs:2751-2764 — 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 (8 corresponding lines) · ×6
Edited copy of a member (8 corresponding lines) crates/tokscale-core/src/sessions/cline.rs:120— crates/tokscale-core/src/sessions/cline.rs:120-128 | crates/tokscale-core/src/sessions/roocode.rs:383-390 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) REDACTED:135— REDACTED:135-142 | REDACTED:277-288 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/tokscale-cli/src/commands/autosubmit.rs:702— crates/tokscale-cli/src/commands/autosubmit.rs:702-709 | crates/tokscale-cli/src/main.rs:1932-1939 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/tokscale-core/src/sessions/codex.rs:2707— crates/tokscale-core/src/sessions/codex.rs:2707-2714 | crates/tokscale-core/src/sessions/devin.rs:553-561 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) crates/tokscale-cli/src/auth.rs:100— crates/tokscale-cli/src/auth.rs:100-108 | crates/tokscale-cli/src/trae.rs:202-209 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (8 corresponding lines) REDACTED:4860— REDACTED:4860-4867 | crates/tokscale-core/src/sessions/opencode_schema.rs:1529-1536 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×5
Animation without a prefers-reduced-motion guard packages/frontend/src/components/DataInput.tsx:459— `svg` moves (`animation: _______ 1s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/frontend/src/components/layout/Footer.tsx:179— `.css-in-js` moves (`animation: spin 60s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/frontend/src/components/landing/sections/HeroSection.tsx:479— `svg` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/frontend/src/components/home/InstagramSection.tsx:139— `a ____________ img` moves (`transition: transform 160ms ease, box-shadow 160ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Animation without a prefers-reduced-motion guard packages/frontend/src/components/home/primitives.tsx:132— `.css-in-js ____________ span[aria-hidden]` moves (`transition: transform 120ms ease`) 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.
PricingLookup::lookup_auto (cognitive 83) crates/tokscale-core/src/pricing/lookup.rs:909— PricingLookup::lookup_auto has cognitive complexity 83 (threshold 15). Drivers by points: if/else 52 (77 pts), boolean chains 6 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PricingLookup::resolve_with_source_and_provider (cognitive 30) crates/tokscale-core/src/pricing/lookup.rs:707— PricingLookup::resolve_with_source_and_provider has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 5, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
PricingLookup::new_with_archive (cognitive 26) crates/tokscale-core/src/pricing/lookup.rs:439— PricingLookup::new_with_archive has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5, match/switch 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PricingLookup::resolve_for_usage (cognitive 19) crates/tokscale-core/src/pricing/lookup.rs:2069— PricingLookup::resolve_for_usage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5 (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.
PricingLookup::lookup_openrouter_only (cognitive 16) crates/tokscale-core/src/pricing/lookup.rs:1387— PricingLookup::lookup_openrouter_only has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (16 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×5
Edited copy of a member (15 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:1637— crates/tokscale-core/src/pricing/lookup.rs:1637-1651 | crates/tokscale-core/src/pricing/lookup.rs:1653-1667 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/tokscale-core/src/sessions/grok.rs:1695— crates/tokscale-core/src/sessions/grok.rs:1695-1712 | crates/tokscale-core/src/sessions/grok.rs:1714-1728 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/tokscale-cli/src/tui/cache.rs:465— crates/tokscale-cli/src/tui/cache.rs:465-479 | crates/tokscale-cli/src/tui/cache.rs:507-521 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) REDACTED:426— REDACTED:426-440 | REDACTED:443-457 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) crates/tokscale-cli/src/antigravity.rs:876— crates/tokscale-cli/src/antigravity.rs:876-890 | crates/tokscale-cli/src/trae.rs:1228-1242 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
App::on_tick (cognitive 33) crates/tokscale-cli/src/tui/app.rs:711— App::on_tick has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::handle_key_event (cognitive 23) crates/tokscale-cli/src/tui/app.rs:896— App::handle_key_event has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 4 (7 pts), boolean chains 6 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App::poll_codex_login (cognitive 20) crates/tokscale-cli/src/tui/app.rs:809— App::poll_codex_login has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (8 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.
App::new_with_cached_data_and_ambient_width (cognitive 16) crates/tokscale-cli/src/tui/app.rs:444— App::new_with_cached_data_and_ambient_width has cognitive complexity 16 (threshold 15). Drivers by points: if/else 15, 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.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×4
Edited copy of a member (21 corresponding lines) crates/tokscale-core/src/scanner.rs:228— crates/tokscale-core/src/scanner.rs:228-248 | crates/tokscale-core/src/scanner.rs:251-271 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/tokscale-core/src/provider_identity.rs:73— crates/tokscale-core/src/provider_identity.rs:73-93 | crates/tokscale-core/src/provider_identity.rs:124-148 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:211— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:211-232 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:138-158 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs:805— crates/tokscale-cli/src/commands/usage/codex.rs:805-830 | crates/tokscale-cli/src/cursor.rs:1292-1312 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×4
Edited copy of a member (13 corresponding lines) crates/tokscale-cli/src/tui/app.rs:2423— crates/tokscale-cli/src/tui/app.rs:2423-2435 | crates/tokscale-cli/src/tui/app.rs:2437-2449 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/tokscale-core/src/machine_label.rs:253— crates/tokscale-core/src/machine_label.rs:253-265 | crates/tokscale-core/src/model_alias.rs:48-65 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/tokscale-cli/src/main.rs:4549— crates/tokscale-cli/src/main.rs:4549-4562 | crates/tokscale-core/src/lib.rs:6157-6169 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (13 corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs:2069— crates/tokscale-cli/src/commands/usage/codex.rs:2069-2081 | crates/tokscale-cli/src/commands/usage/codex.rs:2083-2099 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×4
Edited copy of a member (10 corresponding lines) crates/tokscale-cli/src/tui/cache.rs:892— crates/tokscale-cli/src/tui/cache.rs:892-901 | crates/tokscale-core/src/sessions/opencode.rs:192-204 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/tokscale-core/src/sessions/cursor.rs:242— crates/tokscale-core/src/sessions/cursor.rs:242-251 | crates/tokscale-core/src/sessions/utils.rs:797-806 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/tokscale-cli/src/commands/usage/cursor.rs:967— crates/tokscale-cli/src/commands/usage/cursor.rs:967-976 | crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs:66-75 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) REDACTED:2451— REDACTED:2451-2460 | crates/tokscale-core/src/sessions/grok.rs:1079-1090 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×4
Edited copy of a member (6 corresponding lines) crates/tokscale-core/src/claude_desktop/mod.rs:208— crates/tokscale-core/src/claude_desktop/mod.rs:208-217 | crates/tokscale-core/src/sessions/prime_agent.rs:320-325 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/tokscale-cli/src/antigravity.rs:3571— crates/tokscale-cli/src/antigravity.rs:3571-3578 | crates/tokscale-core/src/sessions/codebuff.rs:128-133 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/tokscale-core/src/sessions/grok.rs:56— crates/tokscale-core/src/sessions/grok.rs:56-61 | crates/tokscale-core/src/sessions/unsloth.rs:33-38 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/tokscale-core/src/sessions/fx.rs:144— crates/tokscale-core/src/sessions/fx.rs:144-149 | crates/tokscale-core/src/sessions/gjc.rs:60-65 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×4
Edited copy of a member (5 corresponding lines) crates/tokscale-cli/src/antigravity.rs:893— crates/tokscale-cli/src/antigravity.rs:893-900 | crates/tokscale-cli/src/trae.rs:1177-1181 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/tokscale-core/src/sessions/amp.rs:111— crates/tokscale-core/src/sessions/amp.rs:111-116 | crates/tokscale-core/src/sessions/droid.rs:251-255 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/tokscale-core/src/sessions/gemini.rs:504— crates/tokscale-core/src/sessions/gemini.rs:504-509 | crates/tokscale-core/src/sessions/zcode.rs:223-227 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (5 corresponding lines) crates/tokscale-core/src/sessions/kiro.rs:560— crates/tokscale-core/src/sessions/kiro.rs:560-564 | crates/tokscale-core/src/sessions/tencent_buddy.rs:532-536 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (17 lines × 2) crates/tokscale-cli/src/main.rs:2889— crates/tokscale-cli/src/main.rs:2889-2905 | crates/tokscale-cli/src/main.rs:3169-3185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2889` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:362— crates/tokscale-cli/src/tui/ui/daily.rs:362-378 | crates/tokscale-cli/src/tui/ui/minutely.rs:300-316 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:362` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) REDACTED:3670— REDACTED:3670-3686 | REDACTED:3993-4009 — both copies are in the same file, so extract the 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 (17 lines × 2) crates/tokscale-cli/src/tui/ui/projects.rs:168— crates/tokscale-cli/src/tui/ui/projects.rs:168-184 | crates/tokscale-cli/src/tui/ui/sessions.rs:207-225 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:169— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:169-178 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:107-116 | crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:210-219 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:118` calls `width`, `as_str`, `saturating_sub` and `crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:221` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) crates/tokscale-cli/src/main.rs:4564— crates/tokscale-cli/src/main.rs:4564-4575 | crates/tokscale-cli/src/tui/data/mod.rs:504-515 | crates/tokscale-core/src/lib.rs:6142-6151 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Note first that the copies are not typed on the same thing: the declarations holding them bind `tokens` to `&tokscale_core::TokenBreakdown` in one and `&TokenBreakdown` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) crates/tokscale-cli/src/main.rs:5181— crates/tokscale-cli/src/main.rs:5181-5190 | REDACTED:2490-2499 | REDACTED:2503-2512 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `tokens` to `tokscale_core::TokenBreakdown` in one and `LegacyTokenBreakdownV9` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:599— crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:599-608 | crates/tokscale-cli/src/tui/ui/projects.rs:532-541 | crates/tokscale-cli/src/tui/ui/sessions.rs:898-907 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/projects.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 149 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/tokscale-cli/src/tui/ui/daily.rs:165— crates/tokscale-cli/src/tui/ui/daily.rs:165-173 | crates/tokscale-cli/src/tui/ui/models.rs:252-260 | crates/tokscale-cli/src/tui/ui/monthly.rs:182-190 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:165` 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 × 3) REDACTED:2811— REDACTED:2811-2819 | REDACTED:3102-3110 | REDACTED:3153-3161 — 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 `REDACTED:2811` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `LegacyCachedSourceEntryV7` in one and `LegacyCachedSourceEntryV5` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 3) crates/tokscale-cli/src/tui/cache.rs:265— crates/tokscale-cli/src/tui/cache.rs:265-273 | crates/tokscale-cli/src/tui/cache.rs:277-285 | REDACTED:2464-2472 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `t` to `&TokenBreakdown` in one and `CachedTokenBreakdown` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 3) crates/tokscale-core/src/sessions/copilot.rs:888— crates/tokscale-core/src/sessions/copilot.rs:888-896 | crates/tokscale-core/src/sessions/copilot.rs:903-911 | crates/tokscale-core/src/sessions/copilot.rs:922-930 — 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 `crates/tokscale-core/src/sessions/copilot.rs:888` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:146— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:146-153 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:85-92 | crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:170-177 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:146` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:145` calls `styled`, `default`, `fg` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:84` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) REDACTED:2648— REDACTED:2648-2655 | REDACTED:2739-2746 | REDACTED:2901-2908 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `LegacyUnifiedMessageV8` in one and `LegacyUnifiedMessageV9` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) crates/tokscale-cli/src/tui/ui/footer.rs:10— crates/tokscale-cli/src/tui/ui/footer.rs:10-17 | crates/tokscale-cli/src/tui/ui/mod.rs:77-84 | crates/tokscale-cli/src/tui/ui/mod.rs:110-117 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `app` to `&mut App` in one and `&App` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) crates/tokscale-cli/src/auth.rs:79— crates/tokscale-cli/src/auth.rs:79-86 | crates/tokscale-cli/src/cursor.rs:676-683 | crates/tokscale-cli/src/cursor.rs:2815-2822 — 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.
Sync-over-async blocking packages/frontend/scripts/stealth/fetch-profiles.ts:46— `existsSync` in `leaderboardPage` 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/frontend/scripts/stealth/fetch-profiles.ts:50— `readFileSync` in `leaderboardPage` 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/frontend/scripts/stealth/fetch-profiles.ts:66— `mkdirSync` in `main` 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/frontend/scripts/stealth/fetch-profiles.ts:74— `existsSync` in `main` 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.
PricingLookup::lookup_auto (cyclomatic 58) crates/tokscale-core/src/pricing/lookup.rs:909— PricingLookup::lookup_auto has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PricingLookup::resolve_with_source_and_provider (cyclomatic 29) crates/tokscale-core/src/pricing/lookup.rs:707— PricingLookup::resolve_with_source_and_provider 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.
PricingLookup::resolve_for_usage (cyclomatic 17) crates/tokscale-core/src/pricing/lookup.rs:2069— PricingLookup::resolve_for_usage 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.
ClassTooLong: App crates/tokscale-cli/src/tui/app.rs:318— ClassTooLong — 1823 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 114 methods, 2 blocks, lines 318-3014. The bar is 400 significant lines; this is 1423 over it, 4.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: PricingLookup crates/tokscale-core/src/pricing/lookup.rs:127— ClassTooLong — 1054 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 45 methods, 2 blocks, lines 127-2146. The bar is 400 significant lines; this is 654 over it, 2.64× 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: DataLoader crates/tokscale-cli/src/tui/data/mod.rs:461— ClassTooLong — 859 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 2 blocks, lines 461-1776. The bar is 400 significant lines; this is 459 over it, 2.15× 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: App crates/tokscale-cli/src/tui/app.rs:318— TooManyMethods — 114 methods. The bar is 30 methods; this is 84 over it, 3.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PricingLookup crates/tokscale-core/src/pricing/lookup.rs:127— 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: PricingService crates/tokscale-core/src/pricing/mod.rs:66— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×3
Edited copy of a member (39 corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs:2025— crates/tokscale-cli/src/commands/usage/codex.rs:2025-2067 | crates/tokscale-cli/src/cursor.rs:3042-3080 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:1855— crates/tokscale-core/src/pricing/lookup.rs:1855-1893 | crates/tokscale-core/src/pricing/lookup.rs:1921-1961 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/tokscale-cli/src/tui/ui/monthly.rs:23— crates/tokscale-cli/src/tui/ui/monthly.rs:23-64 | crates/tokscale-cli/src/tui/ui/monthly.rs:126-164 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×3
Edited copy of a member (20 corresponding lines) crates/tokscale-core/src/lib.rs:5555— crates/tokscale-core/src/lib.rs:5555-5575 | crates/tokscale-core/src/lib.rs:9555-9574 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/tokscale-cli/src/tui/app.rs:2224— crates/tokscale-cli/src/tui/app.rs:2224-2243 | crates/tokscale-cli/src/tui/app.rs:2275-2294 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (20 corresponding lines) crates/tokscale-cli/src/antigravity.rs:1073— crates/tokscale-cli/src/antigravity.rs:1073-1092 | crates/tokscale-cli/src/cursor.rs:949-973 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×3
Edited copy of a member (26 corresponding lines) crates/tokscale-core/src/pricing/litellm.rs:690— crates/tokscale-core/src/pricing/litellm.rs:690-717 | crates/tokscale-core/src/pricing/models_dev.rs:106-131 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/tokscale-cli/src/antigravity.rs:2838— crates/tokscale-cli/src/antigravity.rs:2838-2863 | crates/tokscale-cli/src/antigravity.rs:2868-2894 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/tokscale-cli/src/commands/usage/opencode_go.rs:194— crates/tokscale-cli/src/commands/usage/opencode_go.rs:194-219 | crates/tokscale-cli/src/cursor.rs:2348-2373 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×3
Edited copy of a member (23 corresponding lines) crates/tokscale-core/src/sessions/crush.rs:142— crates/tokscale-core/src/sessions/crush.rs:142-164 | crates/tokscale-core/src/sessions/workbuddy.rs:43-72 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/tokscale-cli/src/tui/cache.rs:371— crates/tokscale-cli/src/tui/cache.rs:371-395 | crates/tokscale-cli/src/tui/cache.rs:440-462 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (23 corresponding lines) crates/tokscale-core/src/lib.rs:1715— crates/tokscale-core/src/lib.rs:1715-1739 | crates/tokscale-core/src/lib.rs:1747-1769 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (24 lines × 2) crates/tokscale-cli/src/main.rs:3447— crates/tokscale-cli/src/main.rs:3447-3470 | crates/tokscale-cli/src/main.rs:3535-3558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3447` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/main.rs:3534` calls `format_tokens_with_commas`, `set_alignment`, `format_currency` and `crates/tokscale-cli/src/main.rs:3447` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24 lines × 2) crates/tokscale-core/src/opencode_model_name.rs:114— crates/tokscale-core/src/opencode_model_name.rs:114-137 | crates/tokscale-core/src/opencode_model_name.rs:157-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/opencode_model_name.rs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) crates/tokscale-core/src/aggregator.rs:603— crates/tokscale-core/src/aggregator.rs:603-626 | crates/tokscale-core/src/aggregator.rs:795-818 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/aggregator.rs:603` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `other` to `DayAccumulator` in one and `SessionAccumulator` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (19 lines × 2) crates/tokscale-cli/src/antigravity.rs:419— crates/tokscale-cli/src/antigravity.rs:419-437 | crates/tokscale-cli/src/antigravity.rs:443-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:443` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:214— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:214-232 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:140-158 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:214` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/tokscale-core/src/aggregator.rs:661— crates/tokscale-core/src/aggregator.rs:661-679 | crates/tokscale-core/src/aggregator.rs:851-869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/aggregator.rs:661` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) crates/tokscale-cli/src/commands/wrapped.rs:268— crates/tokscale-cli/src/commands/wrapped.rs:268-284 | crates/tokscale-cli/src/commands/wrapped.rs:289-306 — both copies are in the same file, so extract the 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 (17–18 lines × 2) crates/tokscale-cli/src/main.rs:2708— crates/tokscale-cli/src/main.rs:2708-2724 | crates/tokscale-cli/src/main.rs:3079-3096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2708` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/main.rs:3097` calls `format_model_name` and `crates/tokscale-cli/src/main.rs:2725` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 2) crates/tokscale-cli/src/main.rs:3390— crates/tokscale-cli/src/main.rs:3390-3406 | crates/tokscale-cli/src/main.rs:3704-3721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/tokscale-cli/src/trae.rs:231— crates/tokscale-cli/src/trae.rs:231-248 | crates/tokscale-cli/src/trae.rs:273-290 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/trae.rs:231` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/tokscale-core/src/lib.rs:4114— crates/tokscale-core/src/lib.rs:4114-4131 | crates/tokscale-core/src/lib.rs:5025-5042 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/tokscale-core/src/scanner.rs:2133— crates/tokscale-core/src/scanner.rs:2133-2150 | crates/tokscale-core/src/scanner.rs:2155-2172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/scanner.rs:2133` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/tokscale-cli/src/commands/autosubmit.rs:1158— crates/tokscale-cli/src/commands/autosubmit.rs:1158-1172 | crates/tokscale-cli/src/commands/autosubmit.rs:1190-1204 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:360— crates/tokscale-cli/src/tui/ui/daily.rs:360-374 | crates/tokscale-cli/src/tui/ui/hourly.rs:339-353 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:360` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) crates/tokscale-core/src/sessions/mcode.rs:65— crates/tokscale-core/src/sessions/mcode.rs:65-79 | crates/tokscale-core/src/sessions/mcode.rs:131-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/mcode.rs:65` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) crates/tokscale-cli/src/commands/wrapped.rs:1168— crates/tokscale-cli/src/commands/wrapped.rs:1168-1178 | crates/tokscale-cli/src/commands/wrapped.rs:1204-1215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/wrapped.rs:1168` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) REDACTED:243— REDACTED:243-253 | crates/tokscale-core/src/sessions/claudecode.rs:1439-1450 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11–12 lines × 2) crates/tokscale-core/src/sessions/codebuff.rs:56— crates/tokscale-core/src/sessions/codebuff.rs:56-67 | crates/tokscale-core/src/sessions/freebuff.rs:137-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-core/src/sessions/codebuff.rs:56` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) crates/tokscale-cli/src/main.rs:2829— crates/tokscale-cli/src/main.rs:2829-2838 | crates/tokscale-cli/src/main.rs:3048-3058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3048` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/tokscale-core/src/aggregator.rs:541— crates/tokscale-core/src/aggregator.rs:541-551 | crates/tokscale-core/src/aggregator.rs:733-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) crates/tokscale-cli/src/antigravity.rs:860— crates/tokscale-cli/src/antigravity.rs:860-870 | crates/tokscale-cli/src/trae.rs:1213-1222 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:860` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `lock_path` to `&Path` in one and `&std::path::Path` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) crates/tokscale-cli/src/tui/ui/daily.rs:205— crates/tokscale-cli/src/tui/ui/daily.rs:205-210 | crates/tokscale-cli/src/tui/ui/hourly.rs:161-166 | crates/tokscale-cli/src/tui/ui/minutely.rs:149-154 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/tokscale-core/src/pricing/lookup.rs:1607— crates/tokscale-core/src/pricing/lookup.rs:1607-1612 | crates/tokscale-core/src/pricing/lookup.rs:1623-1628 | crates/tokscale-core/src/pricing/lookup.rs:1837-1842 — 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 `crates/tokscale-core/src/pricing/lookup.rs:1607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) crates/tokscale-cli/src/commands/usage/codex.rs:673— crates/tokscale-cli/src/commands/usage/codex.rs:673-678 | crates/tokscale-cli/src/commands/usage/cursor.rs:616-621 | crates/tokscale-core/src/sessions/pi.rs:476-481 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (24 lines × 2 locations) packages/frontend/src/components/landing/sections/QuickstartSection.tsx:26— packages/frontend/src/components/landing/sections/QuickstartSection.tsx:26 · packages/frontend/src/components/landing/sections/WorldwideSection.tsx:75 — 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 (24 lines × 2 locations) packages/frontend/src/lib/db/antigravityTransition.ts:87— packages/frontend/src/lib/db/antigravityTransition.ts:87 · packages/frontend/src/lib/db/micodeTransition.ts:47 — 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 (24 lines × 2 locations) packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:170— packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:170 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:104 — 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 (18 lines × 2 locations) packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:296— packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:296 · packages/frontend/src/components/home/HomePage.tsx:87 — 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 (18 lines × 2 locations) packages/frontend/src/app/device/DeviceClient.tsx:293— packages/frontend/src/app/device/DeviceClient.tsx:293 · packages/frontend/src/app/device/DeviceClient.tsx:328 — all 2 copies are in the same file, 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 (18 lines × 2 locations) packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:484— packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:484 · packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:511 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
App::handle_key_event (cyclomatic 59) crates/tokscale-cli/src/tui/app.rs:896— App::handle_key_event has cyclomatic complexity 59 (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.
App::on_tick (cyclomatic 20) crates/tokscale-cli/src/tui/app.rs:711— App::on_tick 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.
SourceMessageCache::save_if_dirty_with_limit (cyclomatic 29) REDACTED:3966— SourceMessageCache::save_if_dirty_with_limit 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. This is NOT this file's highest cyclomatic complexity: tokscale_core::message_cache::parser_version (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
SourceMessageCache::ensure_namespace_loaded (cyclomatic 27) REDACTED:3645— SourceMessageCache::ensure_namespace_loaded has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: tokscale_core::message_cache::parser_version (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
SourceMessageCache::save_if_dirty_with_limit (cognitive 44) REDACTED:3966— SourceMessageCache::save_if_dirty_with_limit has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 6 (8 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceMessageCache::ensure_namespace_loaded (cognitive 34) REDACTED:3645— SourceMessageCache::ensure_namespace_loaded has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, match/switch 3 (4 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.
Change-coupling hub: client_ui.rs → scanner.rs, mod.rs, types.ts crates/tokscale-cli/src/tui/client_ui.rs— `crates/tokscale-cli/src/tui/client_ui.rs` changes together with 3 other files — `crates/tokscale-core/src/scanner.rs`, `crates/tokscale-core/src/sessions/mod.rs`, `packages/frontend/src/lib/types.ts` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: constants.ts → main.rs, client_ui.rs, mod.rs, clients.rs, lib.rs, scanner.rs, mod.rs packages/frontend/src/lib/constants.ts— `packages/frontend/src/lib/constants.ts` changes together with 7 other files — `crates/tokscale-cli/src/main.rs`, `crates/tokscale-cli/src/tui/client_ui.rs`, `crates/tokscale-cli/src/tui/data/mod.rs`, `crates/tokscale-core/src/clients.rs`, `crates/tokscale-core/src/lib.rs`, `crates/tokscale-core/src/scanner.rs`, `crates/tokscale-core/src/sessions/mod.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) crates/tokscale-core/src/sessions/opencode_schema.rs:1179— crates/tokscale-core/src/sessions/opencode_schema.rs:1179-1199 | crates/tokscale-core/src/sessions/opencode_schema.rs:1209-1233 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (17 corresponding lines) crates/tokscale-cli/src/tui/ui/projects.rs:119— crates/tokscale-cli/src/tui/ui/projects.rs:119-135 | crates/tokscale-cli/src/tui/ui/sessions.rs:158-181 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/tokscale-cli/src/tui/ui/agents.rs:72— crates/tokscale-cli/src/tui/ui/agents.rs:72-231 | crates/tokscale-cli/src/tui/ui/daily.rs:162-403 | crates/tokscale-cli/src/tui/ui/daily.rs:445-657 | crates/tokscale-cli/src/tui/ui/hourly.rs:117-389 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:32-316 | crates/tokscale-cli/src/tui/ui/minutely.rs:110-341 | crates/tokscale-cli/src/tui/ui/model_trend.rs:87-252 | crates/tokscale-cli/src/tui/ui/models.rs:249-512 | crates/tokscale-cli/src/tui/ui/monthly.rs:179-384 | crates/tokscale-cli/src/tui/ui/monthly.rs:386-602 | crates/tokscale-cli/src/tui/ui/projects.rs:307-473 | crates/tokscale-cli/src/tui/ui/sessions.rs:591-820 | crates/tokscale-cli/src/tui/ui/stats.rs:256-586 | crates/tokscale-cli/src/tui/ui/stats.rs:638-874 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
Members sharing a duplicated core (14 members, 50+ identical tokens) crates/tokscale-cli/src/tui/ui/agents.rs:72— crates/tokscale-cli/src/tui/ui/agents.rs:72-231 | crates/tokscale-cli/src/tui/ui/daily.rs:162-403 | crates/tokscale-cli/src/tui/ui/hourly.rs:117-389 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:32-316 | crates/tokscale-cli/src/tui/ui/minutely.rs:110-341 | crates/tokscale-cli/src/tui/ui/models.rs:249-512 | crates/tokscale-cli/src/tui/ui/monthly.rs:179-384 | crates/tokscale-cli/src/tui/ui/projects.rs:307-473 | crates/tokscale-cli/src/tui/ui/sessions.rs:591-820 | crates/tokscale-cli/src/tui/ui/stats.rs:256-586 | crates/tokscale-cli/src/tui/ui/stats.rs:638-874 | crates/tokscale-cli/src/tui/ui/usage.rs:58-101 | crates/tokscale-cli/src/tui/ui/usage.rs:1035-1123 | crates/tokscale-cli/src/tui/ui/usage.rs:2317-2377 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/tokscale-cli/src/antigravity.rs:665— crates/tokscale-cli/src/antigravity.rs:665-676 | crates/tokscale-cli/src/auth.rs:76-88 | crates/tokscale-cli/src/cursor.rs:673-685 | crates/tokscale-cli/src/cursor.rs:2813-2840 | crates/tokscale-cli/src/warp.rs:96-107 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/tokscale-core/src/lib.rs:6215— crates/tokscale-core/src/lib.rs:6215-6282 | crates/tokscale-core/src/lib.rs:6345-6381 | crates/tokscale-core/src/lib.rs:6474-6517 | crates/tokscale-core/src/lib.rs:6541-6612 | crates/tokscale-core/src/lib.rs:7041-7072 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/tokscale-core/src/cc_mirror.rs:22— crates/tokscale-core/src/cc_mirror.rs:22-40 | crates/tokscale-core/src/scanner.rs:1355-1378 | crates/tokscale-core/src/scanner.rs:1394-1421 | crates/tokscale-core/src/scanner.rs:1455-1479 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:2542— REDACTED:2542-2573 | REDACTED:2635-2666 | REDACTED:2726-2757 | REDACTED:2888-2921 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×2
Edited copy of a member (46 corresponding lines) crates/tokscale-core/src/aggregator.rs:649— crates/tokscale-core/src/aggregator.rs:649-694 | crates/tokscale-core/src/aggregator.rs:839-905 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (46 corresponding lines) crates/tokscale-core/src/aggregator.rs:540— crates/tokscale-core/src/aggregator.rs:540-600 | crates/tokscale-core/src/aggregator.rs:602-647 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:610— crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:610-636 | crates/tokscale-cli/src/tui/ui/sessions.rs:911-932 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (22 corresponding lines) crates/tokscale-cli/src/commands/usage/mod.rs:120— crates/tokscale-cli/src/commands/usage/mod.rs:120-141 | crates/tokscale-cli/src/tui/app.rs:248-269 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) crates/tokscale-core/src/sessions/lmstudio.rs:271— crates/tokscale-core/src/sessions/lmstudio.rs:271-311 | crates/tokscale-core/src/sessions/unsloth.rs:74-98 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (25 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:2534— crates/tokscale-core/src/pricing/lookup.rs:2534-2561 | crates/tokscale-core/src/pricing/lookup.rs:2702-2726 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) crates/tokscale-core/src/claude_desktop/v8.rs:683— crates/tokscale-core/src/claude_desktop/v8.rs:683-701 | crates/tokscale-core/src/claude_desktop/v8.rs:758-775 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/tokscale-cli/src/commands/usage/minimax.rs:120— crates/tokscale-cli/src/commands/usage/minimax.rs:120-137 | crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs:126-150 — 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 copies of one member (3 members, 17+ corresponding lines) · ×2
Edited copies of one member (3 members, 17+ corresponding lines) crates/tokscale-cli/src/commands/usage/copilot.rs:716— crates/tokscale-cli/src/commands/usage/copilot.rs:716-736 | crates/tokscale-cli/src/commands/usage/grok.rs:150-169 | crates/tokscale-cli/src/commands/usage/kimi.rs:153-169 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:1785— crates/tokscale-core/src/pricing/lookup.rs:1785-1801 | crates/tokscale-core/src/pricing/lookup.rs:1807-1823 | crates/tokscale-core/src/pricing/lookup.rs:1829-1849 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) crates/tokscale-cli/src/submission_warnings.rs:71— crates/tokscale-cli/src/submission_warnings.rs:71-88 | crates/tokscale-cli/src/submission_warnings.rs:90-102 | crates/tokscale-cli/src/submission_warnings.rs:104-120 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 13+ corresponding lines) crates/tokscale-cli/src/commands/wrapped.rs:1262— crates/tokscale-cli/src/commands/wrapped.rs:1262-1274 | crates/tokscale-core/src/pricing/cache.rs:105-117 | crates/tokscale-core/src/sessions/opencode.rs:176-188 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×2
Edited copy of a member (9 corresponding lines) crates/tokscale-core/src/lib.rs:5601— crates/tokscale-core/src/lib.rs:5601-5610 | crates/tokscale-core/src/lib.rs:5615-5623 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/tokscale-cli/src/auth.rs:110— crates/tokscale-cli/src/auth.rs:110-118 | crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs:52-60 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 5+ corresponding lines) · ×2
Edited copies of one member (3 members, 5+ corresponding lines) crates/tokscale-cli/src/commands/usage/amp.rs:47— crates/tokscale-cli/src/commands/usage/amp.rs:47-52 | crates/tokscale-cli/src/device.rs:67-72 | crates/tokscale-core/src/sessions/bb.rs:401-405 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 5+ corresponding lines) REDACTED:802— REDACTED:802-807 | crates/tokscale-core/src/sessions/cline.rs:113-118 | crates/tokscale-core/src/sessions/codex.rs:2500-2504 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (22 lines × 2) crates/tokscale-cli/src/antigravity.rs:1218— crates/tokscale-cli/src/antigravity.rs:1218-1239 | crates/tokscale-cli/src/cursor.rs:627-648 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/cursor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:1218` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:649— crates/tokscale-cli/src/tui/data/mod.rs:649-670 | crates/tokscale-cli/src/tui/data/mod.rs:698-719 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) crates/tokscale-core/src/sessions/copilot_desktop.rs:462— crates/tokscale-core/src/sessions/copilot_desktop.rs:462-477 | crates/tokscale-core/src/sessions/copilot_session_state.rs:80-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/copilot_desktop.rs:462` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 2) crates/tokscale-core/src/sessions/antigravity_cli.rs:953— crates/tokscale-core/src/sessions/antigravity_cli.rs:953-968 | crates/tokscale-core/src/sessions/grok.rs:1756-1774 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/tokscale-cli/src/tui/ui/mod.rs:80— crates/tokscale-cli/src/tui/ui/mod.rs:80-95 | crates/tokscale-cli/src/tui/ui/mod.rs:113-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/mod.rs:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/tokscale-core/src/lib.rs:4344— crates/tokscale-core/src/lib.rs:4344-4359 | crates/tokscale-core/src/lib.rs:8246-8261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4344` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) crates/tokscale-core/src/sessions/copilot_session_state.rs:162— crates/tokscale-core/src/sessions/copilot_session_state.rs:162-177 | crates/tokscale-core/src/sessions/copilot_session_state.rs:188-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/copilot_session_state.rs:162` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) scripts/9router_tokscale_bridge_gjc.py:166— scripts/9router_tokscale_bridge_gjc.py:166-181 | scripts/9router_tokscale_bridge_gjc.py:246-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 3) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:117— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:117-131 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:60-74 | crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:140-154 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) crates/tokscale-cli/src/tui/ui/monthly.rs:345— crates/tokscale-cli/src/tui/ui/monthly.rs:345-359 | crates/tokscale-cli/src/tui/ui/monthly.rs:564-578 | crates/tokscale-cli/src/tui/ui/sessions.rs:756-770 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/monthly.rs` and `crates/tokscale-cli/src/tui/ui/sessions.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 140 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/monthly.rs:345` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/tokscale-core/src/lib.rs:3212— crates/tokscale-core/src/lib.rs:3212-3225 | crates/tokscale-core/src/lib.rs:3291-3305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/tokscale-core/src/lib.rs:5561— crates/tokscale-core/src/lib.rs:5561-5575 | crates/tokscale-core/src/lib.rs:9561-9574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:5561` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 4) crates/tokscale-cli/src/tui/ui/daily.rs:356— crates/tokscale-cli/src/tui/ui/daily.rs:356-369 | crates/tokscale-cli/src/tui/ui/hourly.rs:335-348 | crates/tokscale-cli/src/tui/ui/monthly.rs:339-352 | crates/tokscale-cli/src/tui/ui/monthly.rs:558-571 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:356` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 4) crates/tokscale-cli/src/tui/ui/daily.rs:619— crates/tokscale-cli/src/tui/ui/daily.rs:619-632 | crates/tokscale-cli/src/tui/ui/monthly.rs:346-359 | crates/tokscale-cli/src/tui/ui/monthly.rs:565-578 | crates/tokscale-cli/src/tui/ui/sessions.rs:757-770 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/monthly.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 350 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:619` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) crates/tokscale-cli/src/main.rs:2590— crates/tokscale-cli/src/main.rs:2590-2603 | crates/tokscale-cli/src/main.rs:3391-3404 | crates/tokscale-cli/src/main.rs:3705-3718 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) crates/tokscale-cli/src/tui/ui/agents.rs:193— crates/tokscale-cli/src/tui/ui/agents.rs:193-206 | crates/tokscale-cli/src/tui/ui/models.rs:474-487 | crates/tokscale-cli/src/tui/ui/projects.rs:430-443 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:193` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/tokscale-cli/src/commands/usage/minimax.rs:123— crates/tokscale-cli/src/commands/usage/minimax.rs:123-130 | crates/tokscale-cli/src/commands/usage/minimax_tokenplan.rs:130-138 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/usage/minimax.rs:123` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8–9 lines × 2) crates/tokscale-cli/src/tui/ui/hourly_profile.rs:179— crates/tokscale-cli/src/tui/ui/hourly_profile.rs:179-187 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:247-254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/hourly_profile.rs:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 2) crates/tokscale-cli/src/main.rs:3474— crates/tokscale-cli/src/main.rs:3474-3480 | crates/tokscale-cli/src/main.rs:3574-3581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3474` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crates/tokscale-cli/src/tui/ui/footer.rs:622— crates/tokscale-cli/src/tui/ui/footer.rs:622-628 | crates/tokscale-cli/src/tui/ui/footer.rs:636-643 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/footer.rs:636` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:102— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:102-110 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:49-53 | crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:130-134 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs` and `crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) REDACTED:717— REDACTED:717-721 | REDACTED:736-740 | REDACTED:786-790 — 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 `REDACTED:717` 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.
Duplication concentrated across 5 sibling directories (5 clone groups) packages/frontend/src/app/api/groups/[slug]/leave/route.ts:9— 5 of the duplicated blocks reported below have copies in at least two of the sibling directories invite, leaderboard, leave, members, transfer-ownership under packages/frontend/src/app/api/groups/[slug]/. That concentration is one structural fact, not 5 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 5 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 (5 clone groups) packages/frontend/src/lib/auth/session.ts:39— 5 duplicated blocks under packages/frontend/src/lib/ have copies in at least two of the sibling directories auth, embed, explore, groups, leaderboard — 3 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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.
Duplicated block (19 lines × 2 locations) packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:100— packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:100 · packages/frontend/src/components/home/HomePage.tsx:38 — 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 (19 lines × 2 locations) packages/frontend/src/components/landing/hooks/useSquircleClip.ts:44— packages/frontend/src/components/landing/hooks/useSquircleClip.ts:44 · packages/frontend/src/components/landing/hooks/useSquircleClip.ts:74 — 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.
R4 · Test Coverage· This test file cannot be loaded · ×2
This test file cannot be loaded packages/frontend/__tests__/lib/clientRegistry.test.ts:16— packages/frontend/__tests__/lib/clientRegistry.test.ts:16 imports '../../../../.github/assets/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded packages/frontend/src/lib/capital/__tests__/epoch.test.ts:31— packages/frontend/src/lib/capital/__tests__/epoch.test.ts:31 imports '../../../content/capital/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
Dead file (~425 LoC) packages/frontend/scripts/capital/import-epoch.ts— no import path from any entry point (125 application, 12 tooling, 181 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 (~425 LoC) packages/frontend/src/components/landing/sections/FollowSection.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
AC2 · Forms & labels· <Textarea> field component without a label · ×1
<Textarea> field component without a label packages/frontend/src/app/(main)/groups/new/CreateGroupClient.tsx:235— 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.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark packages/frontend/scripts/gallery/gallery.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Low contrast colour pair in CSS-in-JS (4.3:1) packages/frontend/src/app/u/[username]/not-found.tsx:41— A styled-components/emotion style declares a foreground/background colour pair below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×1
Focus outline removed in CSS without a :focus replacement packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:293— `input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
C1 · Data Protection· No data-protection/encryption · ×1
No data-protection/encryption packages/frontend/src/lib/db/migrations/0000_add_user_id_unique_constraint.sql:78— No encryption usage (RustCrypto's aes-gcm/chacha20poly1305 encrypting, ring or aws-lc-rs aead sealing, orion, libsodium's secretbox, openssl symm, age, SQLCipher keyed by PRAGMA key, pgcrypto, MongoDB client-side field-level encryption, the OS keyring) was found, and this repository persists personal data in the model cited here — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
DataLoader::aggregate_messages (cyclomatic 79) crates/tokscale-cli/src/tui/data/mod.rs:801— DataLoader::aggregate_messages has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SchemaAccumulator::ingest (cyclomatic 32) crates/tokscale-core/src/sessions/opencode_schema.rs:906— SchemaAccumulator::ingest 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.
CustomPricing::load_from_str (cyclomatic 21) crates/tokscale-core/src/pricing/custom.rs:412— CustomPricing::load_from_str 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.
index.detectLibcKind (cyclomatic 20) packages/cli/src/index.ts:27— index.detectLibcKind 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.
PathRoot::resolve_with_env_strategy (cyclomatic 19) crates/tokscale-core/src/clients.rs:98— PathRoot::resolve_with_env_strategy 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.
ModelUsageFold::add (cyclomatic 19) crates/tokscale-core/src/lib.rs:5979— ModelUsageFold::add 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.
PricingService::explain_message (cyclomatic 17) crates/tokscale-core/src/pricing/mod.rs:866— PricingService::explain_message 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.
TerminalColorMode::from_env (cyclomatic 16) crates/tokscale-cli/src/tui/themes.rs:15— TerminalColorMode::from_env 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: Theme::from_name_with_color_mode (cyclomatic 28) 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 function is counted neither in this dimension's figures nor in its score.
DesktopUsage::merge_into (cyclomatic 16) crates/tokscale-core/src/claude_desktop/mod.rs:421— DesktopUsage::merge_into 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.
TodoComment packages/benchmarks/runner.ts:399— // TODO: count files — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
DataLoader::aggregate_messages (cognitive 164) crates/tokscale-cli/src/tui/data/mod.rs:801— DataLoader::aggregate_messages has cognitive complexity 164 (threshold 15). Drivers by points: if/else 66 (132 pts), boolean chains 12, loops 9 (12 pts), match/switch 3 (8 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SchemaAccumulator::ingest (cognitive 46) crates/tokscale-core/src/sessions/opencode_schema.rs:906— SchemaAccumulator::ingest has cognitive complexity 46 (threshold 15). Drivers by points: if/else 28 (40 pts), match/switch 5, 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.
PathRoot::resolve_with_env_strategy (cognitive 34) crates/tokscale-core/src/clients.rs:98— PathRoot::resolve_with_env_strategy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DesktopUsage::merge_into (cognitive 32) crates/tokscale-core/src/claude_desktop/mod.rs:421— DesktopUsage::merge_into has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 7 (13 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CustomPricing::load_from_str (cognitive 32) crates/tokscale-core/src/pricing/custom.rs:412— CustomPricing::load_from_str has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 4 (7 pts), loops 4, boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClaudeTurnCoverage::resolve_legacy_rows (cognitive 27) crates/tokscale-core/src/lib.rs:1460— ClaudeTurnCoverage::resolve_legacy_rows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PricingService::explain_message (cognitive 26) crates/tokscale-core/src/pricing/mod.rs:866— PricingService::explain_message has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22 (23 pts), 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.
EventHandler::new_with_pending_keys (cognitive 25) crates/tokscale-cli/src/tui/event.rs:24— EventHandler::new_with_pending_keys has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 1 (3 pts), loops 2, boolean chains 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.
SessionDetailDialog::build_lines (cognitive 24) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:51— SessionDetailDialog::build_lines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (22 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.resolveTargetPackageName (cognitive 24) packages/cli/src/index.ts:104— index.resolveTargetPackageName has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (6 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. This shape REPEATS in the file: one other method here (index.resolveRustTargetTriple) 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.resolveRustTargetTriple (cognitive 24) packages/cli/src/index.ts:138— index.resolveRustTargetTriple has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 2 (6 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. This shape REPEATS in the file: one other method here (index.resolveTargetPackageName) 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.
ModelUsageFold::add (cognitive 23) crates/tokscale-core/src/lib.rs:5979— ModelUsageFold::add has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 1, match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
index.detectLibcKind (cognitive 23) packages/cli/src/index.ts:27— index.detectLibcKind has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (4 pts), error handling 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.
SessionModels::from_blobs (cognitive 22) crates/tokscale-core/src/sessions/antigravity_cli.rs:241— SessionModels::from_blobs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 1, match/switch 1 (nesting depth added 13). 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.
MiMoMessages::insert (cognitive 20) crates/tokscale-core/src/sessions/micode.rs:278— MiMoMessages::insert has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientPickerDialog::render (cognitive 18) crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:136— ClientPickerDialog::render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 1, 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.
GraphSink::drain_batch (cognitive 17) crates/tokscale-core/src/lib.rs:6678— GraphSink::drain_batch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttributionIndex::load (cognitive 17) crates/tokscale-core/src/sessions/opencodex.rs:167— AttributionIndex::load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TranscriptLines::read_record (cognitive 16) crates/tokscale-core/src/sessions/dsh_reader.rs:82— TranscriptLines::read_record has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 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.
TooManyFunctions: tokscale_core::sessions::antigravity_cli crates/tokscale-core/src/sessions/antigravity_cli.rs:74— TooManyFunctions — 32 free functions. The bar is 30 free functions; 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.
D4 · Code Duplication· Near-duplicate member family (4 members, 19 shared lines) · ×1
Near-duplicate member family (4 members, 19 shared lines) crates/tokscale-cli/src/tui/app.rs:2571— crates/tokscale-cli/src/tui/app.rs:2571-2608 | crates/tokscale-cli/src/tui/app.rs:2610-2644 | crates/tokscale-cli/src/tui/app.rs:2697-2728 | crates/tokscale-cli/src/tui/app.rs:2754-2812 — These 4 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 33 shared lines) · ×1
Near-duplicate member family (3 members, 33 shared lines) crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:112— crates/tokscale-cli/src/tui/ui/dialog/group_by_picker.rs:112-209 | crates/tokscale-cli/src/tui/ui/dialog/language_picker.rs:55-134 | crates/tokscale-cli/src/tui/ui/dialog/source_picker.rs:136-244 — These 3 members are variants of one another: a block of 33 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (63 shared lines) crates/tokscale-cli/src/main.rs:3303— crates/tokscale-cli/src/main.rs:3303-3605 | crates/tokscale-cli/src/main.rs:3615-3884 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (23 shared lines) crates/tokscale-cli/src/tui/ui/usage.rs:2317— crates/tokscale-cli/src/tui/ui/usage.rs:2317-2377 | crates/tokscale-cli/src/tui/ui/usage.rs:2384-2429 — These two members are variants of one another: 23 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) crates/tokscale-cli/src/tui/ui/agents.rs:72— crates/tokscale-cli/src/tui/ui/agents.rs:72-231 | crates/tokscale-cli/src/tui/ui/daily.rs:162-403 | crates/tokscale-cli/src/tui/ui/daily.rs:445-657 | crates/tokscale-cli/src/tui/ui/hourly.rs:117-389 | crates/tokscale-cli/src/tui/ui/minutely.rs:110-341 | crates/tokscale-cli/src/tui/ui/models.rs:249-512 | crates/tokscale-cli/src/tui/ui/monthly.rs:179-384 | crates/tokscale-cli/src/tui/ui/monthly.rs:386-602 | crates/tokscale-cli/src/tui/ui/overview.rs:235-497 | crates/tokscale-cli/src/tui/ui/projects.rs:307-473 | crates/tokscale-cli/src/tui/ui/sessions.rs:591-820 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Edited copy of a member (423 corresponding lines) · ×1
Edited copy of a member (423 corresponding lines) crates/tokscale-cli/src/tui/i18n.rs:551— crates/tokscale-cli/src/tui/i18n.rs:551-973 | crates/tokscale-cli/src/tui/i18n.rs:2280-2717 — These two members are one piece of code written twice and then edited apart: 423 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 30+ corresponding lines) · ×1
Edited copies of one member (3 members, 30+ corresponding lines) crates/tokscale-cli/src/tui/app.rs:2646— crates/tokscale-cli/src/tui/app.rs:2646-2675 | crates/tokscale-cli/src/tui/app.rs:2814-2847 | crates/tokscale-cli/src/tui/app.rs:2928-2963 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (35 corresponding lines) · ×1
Edited copy of a member (35 corresponding lines) crates/tokscale-cli/src/antigravity.rs:823— crates/tokscale-cli/src/antigravity.rs:823-874 | crates/tokscale-cli/src/trae.rs:1192-1226 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) crates/tokscale-core/src/aggregator.rs:732— crates/tokscale-core/src/aggregator.rs:732-792 | crates/tokscale-core/src/aggregator.rs:794-837 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) crates/tokscale-cli/src/tui/data/mod.rs:648— crates/tokscale-cli/src/tui/data/mod.rs:648-687 | crates/tokscale-cli/src/tui/data/mod.rs:697-744 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) crates/tokscale-cli/src/antigravity.rs:1205— crates/tokscale-cli/src/antigravity.rs:1205-1252 | crates/tokscale-cli/src/cursor.rs:614-671 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) crates/tokscale-cli/src/antigravity.rs:759— crates/tokscale-cli/src/antigravity.rs:759-817 | crates/tokscale-cli/src/trae.rs:1127-1173 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) crates/tokscale-cli/src/main.rs:6016— crates/tokscale-cli/src/main.rs:6016-6055 | crates/tokscale-core/src/sessions/opencode.rs:207-243 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 39+ corresponding lines) · ×1
Edited copies of one member (3 members, 39+ corresponding lines) REDACTED:1043— REDACTED:1043-1081 | REDACTED:1186-1224 | REDACTED:1331-1369 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) crates/tokscale-cli/src/cursor.rs:3082— crates/tokscale-cli/src/cursor.rs:3082-3115 | crates/tokscale-cli/src/hindsight.rs:552-586 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) crates/tokscale-cli/src/tui/ui/mod.rs:76— crates/tokscale-cli/src/tui/ui/mod.rs:76-107 | crates/tokscale-cli/src/tui/ui/mod.rs:109-139 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 31+ corresponding lines) · ×1
Edited copies of one member (3 members, 31+ corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:1318— crates/tokscale-core/src/pricing/lookup.rs:1318-1349 | crates/tokscale-core/src/pricing/lookup.rs:1355-1385 | crates/tokscale-core/src/pricing/lookup.rs:1391-1430 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) crates/tokscale-cli/src/tui/app.rs:1933— crates/tokscale-cli/src/tui/app.rs:1933-1962 | crates/tokscale-cli/src/tui/app.rs:1964-1995 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) crates/tokscale-core/src/pricing/lookup.rs:3657— crates/tokscale-core/src/pricing/lookup.rs:3657-3685 | crates/tokscale-core/src/pricing/lookup.rs:3754-3780 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) crates/tokscale-cli/src/tui/app.rs:2245— crates/tokscale-cli/src/tui/app.rs:2245-2273 | crates/tokscale-cli/src/tui/app.rs:2296-2323 | crates/tokscale-cli/src/tui/app.rs:2360-2386 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) REDACTED:3101— REDACTED:3101-3116 | REDACTED:3152-3167 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 15+ corresponding lines) · ×1
Edited copies of one member (3 members, 15+ corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs:1183— crates/tokscale-cli/src/commands/usage/codex.rs:1183-1197 | crates/tokscale-cli/src/commands/usage/codex.rs:1204-1218 | crates/tokscale-cli/src/commands/usage/codex.rs:1225-1243 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) crates/tokscale-core/src/sessions/copilot.rs:881— crates/tokscale-core/src/sessions/copilot.rs:881-896 | crates/tokscale-core/src/sessions/copilot.rs:898-911 | crates/tokscale-core/src/sessions/copilot.rs:913-930 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 8+ corresponding lines) · ×1
Edited copies of one member (3 members, 8+ corresponding lines) crates/tokscale-cli/src/antigravity.rs:3458— crates/tokscale-cli/src/antigravity.rs:3458-3465 | crates/tokscale-core/src/sessions/antigravity.rs:232-242 | crates/tokscale-core/src/sessions/zed.rs:268-280 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 16+ corresponding lines) · ×1
Edited copies of one member (5 members, 16+ corresponding lines) REDACTED:2810— REDACTED:2810-2825 | REDACTED:2845-2860 | REDACTED:2969-2984 | REDACTED:3033-3048 | REDACTED:3067-3082 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) crates/tokscale-cli/src/commands/usage/codex.rs:1137— crates/tokscale-cli/src/commands/usage/codex.rs:1137-1151 | crates/tokscale-cli/src/commands/usage/kimi.rs:137-151 | crates/tokscale-cli/src/commands/usage/zai.rs:146-157 | crates/tokscale-cli/src/commands/usage/zai.rs:159-170 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) crates/tokscale-cli/src/warp.rs:554— crates/tokscale-cli/src/warp.rs:554-559 | crates/tokscale-core/src/sessions/copilot.rs:1247-1253 | crates/tokscale-core/src/sessions/utils.rs:191-197 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) crates/tokscale-cli/src/tui/ui/projects.rs:265— crates/tokscale-cli/src/tui/ui/projects.rs:265-268 | crates/tokscale-cli/src/tui/ui/sessions.rs:437-440 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (39–40 lines × 2) crates/tokscale-cli/src/tui/ui/hourly.rs:69— crates/tokscale-cli/src/tui/ui/hourly.rs:69-108 | crates/tokscale-cli/src/tui/ui/minutely.rs:70-108 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/hourly.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (39 lines × 2) crates/tokscale-cli/src/tui/ui/agents.rs:118— crates/tokscale-cli/src/tui/ui/agents.rs:118-156 | crates/tokscale-cli/src/tui/ui/models.rs:305-343 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:118` 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 (38–39 lines × 2) crates/tokscale-cli/src/tui/ui/daily.rs:70— crates/tokscale-cli/src/tui/ui/daily.rs:70-108 | crates/tokscale-cli/src/tui/ui/monthly.rs:79-116 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/monthly.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 350 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (36 lines × 2) crates/tokscale-cli/src/main.rs:3411— crates/tokscale-cli/src/main.rs:3411-3446 | crates/tokscale-cli/src/main.rs:3491-3526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3411` 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 (34 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:1310— crates/tokscale-cli/src/tui/data/mod.rs:1310-1343 | crates/tokscale-cli/src/tui/data/mod.rs:1405-1438 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/data/mod.rs:1310` 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 (31–33 lines × 2) crates/tokscale-cli/src/tui/ui/hourly.rs:29— crates/tokscale-cli/src/tui/ui/hourly.rs:29-59 | crates/tokscale-cli/src/tui/ui/minutely.rs:28-60 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/hourly.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 269 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16–27 lines × 6) crates/tokscale-cli/src/tui/ui/daily.rs:260— crates/tokscale-cli/src/tui/ui/daily.rs:260-275 | crates/tokscale-cli/src/tui/ui/daily.rs:521-536 | crates/tokscale-cli/src/tui/ui/hourly.rs:200-226 | crates/tokscale-cli/src/tui/ui/minutely.rs:191-206 | crates/tokscale-cli/src/tui/ui/monthly.rs:261-276 | crates/tokscale-cli/src/tui/ui/monthly.rs:481-496 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:260` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/daily.rs:276` calls `min` and `crates/tokscale-cli/src/tui/ui/hourly.rs:227` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27 lines × 2) crates/tokscale-cli/src/main.rs:3316— crates/tokscale-cli/src/main.rs:3316-3342 | crates/tokscale-cli/src/main.rs:3628-3654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:3316` 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 (26 lines × 3) REDACTED:1050— REDACTED:1050-1075 | REDACTED:1193-1218 | REDACTED:1336-1361 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `state` to `LegacyCodexStateV14` in one and `LegacyCodexStateV15` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–25 lines × 8) crates/tokscale-cli/src/tui/ui/agents.rs:137— crates/tokscale-cli/src/tui/ui/agents.rs:137-150 | crates/tokscale-cli/src/tui/ui/daily.rs:261-274 | crates/tokscale-cli/src/tui/ui/daily.rs:522-535 | crates/tokscale-cli/src/tui/ui/hourly.rs:201-225 | crates/tokscale-cli/src/tui/ui/minutely.rs:192-205 | crates/tokscale-cli/src/tui/ui/models.rs:324-337 | crates/tokscale-cli/src/tui/ui/monthly.rs:262-275 | crates/tokscale-cli/src/tui/ui/monthly.rs:482-495 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:137` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/daily.rs:276` calls `min` and `crates/tokscale-cli/src/tui/ui/hourly.rs:227` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22–23 lines × 2) crates/tokscale-cli/src/commands/import.rs:331— crates/tokscale-cli/src/commands/import.rs:331-353 | crates/tokscale-cli/src/commands/import.rs:867-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/import.rs:331` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–23 lines × 2) crates/tokscale-core/src/lib.rs:6352— crates/tokscale-core/src/lib.rs:6352-6368 | crates/tokscale-core/src/lib.rs:6481-6503 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:6352` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–21 lines × 2) crates/tokscale-core/src/lib.rs:4588— crates/tokscale-core/src/lib.rs:4588-4608 | crates/tokscale-core/src/lib.rs:4620-4636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4588` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 12) crates/tokscale-cli/src/tui/data/mod.rs:296— crates/tokscale-cli/src/tui/data/mod.rs:296-315 | crates/tokscale-cli/src/tui/data/mod.rs:1014-1033 | crates/tokscale-cli/src/tui/data/mod.rs:1056-1075 | crates/tokscale-cli/src/tui/data/mod.rs:1115-1134 | crates/tokscale-cli/src/tui/data/mod.rs:1157-1176 | crates/tokscale-cli/src/tui/data/mod.rs:1197-1216 | crates/tokscale-cli/src/tui/data/mod.rs:1244-1263 | crates/tokscale-cli/src/tui/data/mod.rs:1289-1308 | crates/tokscale-cli/src/tui/data/mod.rs:1337-1356 | crates/tokscale-cli/src/tui/data/mod.rs:1384-1403 | crates/tokscale-cli/src/tui/data/mod.rs:1432-1451 | crates/tokscale-cli/src/tui/data/mod.rs:1537-1556 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/data/mod.rs:1054` calls `default` and `crates/tokscale-cli/src/tui/data/mod.rs:1112` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–20 lines × 10) crates/tokscale-cli/src/tui/ui/agents.rs:211— crates/tokscale-cli/src/tui/ui/agents.rs:211-230 | crates/tokscale-cli/src/tui/ui/daily.rs:383-402 | crates/tokscale-cli/src/tui/ui/daily.rs:637-656 | crates/tokscale-cli/src/tui/ui/hourly.rs:369-388 | crates/tokscale-cli/src/tui/ui/minutely.rs:321-340 | crates/tokscale-cli/src/tui/ui/models.rs:492-511 | crates/tokscale-cli/src/tui/ui/monthly.rs:364-383 | crates/tokscale-cli/src/tui/ui/monthly.rs:583-601 | crates/tokscale-cli/src/tui/ui/projects.rs:453-472 | crates/tokscale-cli/src/tui/ui/sessions.rs:800-819 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:211` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/projects.rs:452` calls `column_spacing` and `crates/tokscale-cli/src/tui/ui/sessions.rs:799` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 2) crates/tokscale-cli/src/main.rs:2778— crates/tokscale-cli/src/main.rs:2778-2797 | crates/tokscale-cli/src/main.rs:2984-3003 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2778` 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 (29 lines × 5) crates/tokscale-cli/src/tui/ui/daily.rs:234— crates/tokscale-cli/src/tui/ui/daily.rs:234-262 | crates/tokscale-cli/src/tui/ui/hourly.rs:174-202 | crates/tokscale-cli/src/tui/ui/minutely.rs:165-193 | crates/tokscale-cli/src/tui/ui/monthly.rs:235-263 | crates/tokscale-cli/src/tui/ui/monthly.rs:455-483 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:234` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–19 lines × 2) crates/tokscale-cli/src/tui/cache.rs:545— crates/tokscale-cli/src/tui/cache.rs:545-563 | crates/tokscale-cli/src/tui/data/mod.rs:1946-1959 — 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 `crates/tokscale-cli/src/tui/cache.rs:545` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–18 lines × 2) crates/tokscale-core/src/lib.rs:4916— crates/tokscale-core/src/lib.rs:4916-4933 | crates/tokscale-core/src/lib.rs:5069-5080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:4916` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 4) REDACTED:4467— REDACTED:4467-4483 | REDACTED:4497-4513 | REDACTED:4527-4543 | REDACTED:4564-4580 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4467` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) crates/tokscale-core/src/lib.rs:4581— crates/tokscale-core/src/lib.rs:4581-4597 | crates/tokscale-core/src/lib.rs:4613-4629 | crates/tokscale-core/src/lib.rs:4641-4657 — 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 `crates/tokscale-core/src/lib.rs:4581` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:611— crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:611-627 | crates/tokscale-cli/src/tui/ui/sessions.rs:912-927 — 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 `crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:611` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `glyphs` to `Glyphs` in one and `crate::ui_glyphs::Glyphs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13–17 lines × 2) crates/tokscale-core/src/sessions/grok.rs:733— crates/tokscale-core/src/sessions/grok.rs:733-749 | crates/tokscale-core/src/sessions/grok.rs:954-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/sessions/grok.rs:733` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 8) crates/tokscale-cli/src/tui/ui/agents.rs:115— crates/tokscale-cli/src/tui/ui/agents.rs:115-130 | crates/tokscale-cli/src/tui/ui/daily.rs:234-249 | crates/tokscale-cli/src/tui/ui/daily.rs:500-515 | crates/tokscale-cli/src/tui/ui/hourly.rs:174-189 | crates/tokscale-cli/src/tui/ui/minutely.rs:165-180 | crates/tokscale-cli/src/tui/ui/models.rs:302-317 | crates/tokscale-cli/src/tui/ui/monthly.rs:235-250 | crates/tokscale-cli/src/tui/ui/monthly.rs:455-470 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:115` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 8) crates/tokscale-cli/src/tui/ui/daily.rs:270— crates/tokscale-cli/src/tui/ui/daily.rs:270-285 | crates/tokscale-cli/src/tui/ui/daily.rs:531-546 | crates/tokscale-cli/src/tui/ui/minutely.rs:201-216 | crates/tokscale-cli/src/tui/ui/model_trend.rs:166-180 | crates/tokscale-cli/src/tui/ui/monthly.rs:271-286 | crates/tokscale-cli/src/tui/ui/monthly.rs:491-506 | crates/tokscale-cli/src/tui/ui/projects.rs:396-411 | crates/tokscale-cli/src/tui/ui/sessions.rs:695-710 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:270` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 3) crates/tokscale-cli/src/main.rs:769— crates/tokscale-cli/src/main.rs:769-784 | crates/tokscale-cli/src/main.rs:810-824 | crates/tokscale-cli/src/main.rs:848-862 — 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 `crates/tokscale-cli/src/main.rs:769` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/main.rs:767` calls `worktree_rollup_from_flag` and `crates/tokscale-cli/src/main.rs:809` 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 (16 lines × 3) REDACTED:2558— REDACTED:2558-2573 | REDACTED:2651-2666 | REDACTED:2742-2757 — 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 `REDACTED:2558` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `LegacyUnifiedMessageV7` in one and `LegacyUnifiedMessageV8` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 11) crates/tokscale-cli/src/tui/ui/agents.rs:216— crates/tokscale-cli/src/tui/ui/agents.rs:216-231 | crates/tokscale-cli/src/tui/ui/daily.rs:388-403 | crates/tokscale-cli/src/tui/ui/daily.rs:642-657 | crates/tokscale-cli/src/tui/ui/hourly.rs:374-389 | crates/tokscale-cli/src/tui/ui/minutely.rs:326-341 | crates/tokscale-cli/src/tui/ui/models.rs:497-512 | crates/tokscale-cli/src/tui/ui/monthly.rs:369-384 | crates/tokscale-cli/src/tui/ui/monthly.rs:588-602 | crates/tokscale-cli/src/tui/ui/overview.rs:482-497 | crates/tokscale-cli/src/tui/ui/projects.rs:458-473 | crates/tokscale-cli/src/tui/ui/sessions.rs:805-820 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 4) crates/tokscale-cli/src/main.rs:2662— crates/tokscale-cli/src/main.rs:2662-2676 | crates/tokscale-cli/src/main.rs:2730-2744 | crates/tokscale-cli/src/main.rs:2923-2937 | crates/tokscale-cli/src/main.rs:3109-3123 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2662` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) crates/tokscale-cli/src/cursor.rs:3103— crates/tokscale-cli/src/cursor.rs:3103-3115 | crates/tokscale-cli/src/hindsight.rs:572-586 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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 `crates/tokscale-cli/src/cursor.rs:3103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 5) crates/tokscale-core/src/lib.rs:2652— crates/tokscale-core/src/lib.rs:2652-2665 | crates/tokscale-core/src/lib.rs:4109-4122 | crates/tokscale-core/src/lib.rs:4443-4456 | crates/tokscale-core/src/lib.rs:4547-4560 | crates/tokscale-core/src/lib.rs:5020-5033 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/lib.rs:2652` 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 × 6) crates/tokscale-cli/src/tui/ui/daily.rs:191— crates/tokscale-cli/src/tui/ui/daily.rs:191-203 | crates/tokscale-cli/src/tui/ui/hourly.rs:147-159 | crates/tokscale-cli/src/tui/ui/minutely.rs:135-147 | crates/tokscale-cli/src/tui/ui/monthly.rs:208-220 | crates/tokscale-cli/src/tui/ui/monthly.rs:421-433 | crates/tokscale-cli/src/tui/ui/sessions.rs:615-627 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/minutely.rs:134` calls `wrap` and `crates/tokscale-cli/src/tui/ui/daily.rs:190` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 5) crates/tokscale-cli/src/tui/ui/agents.rs:194— crates/tokscale-cli/src/tui/ui/agents.rs:194-206 | crates/tokscale-cli/src/tui/ui/daily.rs:620-632 | crates/tokscale-cli/src/tui/ui/models.rs:475-487 | crates/tokscale-cli/src/tui/ui/monthly.rs:347-359 | crates/tokscale-cli/src/tui/ui/monthly.rs:566-578 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:194` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crates/tokscale-cli/src/tui/ui/daily.rs:452— crates/tokscale-cli/src/tui/ui/daily.rs:452-464 | crates/tokscale-cli/src/tui/ui/model_trend.rs:101-113 | crates/tokscale-cli/src/tui/ui/monthly.rs:399-411 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/model_trend.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) crates/tokscale-core/src/sessions/kiro.rs:1249— crates/tokscale-core/src/sessions/kiro.rs:1249-1261 | crates/tokscale-core/src/sessions/kiro.rs:1277-1288 — both copies are in the same file, so extract the 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, `crates/tokscale-core/src/sessions/kiro.rs:1274` calls `iter`, `Some`, `get` and `crates/tokscale-core/src/sessions/kiro.rs:1248` 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 (4–13 lines × 3) crates/tokscale-core/src/sessions/devin.rs:134— crates/tokscale-core/src/sessions/devin.rs:134-137 | crates/tokscale-core/src/sessions/opencode_schema.rs:1186-1198 | crates/tokscale-core/src/sessions/opencode_schema.rs:1215-1226 — 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 `crates/tokscale-core/src/sessions/opencode_schema.rs:1186` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 5) crates/tokscale-core/src/lib.rs:6218— crates/tokscale-core/src/lib.rs:6218-6227 | crates/tokscale-core/src/lib.rs:6348-6357 | crates/tokscale-core/src/lib.rs:6477-6486 | crates/tokscale-core/src/lib.rs:6546-6557 | crates/tokscale-core/src/lib.rs:7044-7053 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-core/src/lib.rs:6359` calls `load_pricing_for_local_parse` and `crates/tokscale-core/src/lib.rs:7055` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19–21 lines × 4) crates/tokscale-cli/src/tui/app.rs:2581— crates/tokscale-cli/src/tui/app.rs:2581-2601 | crates/tokscale-cli/src/tui/app.rs:2617-2637 | crates/tokscale-cli/src/tui/app.rs:2704-2722 | crates/tokscale-cli/src/tui/app.rs:2787-2807 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/app.rs:2581` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) crates/tokscale-cli/src/main.rs:2706— crates/tokscale-cli/src/main.rs:2706-2717 | crates/tokscale-cli/src/main.rs:2886-2897 | crates/tokscale-cli/src/main.rs:3077-3088 — 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 `crates/tokscale-cli/src/main.rs:2706` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–12 lines × 3) crates/tokscale-cli/src/main.rs:3416— crates/tokscale-cli/src/main.rs:3416-3427 | crates/tokscale-cli/src/main.rs:3496-3507 | crates/tokscale-cli/src/main.rs:3789-3799 — 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 `crates/tokscale-cli/src/main.rs:3416` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–12 lines × 4) crates/tokscale-cli/src/tui/ui/daily.rs:588— crates/tokscale-cli/src/tui/ui/daily.rs:588-598 | crates/tokscale-cli/src/tui/ui/model_trend.rs:210-212 | crates/tokscale-cli/src/tui/ui/models.rs:417-420 | crates/tokscale-cli/src/tui/ui/models.rs:450-461 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/model_trend.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/models.rs:450` calls `from`, `format_tokens` and `crates/tokscale-cli/src/tui/ui/daily.rs:588` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 9) crates/tokscale-cli/src/tui/ui/agents.rs:152— crates/tokscale-cli/src/tui/ui/agents.rs:152-162 | crates/tokscale-cli/src/tui/ui/daily.rs:276-286 | crates/tokscale-cli/src/tui/ui/daily.rs:537-547 | crates/tokscale-cli/src/tui/ui/minutely.rs:207-217 | crates/tokscale-cli/src/tui/ui/model_trend.rs:172-181 | crates/tokscale-cli/src/tui/ui/monthly.rs:277-287 | crates/tokscale-cli/src/tui/ui/monthly.rs:497-507 | crates/tokscale-cli/src/tui/ui/projects.rs:402-412 | crates/tokscale-cli/src/tui/ui/sessions.rs:701-711 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/daily.rs:550` calls `model_color_for` and `crates/tokscale-cli/src/tui/ui/agents.rs:166` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 6) crates/tokscale-core/src/lib.rs:2657— crates/tokscale-core/src/lib.rs:2657-2667 | crates/tokscale-core/src/lib.rs:4114-4124 | crates/tokscale-core/src/lib.rs:4448-4458 | crates/tokscale-core/src/lib.rs:4552-4562 | crates/tokscale-core/src/lib.rs:4807-4817 | crates/tokscale-core/src/lib.rs:5025-5035 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11 lines × 4) REDACTED:2543— REDACTED:2543-2553 | REDACTED:2636-2646 | REDACTED:2727-2737 | REDACTED:2889-2899 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2543` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `message` to `LegacyUnifiedMessageV7` in one and `LegacyUnifiedMessageV8` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:2554` calls `into` and `REDACTED:2900` 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 (3–11 lines × 3) crates/tokscale-core/src/lib.rs:6077— crates/tokscale-core/src/lib.rs:6077-6079 | crates/tokscale-core/src/lib.rs:6309-6319 | crates/tokscale-core/src/lib.rs:6424-6431 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 9) crates/tokscale-cli/src/tui/ui/daily.rs:309— crates/tokscale-cli/src/tui/ui/daily.rs:309-318 | crates/tokscale-cli/src/tui/ui/daily.rs:332-341 | crates/tokscale-cli/src/tui/ui/minutely.rs:250-259 | crates/tokscale-cli/src/tui/ui/minutely.rs:275-284 | crates/tokscale-cli/src/tui/ui/monthly.rs:298-307 | crates/tokscale-cli/src/tui/ui/monthly.rs:314-323 | crates/tokscale-cli/src/tui/ui/monthly.rs:518-527 | crates/tokscale-cli/src/tui/ui/monthly.rs:534-543 | crates/tokscale-cli/src/tui/ui/sessions.rs:744-753 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:309` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/daily.rs:344` calls `from`, `format_tokens`, `style` and `crates/tokscale-cli/src/tui/ui/minutely.rs:287` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) crates/tokscale-cli/src/antigravity.rs:667— crates/tokscale-cli/src/antigravity.rs:667-676 | crates/tokscale-cli/src/auth.rs:79-88 | crates/tokscale-cli/src/cursor.rs:676-685 | crates/tokscale-cli/src/warp.rs:98-107 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/cursor.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/antigravity.rs:667` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) crates/tokscale-cli/src/tui/ui/usage.rs:1043— crates/tokscale-cli/src/tui/ui/usage.rs:1043-1051 | crates/tokscale-cli/src/tui/ui/usage.rs:1676-1685 | crates/tokscale-cli/src/tui/ui/usage.rs:2325-2333 — 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 `crates/tokscale-cli/src/tui/ui/usage.rs:1043` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `app` to `&mut App` in one and `&App` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–10 lines × 2) crates/tokscale-cli/src/commands/usage/cursor.rs:114— crates/tokscale-cli/src/commands/usage/cursor.rs:114-123 | crates/tokscale-cli/src/commands/usage/cursor.rs:177-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/commands/usage/cursor.rs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 11) crates/tokscale-cli/src/tui/ui/agents.rs:81— crates/tokscale-cli/src/tui/ui/agents.rs:81-89 | crates/tokscale-cli/src/tui/ui/daily.rs:176-184 | crates/tokscale-cli/src/tui/ui/daily.rs:459-467 | crates/tokscale-cli/src/tui/ui/hourly.rs:126-134 | crates/tokscale-cli/src/tui/ui/minutely.rs:119-127 | crates/tokscale-cli/src/tui/ui/model_trend.rs:108-116 | crates/tokscale-cli/src/tui/ui/models.rs:263-271 | crates/tokscale-cli/src/tui/ui/monthly.rs:193-201 | crates/tokscale-cli/src/tui/ui/monthly.rs:406-414 | crates/tokscale-cli/src/tui/ui/projects.rs:316-324 | crates/tokscale-cli/src/tui/ui/sessions.rs:600-608 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:81` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 3) crates/tokscale-core/src/sessions/claudecode.rs:2112— crates/tokscale-core/src/sessions/claudecode.rs:2112-2120 | crates/tokscale-core/src/sessions/codebuff.rs:55-62 | crates/tokscale-core/src/sessions/freebuff.rs:136-143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7–9 lines × 2) crates/tokscale-cli/src/tui/ui/models.rs:408— crates/tokscale-cli/src/tui/ui/models.rs:408-416 | crates/tokscale-cli/src/tui/ui/models.rs:441-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/models.rs:408` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 14) crates/tokscale-cli/src/tui/ui/agents.rs:80— crates/tokscale-cli/src/tui/ui/agents.rs:80-87 | crates/tokscale-cli/src/tui/ui/daily.rs:175-182 | crates/tokscale-cli/src/tui/ui/daily.rs:458-465 | crates/tokscale-cli/src/tui/ui/hourly.rs:125-132 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:40-47 | crates/tokscale-cli/src/tui/ui/minutely.rs:118-125 | crates/tokscale-cli/src/tui/ui/model_trend.rs:107-114 | crates/tokscale-cli/src/tui/ui/models.rs:262-269 | crates/tokscale-cli/src/tui/ui/monthly.rs:192-199 | crates/tokscale-cli/src/tui/ui/monthly.rs:405-412 | crates/tokscale-cli/src/tui/ui/projects.rs:315-322 | crates/tokscale-cli/src/tui/ui/sessions.rs:599-606 | crates/tokscale-cli/src/tui/ui/stats.rs:264-271 | crates/tokscale-cli/src/tui/ui/stats.rs:646-653 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:80` 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 first that the copies are not typed on the same thing: the declarations holding them bind `app` to `&mut App` in one and `&App` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 6) crates/tokscale-cli/src/tui/ui/daily.rs:190— crates/tokscale-cli/src/tui/ui/daily.rs:190-197 | crates/tokscale-cli/src/tui/ui/daily.rs:474-481 | crates/tokscale-cli/src/tui/ui/hourly.rs:146-153 | crates/tokscale-cli/src/tui/ui/monthly.rs:207-214 | crates/tokscale-cli/src/tui/ui/monthly.rs:420-427 | crates/tokscale-cli/src/tui/ui/sessions.rs:614-621 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/daily.rs:198` calls `iter`, `any` and `crates/tokscale-cli/src/tui/ui/daily.rs:482` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) crates/tokscale-core/src/cc_mirror.rs:24— crates/tokscale-core/src/cc_mirror.rs:24-31 | crates/tokscale-core/src/scanner.rs:1356-1363 | crates/tokscale-core/src/scanner.rs:1395-1402 | crates/tokscale-core/src/scanner.rs:1456-1463 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-core/src/cc_mirror.rs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 6) crates/tokscale-core/src/lib.rs:2651— crates/tokscale-core/src/lib.rs:2651-2661 | crates/tokscale-core/src/lib.rs:4108-4118 | crates/tokscale-core/src/lib.rs:4442-4452 | crates/tokscale-core/src/lib.rs:4546-4556 | crates/tokscale-core/src/lib.rs:5019-5029 | crates/tokscale-core/src/lib.rs:5308-5314 — all 6 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 `crates/tokscale-core/src/lib.rs:2651` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 4) crates/tokscale-cli/src/tui/ui/daily.rs:282— crates/tokscale-cli/src/tui/ui/daily.rs:282-288 | crates/tokscale-cli/src/tui/ui/daily.rs:543-549 | crates/tokscale-cli/src/tui/ui/minutely.rs:213-219 | crates/tokscale-cli/src/tui/ui/models.rs:355-361 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/minutely.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 248 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:282` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/tokscale-cli/src/tui/ui/agents.rs:94— crates/tokscale-cli/src/tui/ui/agents.rs:94-100 | crates/tokscale-cli/src/tui/ui/daily.rs:482-488 | crates/tokscale-cli/src/tui/ui/sessions.rs:623-629 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/daily.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 134 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/tokscale-cli/src/tui/ui/sessions.rs:622` calls `iter`, `any` and `crates/tokscale-cli/src/tui/ui/agents.rs:93` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 16) crates/tokscale-core/src/lib.rs:8309— crates/tokscale-core/src/lib.rs:8309-8314 | crates/tokscale-core/src/lib.rs:8350-8355 | crates/tokscale-core/src/lib.rs:8381-8386 | crates/tokscale-core/src/lib.rs:8422-8427 | crates/tokscale-core/src/lib.rs:8443-8448 | crates/tokscale-core/src/lib.rs:8464-8469 | crates/tokscale-core/src/lib.rs:8482-8487 | crates/tokscale-core/src/lib.rs:8561-8566 | crates/tokscale-core/src/lib.rs:8576-8581 | crates/tokscale-core/src/lib.rs:8591-8596 | crates/tokscale-core/src/lib.rs:8606-8611 | crates/tokscale-core/src/lib.rs:8621-8626 | crates/tokscale-core/src/lib.rs:8636-8641 | crates/tokscale-core/src/lib.rs:8714-8719 | crates/tokscale-core/src/lib.rs:8757-8762 | crates/tokscale-core/src/lib.rs:9073-9078 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 11) crates/tokscale-core/src/lib.rs:8483— crates/tokscale-core/src/lib.rs:8483-8488 | crates/tokscale-core/src/lib.rs:8562-8567 | crates/tokscale-core/src/lib.rs:8577-8582 | crates/tokscale-core/src/lib.rs:8592-8597 | crates/tokscale-core/src/lib.rs:8607-8612 | crates/tokscale-core/src/lib.rs:8622-8627 | crates/tokscale-core/src/lib.rs:8637-8642 | crates/tokscale-core/src/lib.rs:8652-8657 | crates/tokscale-core/src/lib.rs:8715-8720 | crates/tokscale-core/src/lib.rs:8758-8763 | crates/tokscale-core/src/lib.rs:9074-9079 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 8) crates/tokscale-cli/src/tui/ui/daily.rs:168— crates/tokscale-cli/src/tui/ui/daily.rs:168-173 | crates/tokscale-cli/src/tui/ui/hourly.rs:118-123 | crates/tokscale-cli/src/tui/ui/hourly_profile.rs:33-38 | crates/tokscale-cli/src/tui/ui/minutely.rs:111-116 | crates/tokscale-cli/src/tui/ui/monthly.rs:185-190 | crates/tokscale-cli/src/tui/ui/stats.rs:639-644 | crates/tokscale-cli/src/tui/ui/usage.rs:1036-1041 | crates/tokscale-cli/src/tui/ui/usage.rs:2318-2323 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:168` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 6) crates/tokscale-cli/src/tui/ui/agents.rs:73— crates/tokscale-cli/src/tui/ui/agents.rs:73-78 | crates/tokscale-cli/src/tui/ui/models.rs:255-260 | crates/tokscale-cli/src/tui/ui/projects.rs:308-313 | crates/tokscale-cli/src/tui/ui/sessions.rs:592-597 | crates/tokscale-cli/src/tui/ui/stats.rs:257-262 | crates/tokscale-cli/src/tui/ui/usage.rs:59-64 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/agents.rs` and `crates/tokscale-cli/src/tui/ui/models.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 178 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/agents.rs:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `app` to `&mut App` in one and `&App` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 4) crates/tokscale-cli/src/main.rs:2632— crates/tokscale-cli/src/main.rs:2632-2637 | crates/tokscale-cli/src/main.rs:2706-2711 | crates/tokscale-cli/src/main.rs:2886-2891 | crates/tokscale-cli/src/main.rs:3077-3082 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/main.rs:2632` 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 (5 lines × 8) crates/tokscale-cli/src/tui/ui/daily.rs:204— crates/tokscale-cli/src/tui/ui/daily.rs:204-208 | crates/tokscale-cli/src/tui/ui/daily.rs:488-492 | crates/tokscale-cli/src/tui/ui/hourly.rs:160-164 | crates/tokscale-cli/src/tui/ui/minutely.rs:148-152 | crates/tokscale-cli/src/tui/ui/model_trend.rs:136-140 | crates/tokscale-cli/src/tui/ui/models.rs:283-287 | crates/tokscale-cli/src/tui/ui/monthly.rs:221-225 | crates/tokscale-cli/src/tui/ui/monthly.rs:434-438 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/tokscale-cli/src/tui/ui/model_trend.rs:141` calls `hint_key_style` and `crates/tokscale-cli/src/tui/ui/daily.rs:209` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) crates/tokscale-cli/src/tui/ui/daily.rs:319— crates/tokscale-cli/src/tui/ui/daily.rs:319-325 | crates/tokscale-cli/src/tui/ui/hourly.rs:308-313 | crates/tokscale-cli/src/tui/ui/minutely.rs:260-265 | crates/tokscale-cli/src/tui/ui/monthly.rs:308-312 | crates/tokscale-cli/src/tui/ui/monthly.rs:528-532 — before extracting anything, compare `crates/tokscale-cli/src/tui/ui/daily.rs` and `crates/tokscale-cli/src/tui/ui/hourly.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 224 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/tokscale-cli/src/tui/ui/daily.rs:319` 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 (9 lines × 9) crates/tokscale-cli/src/tui/themes.rs:377— crates/tokscale-cli/src/tui/themes.rs:377-385 | crates/tokscale-cli/src/tui/themes.rs:387-395 | crates/tokscale-cli/src/tui/themes.rs:397-405 | crates/tokscale-cli/src/tui/themes.rs:407-415 | crates/tokscale-cli/src/tui/themes.rs:417-425 | crates/tokscale-cli/src/tui/themes.rs:427-435 | crates/tokscale-cli/src/tui/themes.rs:437-445 | crates/tokscale-cli/src/tui/themes.rs:447-455 | crates/tokscale-cli/src/tui/themes.rs:457-465 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Off the main sequence: tokscale-core — tokscale-core: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Low cohesion: UnifiedMessage (LCOM4 4) crates/tokscale-core/src/sessions/mod.rs:143— UnifiedMessage's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
Duplication concentrated across 9 sibling directories (37 clone groups) packages/frontend/src/app/(main)/capital/compute/page.tsx:40— 37 duplicated blocks under packages/frontend/src/app/(main)/capital/ have copies in at least two of the sibling directories _components, companies, compute, deals, investors, methodology (+3 more sibling(s) not listed) — 31 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 37 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 37 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 37 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 3 sibling directories (27 clone groups) packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75— 27 duplicated blocks under packages/frontend/src/ have copies in at least two of the sibling directories app, components, lib — 14 of them are reported below, and 13 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 27 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 27 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 27 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 10 sibling directories (15 clone groups) REDACTED:24— 15 duplicated blocks under packages/frontend/src/app/api/ have copies in at least two of the sibling directories admin, auth, badge, embed, groups, leaderboard (+4 more sibling(s) not listed) — 10 of them are reported below, and 5 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 15 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 15 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 15 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 6 sibling directories (9 clone groups) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818— 9 duplicated blocks under packages/frontend/src/app/(main)/ have copies in at least two of the sibling directories capital, groups, leaderboard, methodology, privacy, terms — 5 of them are reported below, and 4 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 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 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 9 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 6 sibling directories (5 clone groups) packages/frontend/src/components/landing/sections/FooterSection.tsx:11— 5 duplicated blocks under packages/frontend/src/components/ have copies in at least two of the sibling directories explore, home, landing, layout, leaderboard, ui — 4 of them are reported below, and 1 is 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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 (109 matched lines × 2 locations) · ×1
Duplicated block with local edits (109 matched lines × 2 locations) packages/frontend/src/components/explore/UsageBoards.tsx:380— packages/frontend/src/components/explore/UsageBoards.tsx:380 · packages/frontend/src/components/explore/UsageBoards.tsx:510 — the two spans are one implementation copied and then locally edited — 762 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 (77 matched lines × 2 locations) · ×1
Duplicated block with local edits (77 matched lines × 2 locations) packages/frontend/scripts/capital/build-org-ids.ts:91— packages/frontend/scripts/capital/build-org-ids.ts:91 · packages/frontend/scripts/capital/lib/sec-client.ts:125 — the two spans are one implementation copied and then locally edited — 635 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 (75 matched lines × 2 locations) · ×1
Duplicated block with local edits (75 matched lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/members/route.ts:26— packages/frontend/src/app/api/groups/[slug]/members/route.ts:26 · packages/frontend/src/app/api/groups/[slug]/route.ts:56 — the two spans are one implementation copied and then locally edited — 484 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 (70 matched lines × 2 locations) · ×1
Duplicated block with local edits (70 matched lines × 2 locations) packages/frontend/src/lib/db/dailyBreakdownReported.ts:42— packages/frontend/src/lib/db/dailyBreakdownReported.ts:42 · packages/frontend/src/lib/db/deviceClientTotals.ts:77 — the two spans are one implementation copied and then locally edited — 459 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 (60 matched lines × 2 locations) · ×1
Duplicated block with local edits (60 matched lines × 2 locations) packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25— packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25 · packages/frontend/src/lib/embed/renderTerminalEmbedSvg.ts:25 — the two spans are one implementation copied and then locally edited — 352 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 (50 matched lines × 2 locations) · ×1
Duplicated block with local edits (50 matched lines × 2 locations) packages/frontend/src/lib/embed/renderGraphEmbedSvg.ts:31— packages/frontend/src/lib/embed/renderGraphEmbedSvg.ts:31 · packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:34 — the two spans are one implementation copied and then locally edited — 254 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 (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) packages/frontend/src/app/(main)/capital/compute/page.tsx:40— packages/frontend/src/app/(main)/capital/compute/page.tsx:40 · packages/frontend/src/app/(main)/capital/rounds/page.tsx:33 — the two spans are one implementation copied and then locally edited — 486 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 (42 lines × 2 locations) packages/frontend/src/lib/groups/queries.ts:39— packages/frontend/src/lib/groups/queries.ts:39 · packages/frontend/src/lib/groups/queries.ts:85 — 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.
R10 · Code Duplication· Duplicated block with local edits (41 matched lines × 2 locations) · ×1
Duplicated block with local edits (41 matched lines × 2 locations) packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:448— packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:448 · packages/frontend/src/app/(main)/capital/compute/page.tsx:141 — the two spans are one implementation copied and then locally edited — 336 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 (40 matched lines × 2 locations) · ×1
Duplicated block with local edits (40 matched lines × 2 locations) packages/frontend/src/components/Skeleton.tsx:95— packages/frontend/src/components/Skeleton.tsx:95 · packages/frontend/src/components/Skeleton.tsx:206 — the two spans are one implementation copied and then locally edited — 262 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 (39 lines × 2 locations) packages/frontend/src/app/(main)/capital/deals/[slug]/page.tsx:10— packages/frontend/src/app/(main)/capital/deals/[slug]/page.tsx:10 · packages/frontend/src/app/(main)/capital/rounds/[slug]/page.tsx:10 — 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.
R10 · Code Duplication· Duplicated block with local edits (39 matched lines × 2 locations) · ×1
Duplicated block with local edits (39 matched lines × 2 locations) packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75— packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75 · packages/frontend/src/lib/publicProfileDevices.ts:45 — the two spans are one implementation copied and then locally edited — 281 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 (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:36— packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:36 · packages/frontend/src/app/api/groups/[slug]/members/route.ts:80 — the two spans are one implementation copied and then locally edited — 328 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 (37 matched lines × 2 locations) · ×1
Duplicated block with local edits (37 matched lines × 2 locations) packages/frontend/src/components/explore/ScoreTimeline.tsx:418— packages/frontend/src/components/explore/ScoreTimeline.tsx:418 · packages/frontend/src/components/explore/TrendChart.tsx:216 — the two spans are one implementation copied and then locally edited — 230 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 (35 matched lines × 2 locations) · ×1
Duplicated block with local edits (35 matched lines × 2 locations) packages/frontend/src/components/TokenGraph2D.tsx:266— packages/frontend/src/components/TokenGraph2D.tsx:266 · packages/frontend/src/components/TokenGraph3D.tsx:269 — the two spans are one implementation copied and then locally edited — 279 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 (33 matched lines × 2 locations) · ×1
Duplicated block with local edits (33 matched lines × 2 locations) packages/frontend/src/components/profile/ProfileDevices.tsx:91— packages/frontend/src/components/profile/ProfileDevices.tsx:91 · packages/frontend/src/components/profile/ProfileModels.tsx:95 — the two spans are one implementation copied and then locally edited — 212 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 (31 lines × 2 locations) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818— packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:818 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1363 — 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.
R10 · Code Duplication· Duplicated block with local edits (29 matched lines × 2 locations) · ×1
Duplicated block with local edits (29 matched lines × 2 locations) REDACTED:24— REDACTED:24 · REDACTED:40 — the two spans are one implementation copied and then locally edited — 194 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 (28 lines × 2 locations) packages/cli/src/index.ts:101— packages/cli/src/index.ts:101 · packages/cli/src/index.ts:135 — 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.
R10 · Code Duplication· Duplicated block with local edits (28 matched lines × 2 locations) · ×1
Duplicated block with local edits (28 matched lines × 2 locations) packages/frontend/src/app/(main)/models/all/page.tsx:26— packages/frontend/src/app/(main)/models/all/page.tsx:26 · packages/frontend/src/app/(main)/models/page.tsx:25 — the two spans are one implementation copied and then locally edited — 198 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 (23 matched lines × 2 locations) · ×1
Duplicated block with local edits (23 matched lines × 2 locations) packages/frontend/src/app/api/settings/account/route.ts:41— packages/frontend/src/app/api/settings/account/route.ts:41 · packages/frontend/src/app/api/settings/submitted-data/route.ts:36 — the two spans are one implementation copied and then locally edited — 156 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 (20 lines × 2 locations) packages/frontend/src/app/api/me/stats/route.ts:48— packages/frontend/src/app/api/me/stats/route.ts:48 · packages/frontend/src/app/api/submit/route.ts:507 — 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 (19 lines × 5 locations) packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:27— packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:27 · packages/frontend/src/lib/embed/renderMinimalEmbedSvg.ts:25 · packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:26 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:26 · +1 more site(s) not listed — the 5 copies are spread across 5 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 (18 lines × 3 locations) packages/frontend/src/app/api/auth/token/route.ts:5— packages/frontend/src/app/api/auth/token/route.ts:5 · packages/frontend/src/app/api/me/stats/route.ts:65 · packages/frontend/src/app/api/submit/route.ts:523 — 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 (18 matched lines × 2 locations) · ×1
Duplicated block with local edits (18 matched lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/leaderboard/route.ts:9— packages/frontend/src/app/api/groups/[slug]/leaderboard/route.ts:9 · REDACTED:10 — the two spans are one implementation copied and then locally edited — 190 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.
Boundary violation [package:test-suite-dependency] packages/frontend/scripts/verify-ui-regressions.ts:13— packages/frontend/scripts/verify-ui-regressions.ts:13 imports packages/frontend/__tests__/support/localExport.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.
Complex function (anonymous) (cyclomatic 174, cognitive 296) packages/frontend/src/app/api/submit/route.ts:628— (anonymous) has cyclomatic complexity 174 and cognitive complexity 296; 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 getPublicProfileResponse (cyclomatic 117, cognitive 188) packages/frontend/src/lib/publicProfileData.ts:107— getPublicProfileResponse has cyclomatic complexity 117 and cognitive complexity 188; 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 main (cyclomatic 109, cognitive 189) · ×1
Complex function main (cyclomatic 109, cognitive 189) packages/frontend/scripts/capital/build-org-ids.ts:820— main has cyclomatic complexity 109 and cognitive complexity 189; 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 planParserHighWaterSubmission (cyclomatic 60, cognitive 71) packages/frontend/src/lib/db/parserHighWater.ts:1527— planParserHighWaterSubmission has cyclomatic complexity 60 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 (anonymous) (cyclomatic 52, cognitive 50) REDACTED:305— (anonymous) has cyclomatic complexity 52 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 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 LeaderboardClient (cyclomatic 52, cognitive 44) packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:927— LeaderboardClient has cyclomatic complexity 52 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 validateLedgerContent (cyclomatic 46, cognitive 71) packages/frontend/src/lib/capital/ledger/content.ts:79— validateLedgerContent has cyclomatic complexity 46 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 buildCompany (cyclomatic 45, cognitive 58) packages/frontend/scripts/capital/build-capex.ts:258— buildCompany has cyclomatic complexity 45 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 HeaderFacts (cyclomatic 39, cognitive 32) packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:86— HeaderFacts has cyclomatic complexity 39 and cognitive complexity 32; 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 validateSubmission (cyclomatic 38, cognitive 69) packages/frontend/src/lib/validation/submission.ts:397— validateSubmission has cyclomatic complexity 38 and cognitive complexity 69; 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 V2Profile (cyclomatic 38, cognitive 37) packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:587— V2Profile has cyclomatic complexity 38 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.
Complex function antigravityPriorCoverage (cyclomatic 35, cognitive 82) packages/frontend/src/lib/db/antigravityStateCoverage.ts:496— antigravityPriorCoverage has cyclomatic complexity 35 and cognitive complexity 82; 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 PATCH (cyclomatic 35, cognitive 39) packages/frontend/src/app/api/groups/[slug]/route.ts:83— PATCH has cyclomatic complexity 35 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 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 createContributionCalendar (cyclomatic 34, cognitive 45) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:579— createContributionCalendar has cyclomatic complexity 34 and cognitive complexity 45; 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 EventDetail (cyclomatic 34, cognitive 32) packages/frontend/src/app/(main)/capital/_components/EventDetail.tsx:92— EventDetail has cyclomatic complexity 34 and cognitive complexity 32; 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 remixAccount (cyclomatic 32, cognitive 59) REDACTED:271— remixAccount has cyclomatic complexity 32 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 handleKeyDown (cyclomatic 32, cognitive 30) packages/frontend/src/components/ui/Select.tsx:276— handleKeyDown has cyclomatic complexity 32 and cognitive complexity 30; 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 ProfileUsageChart (cyclomatic 32, cognitive 29) packages/frontend/src/components/profile/ProfileUsageChart.tsx:866— ProfileUsageChart has cyclomatic complexity 32 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function valuationRatio (cyclomatic 30, cognitive 31) packages/frontend/src/lib/capital/ledger/ratio.ts:21— valuationRatio has cyclomatic complexity 30 and cognitive complexity 31; 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 POST (cyclomatic 29, cognitive 31) · ×1
Complex function POST (cyclomatic 29, cognitive 31) packages/frontend/src/app/api/submit/route.ts:523— POST has cyclomatic complexity 29 and cognitive complexity 31; 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 renderProfileCardSvg (cyclomatic 29, cognitive 28) packages/frontend/src/lib/embed/renderProfileEmbedSvg.ts:41— renderProfileCardSvg has cyclomatic complexity 29 and cognitive complexity 28; 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 getWithholdingUsageTotals (cyclomatic 27, cognitive 73) packages/frontend/src/lib/moderation/withholding.ts:138— getWithholdingUsageTotals has cyclomatic complexity 27 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.
R2 · Cyclomatic Complexity· Complex function company (cyclomatic 27, cognitive 39) · ×1
Complex function company (cyclomatic 27, cognitive 39) packages/frontend/src/lib/capital/ledger/model.ts:434— company has cyclomatic complexity 27 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 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 FundingRow (cyclomatic 27, cognitive 23) packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:340— FundingRow has cyclomatic complexity 27 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function scoreCandidate (cyclomatic 26, cognitive 37) packages/frontend/src/lib/moderation/heuristics.ts:484— scoreCandidate has cyclomatic complexity 26 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 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 ProfilePageClient (cyclomatic 26, cognitive 24) packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:138— ProfilePageClient has cyclomatic complexity 26 and cognitive complexity 24; 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 GroupDetailClient (cyclomatic 26, cognitive 22) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:517— GroupDetailClient has cyclomatic complexity 26 and cognitive complexity 22; 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 25, cognitive 32) · ×1
Complex function main (cyclomatic 25, cognitive 32) packages/frontend/scripts/capital/verify-quotes.ts:158— main has cyclomatic complexity 25 and cognitive complexity 32; 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 ResultRowView (cyclomatic 25, cognitive 24) packages/frontend/src/components/explore/BenchmarkDetailView.tsx:743— ResultRowView has cyclomatic complexity 25 and cognitive complexity 24; 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 GET (cyclomatic 25, cognitive 23) · ×1
Complex function GET (cyclomatic 25, cognitive 23) REDACTED:117— GET has cyclomatic complexity 25 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function orgView (cyclomatic 24, cognitive 23) packages/frontend/src/lib/capital/ledger/model.ts:226— orgView has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function renderOrbitEmbedSvg (cyclomatic 24, cognitive 23) packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:40— renderOrbitEmbedSvg has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function POST (cyclomatic 24, cognitive 19) · ×1
Complex function POST (cyclomatic 24, cognitive 19) packages/frontend/src/app/api/groups/[slug]/invite/route.ts:71— POST has cyclomatic complexity 24 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeSql (cyclomatic 23, cognitive 36) packages/frontend/__tests__/api/submitMiCodeTransition.test.ts:89— executeSql has cyclomatic complexity 23 and cognitive complexity 36; 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 buildPeriodRollup (cyclomatic 23, cognitive 32) packages/frontend/src/lib/explore/rollup.ts:181— buildPeriodRollup has cyclomatic complexity 23 and cognitive complexity 32; 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 InstantTooltip (cyclomatic 23, cognitive 26) packages/frontend/src/components/ui/InstantTooltip.tsx:122— InstantTooltip has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function detectLibcKind (cyclomatic 23, cognitive 25) packages/cli/src/index.ts:27— detectLibcKind has cyclomatic complexity 23 and cognitive complexity 25; 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 applyRecountProofToCell (cyclomatic 23, cognitive 25) packages/frontend/src/lib/db/parserHighWater.ts:777— applyRecountProofToCell has cyclomatic complexity 23 and cognitive complexity 25; 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 ProfileContributionGraph (cyclomatic 23, cognitive 18) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2047— ProfileContributionGraph has cyclomatic complexity 23 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 eventView (cyclomatic 22, cognitive 17) packages/frontend/src/lib/capital/ledger/model.ts:307— eventView has cyclomatic complexity 22 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· packages/frontend/src/components/profile/ProfileContributionGraph.tsx · ×1
packages/frontend/src/components/profile/ProfileContributionGraph.tsx: 2381 lines of code packages/frontend/src/components/profile/ProfileContributionGraph.tsx:1— packages/frontend/src/components/profile/ProfileContributionGraph.tsx has 2381 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· packages/frontend/src/app/api/submit/route.ts · ×1
packages/frontend/src/app/api/submit/route.ts: 1887 lines of code packages/frontend/src/app/api/submit/route.ts:1— packages/frontend/src/app/api/submit/route.ts has 1887 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· packages/frontend/src/lib/db/parserHighWater.ts · ×1
packages/frontend/src/lib/db/parserHighWater.ts: 1792 lines of code packages/frontend/src/lib/db/parserHighWater.ts:1— packages/frontend/src/lib/db/parserHighWater.ts has 1792 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· packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx · ×1
packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx: 1342 lines of code packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1— packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx has 1342 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· packages/frontend/src/components/profile/ProfileUsageChart.tsx · ×1
packages/frontend/src/components/profile/ProfileUsageChart.tsx: 1296 lines of code packages/frontend/src/components/profile/ProfileUsageChart.tsx:1— packages/frontend/src/components/profile/ProfileUsageChart.tsx has 1296 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· packages/frontend/src/app/settings/SettingsClient.tsx · ×1
packages/frontend/src/app/settings/SettingsClient.tsx: 1136 lines of code packages/frontend/src/app/settings/SettingsClient.tsx:1— packages/frontend/src/app/settings/SettingsClient.tsx has 1136 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· packages/frontend/src/components/profile/ProfileEmbedDialog.tsx · ×1
packages/frontend/src/components/profile/ProfileEmbedDialog.tsx: 1117 lines of code packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:1— packages/frontend/src/components/profile/ProfileEmbedDialog.tsx has 1117 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· packages/frontend/scripts/capital/build-org-ids.ts · ×1
packages/frontend/scripts/capital/build-org-ids.ts: 1075 lines of code packages/frontend/scripts/capital/build-org-ids.ts:1— packages/frontend/scripts/capital/build-org-ids.ts has 1075 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· packages/frontend/src/components/explore/BenchmarkDetailView.tsx · ×1
packages/frontend/src/components/explore/BenchmarkDetailView.tsx: 978 lines of code packages/frontend/src/components/explore/BenchmarkDetailView.tsx:1— packages/frontend/src/components/explore/BenchmarkDetailView.tsx has 978 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· packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx · ×1
packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx: 943 lines of code packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx:1— packages/frontend/src/app/(main)/capital/companies/[slug]/page.tsx has 943 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· packages/frontend/src/components/profile/usageChartData.ts · ×1
packages/frontend/src/components/profile/usageChartData.ts: 888 lines of code packages/frontend/src/components/profile/usageChartData.ts:1— packages/frontend/src/components/profile/usageChartData.ts has 888 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· packages/frontend/src/lib/db/schema.ts · ×1
packages/frontend/src/lib/db/schema.ts: 866 lines of code packages/frontend/src/lib/db/schema.ts:1— packages/frontend/src/lib/db/schema.ts has 866 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· packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx · ×1
packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx: 853 lines of code packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:1— packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx has 853 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· packages/frontend/src/app/u/[username]/ProfilePageClient.tsx · ×1
packages/frontend/src/app/u/[username]/ProfilePageClient.tsx: 836 lines of code packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:1— packages/frontend/src/app/u/[username]/ProfilePageClient.tsx has 836 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· packages/frontend/src/components/explore/ModelsDashboard.tsx · ×1
packages/frontend/src/components/explore/ModelsDashboard.tsx: 780 lines of code packages/frontend/src/components/explore/ModelsDashboard.tsx:1— packages/frontend/src/components/explore/ModelsDashboard.tsx has 780 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· packages/frontend/src/lib/publicProfileData.ts · ×1
packages/frontend/src/lib/publicProfileData.ts: 777 lines of code packages/frontend/src/lib/publicProfileData.ts:1— packages/frontend/src/lib/publicProfileData.ts has 777 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· packages/frontend/src/lib/capital/ledger/model.ts · ×1
packages/frontend/src/lib/capital/ledger/model.ts: 759 lines of code packages/frontend/src/lib/capital/ledger/model.ts:1— packages/frontend/src/lib/capital/ledger/model.ts has 759 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· packages/frontend/src/components/ui/Select.tsx · ×1
packages/frontend/src/components/ui/Select.tsx: 727 lines of code packages/frontend/src/components/ui/Select.tsx:1— packages/frontend/src/components/ui/Select.tsx has 727 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· packages/frontend/src/lib/moderation/candidates.ts · ×1
packages/frontend/src/lib/moderation/candidates.ts: 724 lines of code packages/frontend/src/lib/moderation/candidates.ts:1— packages/frontend/src/lib/moderation/candidates.ts has 724 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· packages/frontend/src/lib/embed/embedShared.ts · ×1
packages/frontend/src/lib/embed/embedShared.ts: 687 lines of code packages/frontend/src/lib/embed/embedShared.ts:1— packages/frontend/src/lib/embed/embedShared.ts has 687 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· packages/frontend/src/lib/db/antigravityStateCoverage.ts · ×1
packages/frontend/src/lib/db/antigravityStateCoverage.ts: 666 lines of code packages/frontend/src/lib/db/antigravityStateCoverage.ts:1— packages/frontend/src/lib/db/antigravityStateCoverage.ts has 666 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· packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx · ×1
packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx: 651 lines of code packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx:1— packages/frontend/src/app/(main)/tracker/TrackerPageClient.tsx has 651 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· packages/frontend/src/lib/validation/submission.ts · ×1
packages/frontend/src/lib/validation/submission.ts: 622 lines of code packages/frontend/src/lib/validation/submission.ts:1— packages/frontend/src/lib/validation/submission.ts has 622 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· packages/frontend/src/lib/moderation/heuristics.ts · ×1
packages/frontend/src/lib/moderation/heuristics.ts: 619 lines of code packages/frontend/src/lib/moderation/heuristics.ts:1— packages/frontend/src/lib/moderation/heuristics.ts has 619 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· packages/frontend/src/components/home/CapitalPreview.tsx · ×1
packages/frontend/src/components/home/CapitalPreview.tsx: 617 lines of code packages/frontend/src/components/home/CapitalPreview.tsx:1— packages/frontend/src/components/home/CapitalPreview.tsx has 617 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· packages/frontend/src/components/explore/UsageBoards.tsx · ×1
packages/frontend/src/components/explore/UsageBoards.tsx: 579 lines of code packages/frontend/src/components/explore/UsageBoards.tsx:1— packages/frontend/src/components/explore/UsageBoards.tsx has 579 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· packages/frontend/src/lib/db/deviceClientTotals.ts · ×1
packages/frontend/src/lib/db/deviceClientTotals.ts: 576 lines of code packages/frontend/src/lib/db/deviceClientTotals.ts:1— packages/frontend/src/lib/db/deviceClientTotals.ts has 576 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· packages/frontend/src/components/layout/Navigation.tsx · ×1
packages/frontend/src/components/layout/Navigation.tsx: 570 lines of code packages/frontend/src/components/layout/Navigation.tsx:1— packages/frontend/src/components/layout/Navigation.tsx has 570 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· packages/frontend/src/components/explore/ScoreTimeline.tsx · ×1
packages/frontend/src/components/explore/ScoreTimeline.tsx: 552 lines of code packages/frontend/src/components/explore/ScoreTimeline.tsx:1— packages/frontend/src/components/explore/ScoreTimeline.tsx has 552 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· packages/frontend/src/lib/db/helpers.ts · ×1
packages/frontend/src/lib/db/helpers.ts: 550 lines of code packages/frontend/src/lib/db/helpers.ts:1— packages/frontend/src/lib/db/helpers.ts has 550 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· packages/frontend/src/components/explore/ModelDetailView.tsx · ×1
packages/frontend/src/components/explore/ModelDetailView.tsx: 545 lines of code packages/frontend/src/components/explore/ModelDetailView.tsx:1— packages/frontend/src/components/explore/ModelDetailView.tsx has 545 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· packages/frontend/scripts/capital/build-capex.ts · ×1
packages/frontend/scripts/capital/build-capex.ts: 535 lines of code packages/frontend/scripts/capital/build-capex.ts:1— packages/frontend/scripts/capital/build-capex.ts has 535 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
REDACTED: 520 lines of code REDACTED:1— REDACTED has 520 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· packages/frontend/src/components/landing/sections/WorldwideSection.tsx · ×1
packages/frontend/src/components/landing/sections/WorldwideSection.tsx: 507 lines of code packages/frontend/src/components/landing/sections/WorldwideSection.tsx:1— packages/frontend/src/components/landing/sections/WorldwideSection.tsx has 507 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· packages/frontend/src/components/explore/ModelCatalog.tsx · ×1
packages/frontend/src/components/explore/ModelCatalog.tsx: 504 lines of code packages/frontend/src/components/explore/ModelCatalog.tsx:1— packages/frontend/src/components/explore/ModelCatalog.tsx has 504 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· packages/frontend/src/components/landing/sections/HeroSection.tsx · ×1
packages/frontend/src/components/landing/sections/HeroSection.tsx: 504 lines of code packages/frontend/src/components/landing/sections/HeroSection.tsx:1— packages/frontend/src/components/landing/sections/HeroSection.tsx has 504 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· packages/frontend/src/lib/leaderboard/getLeaderboard.ts · ×1
packages/frontend/src/lib/leaderboard/getLeaderboard.ts: 492 lines of code packages/frontend/src/lib/leaderboard/getLeaderboard.ts:1— packages/frontend/src/lib/leaderboard/getLeaderboard.ts has 492 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· packages/frontend/src/lib/capital/ledger/epoch.ts · ×1
packages/frontend/src/lib/capital/ledger/epoch.ts: 479 lines of code packages/frontend/src/lib/capital/ledger/epoch.ts:1— packages/frontend/src/lib/capital/ledger/epoch.ts has 479 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· packages/frontend/src/components/DataInput.tsx · ×1
packages/frontend/src/components/DataInput.tsx: 477 lines of code packages/frontend/src/components/DataInput.tsx:1— packages/frontend/src/components/DataInput.tsx has 477 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· packages/frontend/src/components/profile/ProfileOverview.tsx · ×1
packages/frontend/src/components/profile/ProfileOverview.tsx: 476 lines of code packages/frontend/src/components/profile/ProfileOverview.tsx:1— packages/frontend/src/components/profile/ProfileOverview.tsx has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· The declared test suite includes a file that cannot be loaded · ×1
The declared test suite includes a file that cannot be loaded packages/frontend/__tests__/lib/clientRegistry.test.ts:16— This repository declares test tooling, and the ✓ above records that declaration — but packages/frontend/__tests__/lib/clientRegistry.test.ts and 1 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
Dead file (~565 LoC) packages/frontend/src/components/landing/sections/HeroSection.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~558 LoC) packages/frontend/src/components/landing/sections/WorldwideSection.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~418 LoC) packages/frontend/src/components/landing/sections/QuickstartSection.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~392 LoC) packages/frontend/src/components/BlackholeHero.tsx— no import path from any entry point (125 application, 12 tooling, 181 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 (~155 LoC) packages/frontend/src/components/landing/sections/DescriptionSection.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/sections/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~146 LoC) packages/frontend/src/lib/useSquircleBorder.ts— no import path from any entry point (125 application, 12 tooling, 181 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 (~131 LoC) packages/frontend/src/components/landing/hooks/useSquircleClip.ts— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 2 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/hooks/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~120 LoC) packages/frontend/src/components/TabBar.tsx— no import path from any entry point (125 application, 12 tooling, 181 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 (~105 LoC) packages/frontend/src/components/landing/components/SquircleBorder.tsx— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/components/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~86 LoC) packages/frontend/src/components/Switch.tsx— no import path from any entry point (125 application, 12 tooling, 181 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 (~62 LoC) packages/frontend/src/components/landing/LandingPage.tsx— no import path from any entry point (125 application, 12 tooling, 181 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 (~41 LoC) packages/frontend/src/lib/responsive.ts— no import path from any entry point (125 application, 12 tooling, 181 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 (~20 LoC) packages/frontend/src/lib/github.ts— no import path from any entry point (125 application, 12 tooling, 181 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 (~19 LoC) packages/frontend/src/lib/useMediaQuery.ts— no import path from any entry point (125 application, 12 tooling, 181 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 (~13 LoC) packages/frontend/src/components/landing/hooks/useCopy.ts— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/hooks/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~6 LoC) packages/frontend/src/components/landing/sections/index.ts— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (packages/frontend/src/components/landing/LandingPage.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~3 LoC) packages/frontend/src/components/landing/hooks/index.ts— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 3 in-repo import(s) from 3 other file(s) do name it (packages/frontend/src/components/landing/components/SquircleBorder.tsx, packages/frontend/src/components/landing/sections/QuickstartSection.tsx, packages/frontend/src/components/landing/sections/WorldwideSection.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Dead file (~1 LoC) packages/frontend/src/components/landing/components/index.ts— no import path from any entry point (125 application, 12 tooling, 181 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (packages/frontend/src/components/landing/sections/QuickstartSection.tsx, packages/frontend/src/components/landing/sections/WorldwideSection.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
Unused dependency '@resvg/resvg-js' — Declared in the root REDACTED 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 '@neondatabase/serverless' — Declared in REDACTED 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 '@radix-ui/react-tooltip' — Declared in REDACTED 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 '@tanstack/react-virtual' — Declared in REDACTED 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 'react-is' — Declared in REDACTED 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.
Silent fallback default on Err crates/tokscale-cli/src/auth.rs:147— `get_api_base_url` turns every `Err` into `"https://tokscale.ai".to_string()` — 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.
Silent fallback default on Err crates/tokscale-core/src/cc_mirror.rs:26— `discover_claude_project_roots` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1142— `discover_senpi_omo_children_roots` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1191— `senpi_project_cwds_from_session_dir` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1358— `discover_openclaw_agent_dbs` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1397— `discover_opencode_dbs` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1458— `discover_micode_dbs` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/scanner.rs:1611— `scan_crush_registry` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/amp.rs:297— `parse_amp_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/claudecode.rs:233— `parent_session_paths_for_cache_bounded` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/cline.rs:106— `read_cline_cli_manifest` turns every `Err` into `ClineCliManifest::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.
Silent fallback default on Err crates/tokscale-core/src/sessions/codebuff.rs:61— `parse_codebuff_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/copilot_desktop.rs:451— `read_events_metadata` turns every `Err` into `SessionStateMetadata::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.
Silent fallback default on Err crates/tokscale-core/src/sessions/droid.rs:352— `transcript_turns_bounded` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/droid.rs:745— `parse_droid_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/freebuff.rs:142— `parse_freebuff_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/grok.rs:495— `parse_grok_updates_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/grok.rs:699— `parse_grok_unified_log_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/hermes.rs:304— `hermes_log_paths` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/hindsight.rs:78— `parse_hindsight_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/jcode.rs:325— `parse_jcode_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/kiro.rs:199— `parse_kiro_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/kiro.rs:617— `parse_kiro_ide_session_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/kiro.rs:1113— `parse_kiro_global_storage_file` turns every `Err` into `Vec::new()` — 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.
Silent fallback default on Err crates/tokscale-core/src/sessions/magpie.rs:102— `attribute_client_responses` turns every `Err` into `0` — 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.
Duplicated predicate scripts/check-release-workflow-safety.py:65— `index == 0 or value[index - 1].isspace()` appears character-identically in 2 files — scripts/check-release-workflow-safety.py, scripts/check-workflow-toolchain-paths.py. 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 crates/tokscale-cli/src/tui/ui/daily.rs:221— `!is_narrow && !is_very_narrow && inner.width < full_layout_width` appears character-identically in 2 files — crates/tokscale-cli/src/tui/ui/daily.rs, crates/tokscale-cli/src/tui/ui/monthly.rs. 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 crates/tokscale-cli/src/antigravity.rs:1078— `c.is_ascii_alphanumeric() || c == '-' || c == '_' || c == '.'` appears character-identically in 2 files — crates/tokscale-cli/src/antigravity.rs, crates/tokscale-core/src/sessions/cursor.rs. 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 crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs:611— `first_ms <= 0 || last_ms <= 0 || last_ms < first_ms` appears character-identically in 2 files — crates/tokscale-cli/src/tui/ui/dialog/session_detail.rs, crates/tokscale-cli/src/tui/ui/sessions.rs. 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 crates/tokscale-core/src/sessions/devin.rs:753— `input == 0 && output == 0 && cache_read == 0 && cache_write == 0` appears character-identically in 2 files — crates/tokscale-core/src/sessions/devin.rs, crates/tokscale-core/src/sessions/kimi.rs. 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 crates/tokscale-cli/src/antigravity.rs:3405— `input == 0 && output == 0 && cache_read == 0 && cache_write == 0 && reasoning == 0` appears character-identically in 3 files — crates/tokscale-cli/src/antigravity.rs, crates/tokscale-core/src/sessions/antigravity.rs, crates/tokscale-core/src/sessions/antigravity_cli.rs. 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 crates/tokscale-cli/src/cursor.rs:1958— `response.status() == reqwest::StatusCode::UNAUTHORIZED || response.status() == reqwest::StatusCode::FORBIDDEN` appears character-identically in 2 files — crates/tokscale-cli/src/cursor.rs, crates/tokscale-cli/src/warp.rs. 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 crates/tokscale-cli/src/commands/report.rs:1017— `status == reqwest::StatusCode::UNAUTHORIZED || status == reqwest::StatusCode::FORBIDDEN` appears character-identically in 9 files — crates/tokscale-cli/src/commands/report.rs, crates/tokscale-cli/src/commands/usage/claude.rs, crates/tokscale-cli/src/commands/usage/codex.rs, crates/tokscale-cli/src/commands/usage/copilot.rs. 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:248— `window[0] == ".claude" && window[1] == "projects"` appears character-identically in 2 files — REDACTED, crates/tokscale-core/src/sessions/claudecode.rs. 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.
Orphaned file crates/tokscale-core/src/model_alias.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/frontend/src/lib/db/dailyBreakdownReported.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/frontend/scripts/gallery/build-gallery.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/frontend/scripts/gallery/gallery-app.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/frontend/scripts/migrate-core.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file packages/frontend/src/app/api/me/stats/route.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default in catch packages/frontend/src/app/u/[username]/page.tsx:52— `getProfileDevices` 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 packages/frontend/src/components/explore/ModelBenchmarks.tsx:366— `sourceHost` swallows every exception into `return "Source"` — 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 packages/frontend/src/lib/github.ts:17— `getStargazersCount` 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 packages/frontend/src/lib/timezone.ts:106— `getBrowserTimeZone` swallows every exception into `return "UTC"` — 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.
redundant comment packages/frontend/middleware.ts:19— "Get session cookie" repeats the code it sits on: 3 of its 3 words (get, session, cookie) are already in `const sessionToken = request.cookies.get("tt_session")?.value;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/frontend/src/app/api/auth/github/callback/route.ts:56— "Exchange code for access token" repeats the code it sits on: 4 of its 4 words (exchange, code, access, token) are already in `const accessToken = await exchangeCodeForToken(code);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment packages/frontend/src/app/api/auth/github/callback/route.ts:108— "Set session cookie" repeats the code it sits on: 3 of its 3 words (set, session, cookie) are already in `await setSessionCookie(sessionToken);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
X7 · Silent fallback defaults· Pending state with no failure state · ×2
Pending state with no failure state packages/frontend/src/components/TokenGraph3D.tsx:318— The view draws `Loading 3D view...` under `! obeliskLoaded`, but `obeliskLoaded` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state packages/frontend/src/components/layout/Navigation.tsx:559— The view draws `<LoadingSkeleton aria-hidden="true"/>` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
C4 · Data Retention· Partial data-retention evidence · ×1
Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: a scheduled purge / cleanup job (a scheduled task that deletes rows past their retention — diesel::delete(….filter(created_at.lt(cutoff))), purge_expired… / delete_old…), a documented retention period / data-expiry.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 47 significant file(s) lose their only recent owner: crates/tokscale-cli/src/commands/apple_fm.rs, packages/frontend/src/app/settings/SettingsClient.tsx, packages/frontend/src/components/profile/usageChartData.ts, crates/tokscale-cli/src/commands/codex_activity.rs, crates/tokscale-core/src/paths.rs, packages/frontend/src/components/layout/Navigation.tsx, packages/frontend/src/components/TokenGraph2D.tsx, packages/frontend/src/components/DataInput.tsx (+39 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (53 single-owned of 448 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 448 of the 578 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: scripts/9router_tokscale_bridge_gjc.py, packages/frontend/src/components/leaderboard/GroupManagement.tsx, crates/tokscale-cli/src/tui/keymap.rs, packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts, scripts/check-workflow-toolchain-paths.py, packages/frontend/src/app/api/groups/[slug]/members/route.ts.
No ADRs found packages/tokscale/package.json:7— 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 `packages/tokscale/package.json` makes this repository a deployable product (line 7).
D21 · Naming Consistency· `sessionID` spells `ID` where 98 names in the project spell it `Id` · ×1
`sessionID` spells `ID` where 98 names in the project spell it `Id` packages/benchmarks/generate.ts:152— 98 of 101 names in project tokscale-monorepo spell the token `Id` (98 of 101; unit: names in project tokscale-monorepo containing `Id`). Peers: generate.generateSessionId (packages/benchmarks/generate.ts:128); generate.generateMessageId (packages/benchmarks/generate.ts:132); GeminiSession.sessionId (packages/benchmarks/generate.ts:428); build-org-ids.countryIdOf (packages/frontend/scripts/capital/build-org-ids.ts:501); build-org-ids.isoOf(countryId) (packages/frontend/scripts/capital/build-org-ids.ts:504). Rename to `sessionId`. [rule N6]
D21 · Naming Consistency· `modelID` spells `ID` where 98 names in the project spell it `Id` · ×1
`modelID` spells `ID` where 98 names in the project spell it `Id` packages/benchmarks/generate.ts:154— 98 of 101 names in project tokscale-monorepo spell the token `Id` (98 of 101; unit: names in project tokscale-monorepo containing `Id`). Peers: generate.generateSessionId (packages/benchmarks/generate.ts:128); generate.generateMessageId (packages/benchmarks/generate.ts:132); GeminiSession.sessionId (packages/benchmarks/generate.ts:428); build-org-ids.countryIdOf (packages/frontend/scripts/capital/build-org-ids.ts:501); build-org-ids.isoOf(countryId) (packages/frontend/scripts/capital/build-org-ids.ts:504). Rename to `modelId`. [rule N6]
D21 · Naming Consistency· `providerID` spells `ID` where 98 names in the project spell it `Id` · ×1
`providerID` spells `ID` where 98 names in the project spell it `Id` packages/benchmarks/generate.ts:155— 98 of 101 names in project tokscale-monorepo spell the token `Id` (98 of 101; unit: names in project tokscale-monorepo containing `Id`). Peers: generate.generateSessionId (packages/benchmarks/generate.ts:128); generate.generateMessageId (packages/benchmarks/generate.ts:132); GeminiSession.sessionId (packages/benchmarks/generate.ts:428); build-org-ids.countryIdOf (packages/frontend/scripts/capital/build-org-ids.ts:501); build-org-ids.isoOf(countryId) (packages/frontend/scripts/capital/build-org-ids.ts:504). Rename to `providerId`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 5 project(s) overshoot their size bounds, lowering Project Cohesion to 2.0/10. The most over is `crates/tokscale-core` (164286 LoC, 250 module-visible types across 4 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.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 6 of 448 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 448 of the 578 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/tokscale-core/src/model_alias.rs, packages/frontend/src/lib/db/dailyBreakdownReported.ts, packages/frontend/scripts/gallery/build-gallery.ts, packages/frontend/scripts/gallery/gallery-app.ts, packages/frontend/scripts/migrate-core.ts, packages/frontend/src/app/api/me/stats/route.ts. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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 2/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/cli`, `packages/frontend`, `packages/tokscale`.
No dependency-update automation REDACTED:19— `REDACTED` 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`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'EmbedShowcase' · ×1
Unused export 'EmbedShowcase' packages/frontend/src/app/(main)/tracker/EmbedShowcase.tsx:33— Nothing imports this binding — it is safe to review for removal.
Unused export 'TUI_TOUR_MS' packages/frontend/src/app/(main)/tracker/TuiShowcase.tsx:53— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ProfileSkeleton' · ×1
Unused export 'ProfileSkeleton' packages/frontend/src/components/Skeleton.tsx:190— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'StatCardSkeleton' · ×1
Unused export 'StatCardSkeleton' packages/frontend/src/components/Skeleton.tsx:244— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'TableRowSkeleton' · ×1
Unused export 'TableRowSkeleton' packages/frontend/src/components/Skeleton.tsx:260— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'MAX_VISIBLE_USAGE_PROVIDERS' · ×1
Unused export 'MAX_VISIBLE_USAGE_PROVIDERS' packages/frontend/src/components/profile/usageChartData.ts:23— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'formatQuantityWords' · ×1
Unused export 'formatQuantityWords' packages/frontend/src/lib/capital/ledger/format.ts:86— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'EVENT_KIND_LABELS' · ×1
Unused export 'EVENT_KIND_LABELS' packages/frontend/src/lib/capital/ledger/labels.ts:99— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'RelationType' packages/frontend/src/lib/capital/ledger/schema.ts:381— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'OrgIds' packages/frontend/src/lib/capital/ledger/schema.ts:461— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'Participant' packages/frontend/src/lib/capital/ledger/schema.ts:466— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'Relation' packages/frontend/src/lib/capital/ledger/schema.ts:467— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'EventFile' packages/frontend/src/lib/capital/ledger/schema.ts:468— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/ledger/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 packages/frontend/src/lib/capital/ledger/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'roundUrl' packages/frontend/src/lib/capital/urls.ts:30— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/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 packages/frontend/src/lib/capital/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'dealUrl' packages/frontend/src/lib/capital/urls.ts:31— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/frontend/src/lib/capital/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 packages/frontend/src/lib/capital/index.ts in the same commit, or the barrel will import a name that no longer exists.
No security response headers detected packages/frontend/vercel.json:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
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 5/15 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.
Null assertions (`!`) override strict null checking — ~0.7 `!` null assertions per 1k TypeScript source lines — 54 assertion(s) across the 79998 source line(s) of the 344 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: packages/frontend/scripts/capital/build-org-ids.ts (10), packages/frontend/src/lib/capital/ledger/model.ts (7), packages/frontend/scripts/capital/verify-quotes.ts (4). 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.
Outdated: anyhow — `anyhow` is locked at 1.0.100 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: arboard — `arboard` is locked at 3.6.1 but 3.7.0 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arboard` and commit the updated REDACTED.
Outdated: chrono — `chrono` is locked at 0.4.43 but 0.4.45 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p chrono` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.5.57 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.5"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: crc32c — `crc32c` is locked at 0.6.8 but 0.6.9 is the current stable release on crates.io, and it already satisfies the `"0.6"` requirement declared in crates/tokscale-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32c` and commit the updated REDACTED.
Outdated: image — `image` is locked at 0.25.9 but 0.25.10 is the current stable release on crates.io, and it already satisfies the `"0.25"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p image` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.180 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: once_cell — `once_cell` is locked at 1.21.3 but 1.21.4 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/tokscale-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p once_cell` and commit the updated REDACTED.
Outdated: rayon — `rayon` is locked at 1.11.0 but 1.12.0 is the current stable release on crates.io, and it already satisfies the `"1.10"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rayon` and commit the updated REDACTED.
Outdated: rpassword — `rpassword` is locked at 7.4.0 but 7.5.5 is the current stable release on crates.io, and it already satisfies the `"7.0"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rpassword` and commit the updated REDACTED.
Outdated: serde — `serde` is locked at 1.0.228 but 1.0.229 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde` and commit the updated REDACTED.
Outdated: serde_json — `serde_json` is locked at 1.0.149 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated REDACTED.
Outdated: thiserror — `thiserror` is locked at 2.0.18 but 2.0.21 is the current stable release on crates.io, and it already satisfies the `"2"` requirement declared in crates/tokscale-core/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p thiserror` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.49.0 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: tracing-subscriber — `tracing-subscriber` is locked at 0.3.22 but 0.3.23 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tracing-subscriber` and commit the updated REDACTED.
Outdated: unicode-normalization — `unicode-normalization` is locked at 0.1.25 but 0.1.26 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-normalization` and commit the updated REDACTED.
Outdated: unicode-segmentation — `unicode-segmentation` is locked at 1.12.0 but 1.13.3 is the current stable release on crates.io, and it already satisfies the `"1.12"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-segmentation` and commit the updated REDACTED.
Outdated: unicode-width — `unicode-width` is locked at 0.2.0 but 0.2.3 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-width` and commit the updated REDACTED.
Outdated: uuid — `uuid` is locked at 1.20.0 but 1.29.2 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/tokscale-cli/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p uuid` and commit the updated REDACTED.
doc comments repeat the names packages/frontend/src/lib/auth/session.ts:91— 0 of 2 documented parameters and 1 of 1198 summaries in `@tokscale/frontend` only repeat the member or parameter name (e.g. "Set session cookie." for `setSessionCookie`). 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 6 file(s) — `packages/benchmarks/runner.ts`, `packages/frontend/scripts/capital/import-epoch.ts`, `packages/frontend/scripts/capital/lib/source-cache.ts`, `packages/frontend/src/components/profile/usageChartData.ts`, `packages/frontend/src/lib/capital/ledger/index.ts`, … (+1 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1db6e-bdad-7774-920f-cb1b7e500bbb · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 96 · Warnings: 1293 · Recommendations: 99 · Info: 20 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 19:00 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.