Public report of junhoyeo/tokscale, published 28 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 28 October 2026, 02:44 UTC · Survey ID cd_8b560ee7e8e84c0dbf21d3aaef617d97
junhoyeo/tokscale
Measured 28 October 2026, 02:41 UTC, at code version 39ecb83
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAt riskDown 1 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: 294,851 lines of product code in 14 projects, tests not counted · Estimated rebuild effort: about 2.1 person-years · Weakest lens: Security and Compliance, 33
Findings by how serious they are
96 critical1211 serious111 minor
11 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
28 October 2026, 02:41 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
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. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
87of 87 dimensions measured by tools.
1376of 1418 findings point to an exact file and line, so you can open each one in the code. The other 42 concern the repository as a whole, such as missing documentation.
87dimensions across 8 lenses, read from 294,851 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 two of the dependencies have a known vulnerability and we found no encryption of stored data, no key vault and no enforced HTTPS. 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 9 points. Fixing the password or key in the code comes next, worth about 4 points. Raising Security and Compliance to 70 would lift the score to about 56.
Sixty-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Twenty-three known security holes in the packages the code depends on can be used by attackers, and three 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 294,851 lines, about €310,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 56.
Code composition: what the lines of code are
Product code 85%Tests 15%
New since the last survey: 285 findings
These 285 critical or serious findings weren't in the previous survey, on 14 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::codex::parse_codex_reader_with_record_limit crates/tokscale-core/src/sessions/codex.rs
God Classes · FunctionTooLong: tokscale_core::sessions::claudecode::parse_claude_lines crates/tokscale-core/src/sessions/claudecode.rs
God Classes · FunctionTooLong: tokscale_core::sessions::dsh::parse_dsh_lines crates/tokscale-core/src/sessions/dsh.rs
God Classes · FunctionTooLong: tokscale_core::message_cache::read_shard_with_limit_unchecked crates/tokscale-core/src/message_cache.rs
God Classes · FunctionTooLong: tokscale_cli::cursor::fetch_cursor_usage_events_json_merging crates/tokscale-cli/src/cursor.rs
God Classes · FunctionTooLong: GroupManagement.GroupManagement packages/frontend/src/components/leaderboard/GroupManagement.tsx
God Classes · FunctionTooLong: tokscale_cli::antigravity::sync_antigravity_cache_impl_with_deadline crates/tokscale-cli/src/antigravity.rs
God Classes · MethodTooLong: App.new_with_cached_data_and_ambient_width crates/tokscale-cli/src/tui/app.rs
God Classes · TooManyFunctions: tokscale_cli::commands::usage::copilot crates/tokscale-cli/src/commands/usage/copilot.rs
God Classes · FileTooLong: usage/cursor.rs crates/tokscale-cli/src/commands/usage/cursor.rs
God Classes · FileTooLong: src/aggregator.rs crates/tokscale-core/src/aggregator.rs
God Classes · FunctionTooLong: tokscale_cli::tui::ui::usage::render_selected_account crates/tokscale-cli/src/tui/ui/usage.rs
God Classes · MethodTooLong: CustomPricing.load_from_str crates/tokscale-core/src/pricing/custom.rs
God Classes · FileTooLong: pricing/mod.rs crates/tokscale-core/src/pricing/mod.rs
God Classes · TooManyFields: CodexParseState crates/tokscale-core/src/sessions/codex.rs
God Classes · TooManyMethods: PricingService crates/tokscale-core/src/pricing/mod.rs
God Classes · TooManyFields: Glyphs crates/tokscale-cli/src/ui_glyphs.rs
God Classes · FunctionTooLong: tokscale_cli::amp::sync_amp_cache_with crates/tokscale-cli/src/amp.rs
God Classes · FunctionTooLong: tokscale_cli::to_ts_token_contribution_data crates/tokscale-cli/src/main.rs
God Classes · TooManyFields: LegacyCodexStateV19 crates/tokscale-core/src/message_cache.rs
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 214 findings
These 214 critical or serious findings were in the previous survey, on 14 October 2026, and are gone from this one. The first 100 are listed here.
€100,000 to €520,000, for 1,719 to 5,452 hours of work, about 2.1 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: 294,851 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: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
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 9 points · Medium effort · Data Protection
2
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 4 points · Low effort · Secret Scanning
3
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 €310,000 to build again, about 2.1 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 9 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.5 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 8% on every change. The history of the code shows how much it changes: about 242,413 lines over the last 90 days, which is about 983,119 lines a year. At that pace, the extra work comes to an estimated 92.7 to 556 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
385 modules, with 485 dependencies between them. 3 loops run through 31 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 345 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.app.(main).leaderboard uses packages.frontend.src.lib.leaderboard.types, so a change to packages.frontend.src.lib.leaderboard.types can break packages.frontend.src.app.(main).leaderboard, while a change to packages.frontend.src.app.(main).leaderboard can't break packages.frontend.src.lib.leaderboard.types.
Position
Below the diagonal: packages.frontend.src.app.(main).leaderboard 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.
14→22 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.
14→33 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.
14→36 tokscale_cli.tui.cache uses tokscale_corepart of a loop✕
Connections
3 pairs of types, where a type in tokscale_cli.tui.cache uses a type in tokscale_core.
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
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.
15→31 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.
15→33 tokscale_core.pricing uses tokscale_cli.tui.datapart of a loop✕
Connections
2 pairs of types, where a type in tokscale_core.pricing uses a type in tokscale_cli.tui.data.
tokscale_core.pricing uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core.pricing, while a change to tokscale_core.pricing 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.
15→36 tokscale_core.pricing uses tokscale_corepart of a loop✕
Connections
2 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.
17→33 tokscale_core.sessions.utils uses tokscale_cli.tui.datapart of a loop✕
Connections
2 pairs of types, where a type in tokscale_core.sessions.utils uses a type in tokscale_cli.tui.data.
tokscale_core.sessions.utils uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core.sessions.utils, while a change to tokscale_core.sessions.utils 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.
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.helpers uses packages.frontend.src.lib.types, so a change to packages.frontend.src.lib.types can break packages.frontend.src.lib.db.helpers, while a change to packages.frontend.src.lib.db.helpers can't break packages.frontend.src.lib.types.
Position
Below the diagonal: packages.frontend.src.lib.db.helpers 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.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.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.
23→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_core.sessions.opencode_schema uses tokscale_core.sessions.utils, so a change to tokscale_core.sessions.utils can break tokscale_core.sessions.opencode_schema, while a change to tokscale_core.sessions.opencode_schema can't break tokscale_core.sessions.utils.
Position
Below the diagonal: tokscale_core.sessions.opencode_schema uses a module listed above it, which is the healthy direction.
25→31 tokscale_core.sessions.opencode_schema uses tokscale_core.sessionspart of a loop✕
Connections
3 pairs of types, where a type in tokscale_core.sessions.opencode_schema uses a type in tokscale_core.sessions.
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
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.
25→36 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.
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.db uses packages.frontend.src.lib.db.helpers, so a change to packages.frontend.src.lib.db.helpers can break packages.frontend.src.lib.db, while a change to packages.frontend.src.lib.db can't break packages.frontend.src.lib.db.helpers.
Position
Below the diagonal: packages.frontend.src.lib.db 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.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.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.
28→31 tokscale_core.message_cache uses tokscale_core.sessionspart of a loop✕
Connections
7 pairs of types, where a type in tokscale_core.message_cache uses a type in tokscale_core.sessions.
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
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.message_cache uses tokscale_cli.tui.datapart of a loop✕
Connections
3 pairs of types, where a type in tokscale_core.message_cache uses a type in tokscale_cli.tui.data.
tokscale_core.message_cache uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core.message_cache, while a change to tokscale_core.message_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.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 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.
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
Below the diagonal: tokscale_core.sessions uses a module listed above it, which is the healthy direction.
31→33 tokscale_core.sessions uses tokscale_cli.tui.datapart of a loop✕
Connections
1 pair of types, where a type in tokscale_core.sessions uses a type in tokscale_cli.tui.data.
tokscale_core.sessions uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core.sessions, while a change to tokscale_core.sessions 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.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.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.
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.
32→33 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.
32→36 tokscale_cli.tui.app uses tokscale_corepart of a loop✕
Connections
3 pairs of types, where a type in tokscale_cli.tui.app uses a type in tokscale_core.
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
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_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_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_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.
33→36 tokscale_cli.tui.data uses tokscale_corepart of a loop✕
Connections
6 pairs of types, where a type in tokscale_cli.tui.data uses a type in tokscale_core.
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
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.ui.dialog.session_detail uses tokscale_cli.tui.themes, so a change to tokscale_cli.tui.themes can break tokscale_cli.tui.ui.dialog.session_detail, while a change to tokscale_cli.tui.ui.dialog.session_detail can't break tokscale_cli.tui.themes.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.session_detail uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.session_detail uses tokscale_cli.ui_glyphs, so a change to tokscale_cli.ui_glyphs can break tokscale_cli.tui.ui.dialog.session_detail, while a change to tokscale_cli.tui.ui.dialog.session_detail can't break tokscale_cli.ui_glyphs.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.session_detail uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.session_detail uses tokscale_cli.tui.i18n, so a change to tokscale_cli.tui.i18n can break tokscale_cli.tui.ui.dialog.session_detail, while a change to tokscale_cli.tui.ui.dialog.session_detail can't break tokscale_cli.tui.i18n.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.session_detail uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.session_detail uses tokscale_cli.tui.ui.dialog, so a change to tokscale_cli.tui.ui.dialog can break tokscale_cli.tui.ui.dialog.session_detail, while a change to tokscale_cli.tui.ui.dialog.session_detail can't break tokscale_cli.tui.ui.dialog.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.session_detail uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.session_detail uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_cli.tui.ui.dialog.session_detail, while a change to tokscale_cli.tui.ui.dialog.session_detail can't break tokscale_cli.tui.data.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.session_detail uses a module listed above it, which is the healthy direction.
tokscale_core.legacy_graph uses tokscale_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core.legacy_graph, while a change to tokscale_core.legacy_graph can't break tokscale_cli.tui.data.
Position
Below the diagonal: tokscale_core.legacy_graph uses a module listed above it, which is the healthy direction.
35→36 tokscale_core.legacy_graph uses tokscale_corepart of a loop✕
Connections
9 pairs of types, where a type in tokscale_core.legacy_graph uses a type in tokscale_core.
tokscale_core.legacy_graph uses tokscale_core, so a change to tokscale_core can break tokscale_core.legacy_graph, while a change to tokscale_core.legacy_graph 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.
35→37 tokscale_core.legacy_graph uses tokscale_cli.commands.reportpart of a loop✕
Connections
1 pair of types, where a type in tokscale_core.legacy_graph uses a type in tokscale_cli.commands.report.
tokscale_core.legacy_graph uses tokscale_cli.commands.report, so a change to tokscale_cli.commands.report can break tokscale_core.legacy_graph, while a change to tokscale_core.legacy_graph can't break tokscale_cli.commands.report.
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.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.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_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_cli.tui.data, so a change to tokscale_cli.tui.data can break tokscale_core, while a change to tokscale_core can't break tokscale_cli.tui.data.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
tokscale_core uses tokscale_core.legacy_graph, so a change to tokscale_core.legacy_graph can break tokscale_core, while a change to tokscale_core can't break tokscale_core.legacy_graph.
Position
Below the diagonal: tokscale_core uses a module listed above it, which is the healthy direction.
36→37 tokscale_core uses tokscale_cli.commands.reportpart of a loop✕
Connections
2 pairs of types, where a type in tokscale_core uses a type in tokscale_cli.commands.report.
tokscale_core uses tokscale_cli.commands.report, so a change to tokscale_cli.commands.report can break tokscale_core, while a change to tokscale_core can't break tokscale_cli.commands.report.
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.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 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.
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.ui.dialog.group_by_picker uses tokscale_cli.tui.themes, so a change to tokscale_cli.tui.themes can break tokscale_cli.tui.ui.dialog.group_by_picker, while a change to tokscale_cli.tui.ui.dialog.group_by_picker can't break tokscale_cli.tui.themes.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.group_by_picker uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.group_by_picker uses tokscale_cli.ui_glyphs, so a change to tokscale_cli.ui_glyphs can break tokscale_cli.tui.ui.dialog.group_by_picker, while a change to tokscale_cli.tui.ui.dialog.group_by_picker can't break tokscale_cli.ui_glyphs.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.group_by_picker uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.group_by_picker uses tokscale_cli.tui.i18n, so a change to tokscale_cli.tui.i18n can break tokscale_cli.tui.ui.dialog.group_by_picker, while a change to tokscale_cli.tui.ui.dialog.group_by_picker can't break tokscale_cli.tui.i18n.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.group_by_picker uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.group_by_picker uses tokscale_cli.tui.ui.dialog, so a change to tokscale_cli.tui.ui.dialog can break tokscale_cli.tui.ui.dialog.group_by_picker, while a change to tokscale_cli.tui.ui.dialog.group_by_picker can't break tokscale_cli.tui.ui.dialog.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.group_by_picker uses a module listed above it, which is the healthy direction.
tokscale_cli.tui.ui.dialog.group_by_picker uses tokscale_core, so a change to tokscale_core can break tokscale_cli.tui.ui.dialog.group_by_picker, while a change to tokscale_cli.tui.ui.dialog.group_by_picker can't break tokscale_core.
Position
Below the diagonal: tokscale_cli.tui.ui.dialog.group_by_picker 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.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 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.
At a glance — Code Health · 64% · 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
87
High / Critical
A03:2025 — Software Supply Chain Failures
69
High / Critical
A02:2025 — Security Misconfiguration
7
High / Critical
A07:2025 — Authentication Failures
1
High / Critical
Roadmap
Immediately encrypt sensitive data at rest and manage keys in a vault, while strictly enforcing TLS certificate validation to prevent insecure connections. Concurrently, resolve the leaked secret in REDACTED and remediate the twenty high-severity dependency vulnerabilities, prioritizing REDACTED and REDACTED. Finally, codify disaster recovery and backup procedures in infrastructure as code, ensuring clear RTO/RPO documentation and restore capabilities are established.
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 — 1211
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 — 111
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 11
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 87 of 87 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 87 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, 1376 of 1418 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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. Commit the lcov/Cobertura report it produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,163 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 26 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/benchmarks/runner.ts`, `packages/frontend/src/components/profile/usageChartData.ts` 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.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — app Pulling db Pulling db Error Get "https://registry-1.docker.io/v2/": Forbidden app Warning Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: app Pulling db Pulling app Warning Get "https://registry-1.docker.io/v2/": Forbidden db Error Get "https://registry-1.docker.io/v2/": Forbidden WARNING: Some service image(s) must be built from source by running: docker compose build app Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 51 further occurrence(s) are not listed individually; the score already reflects all 91.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 41 further occurrence(s) are not listed individually; the score already reflects all 81.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
154 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was tokscale_core::parse_all_messages_streaming at 169. 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 343 — 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 343), 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 27). 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.
+ 57 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cyclomatic Complexity — start with tokscale_core::parse_all_messages_streaming (cyclomatic 169), tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cyclomatic 155), route.POST (cyclomatic 155). — 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 3 together lifts Cyclomatic Complexity from 4.5 to about 5.0/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
268 method(s) exceeded the cognitive complexity threshold of 15; the worst was tokscale_core::sessions::codex::parse_codex_reader_with_record_limit at 397.
+ 70 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 120 down to 120 or less in Cognitive Complexity — start with tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cognitive 397), tokscale_core::scanner::scan_all_clients_with_env_strategy_inner (cognitive 320), tokscale_core::parse_all_messages_streaming (cognitive 288). — 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 8 together lifts Cognitive Complexity from 2.0 to about 2.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.3 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 104 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 (104 warning-level).
Resolve the 54 FileTooLong finding(s) in God Classes — start with mod.rs (4), cursor.rs (2), codex.rs (2). — One of this dimension's main actionable groups (54 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).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
250 duplicated block group(s) detected. A further 12 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 96 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 17 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with codex.rs (4), main.rs (2), lib.rs (2). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 17 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with antigravity.rs (3), import.rs, codex.rs. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 17 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with main.rs (3), mod.rs (2), hourly_profile.rs (2). — One of this dimension's main actionable groups (17 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
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 4 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).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
6166 test methods: 5742 unit, 424 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 1163 `it`/`test` case(s) across 103 test file(s) declaring at least one beside 5 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 4943 `#[test]` function(s) across 193 file(s) declaring at least one; its unit/integration split is Cargo's own — 23 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 55 test function(s) across 1 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.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 1163 tests. Measured on the JavaScript/TypeScript suite only — at least 26 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, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
18 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 · ×18
✓ 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.
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crates/tokscale-core/src/lib.rs (117×277=32409); crates/tokscale-core/src/scanner.rs (56×155=8680); crates/tokscale-core/src/message_cache.rs (103×53=5459) Repeated repair below the complexity floor: crates/tokscale-core/src/sessions/antigravity_cli.rs (12 of 15 changes were fixes); crates/tokscale-core/src/sessions/copilot_desktop.rs (12 of 15 changes were fixes); crates/tokscale-cli/src/commands/usage/claude.rs (10 of 12 changes were fixes)
Resolve the 63 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (3), REDACTED (2), lib.rs. — One of this dimension's main actionable groups (63 warning-level).
Resolve the 32 Repeated repair finding(s) in Churn × Complexity Hotspots — start with antigravity_cli.rs, copilot_desktop.rs, claude.rs. — One of this dimension's main actionable groups (32 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.2 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
57 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 320 of the 404 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 294851 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).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 16 document(s) read across 1 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
3 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).
87 finding(s): 0 critical, 68 high, 19 medium, 0 low. 62 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 13 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, …), … (+8 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
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 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 62 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 (62 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.
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (19), REDACTED. — One of this dimension's main actionable groups (20 issue-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 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.
4 of 320 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 320 of the 404 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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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 & labels6.3 / 10Adequate✓ 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.
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.
`select` 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/components/profile/ProfileUsageChart.tsx:497
`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:285
`span` moves (`transition: transform 150ms`) 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/BreakdownPanel.tsx:221
`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:163
`div` moves (`transition: transform 200ms`) 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/GraphControls.tsx:243
`div` moves (`animation: ________ 2s cubic-bezier(0.4, 0, 0.6, 1) 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. (×2) — packages/frontend/src/components/TokenGraph3D.tsx:25, packages/frontend/src/components/layout/Navigation.tsx:158
`.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:181
`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
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 68 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
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 the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
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 repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 13 of 15 project(s) that lack one — worth up to 1.7 pts.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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 model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability7.2 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 2/5 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.
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.
What to do
Codify backups + geo-recovery in IaC and document RTO/RPO and the restore procedure — a persistence guard alone is not disaster recovery.
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 the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
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.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
19 duplicated blocks under packages/frontend/src/ have copies in at least two of the sibling directories app, components, lib — 7 of them are reported below, and 12 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 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 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 19 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
16 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 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 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 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 16 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
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
packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:469 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:920 — the two spans are one implementation copied and then locally edited — 1177 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)/groups/[slug]/GroupDetailClient.tsx:469
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/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/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/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/TokenGraph2D.tsx:103 · packages/frontend/src/components/TokenGraph3D.tsx:225 — 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/components/TokenGraph2D.tsx:103
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
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/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:66 · 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:66
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/me/stats/route.ts:48 · packages/frontend/src/app/api/submit/route.ts:495 — 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/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/api/auth/token/route.ts:5 · packages/frontend/src/app/api/me/stats/route.ts:65 · packages/frontend/src/app/api/submit/route.ts:511 — 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:289 · packages/frontend/src/app/device/DeviceClient.tsx:321 — 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:289
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
packages/frontend/src/app/api/groups/[slug]/leave/route.ts:9 · packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:10 — 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/api/groups/[slug]/leave/route.ts:9
packages/frontend/src/app/settings/SettingsClient.tsx:1063 · packages/frontend/src/app/settings/SettingsClient.tsx:1123 — 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/settings/SettingsClient.tsx:1063
packages/frontend/src/components/landing/sections/FooterSection.tsx:11 · packages/frontend/src/components/layout/ServiceFooter.tsx:14 — 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/components/landing/sections/FooterSection.tsx:11
packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:42 · packages/frontend/src/lib/publicProfileDevices.ts:34 — 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/api/users/[username]/devices/[deviceId]/route.ts:42
packages/frontend/src/components/landing/hooks/useSquircleClip.ts:104 · packages/frontend/src/lib/useSquircleBorder.ts:103 — the two spans are one implementation copied and then locally edited — 118 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/landing/hooks/useSquircleClip.ts:104
packages/frontend/src/lib/db/antigravityStateCoverage.ts:28 · packages/frontend/src/lib/db/antigravityTransition.ts:44 — 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/lib/db/antigravityStateCoverage.ts:28
packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:93 · packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:129 — 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/embed/renderProfileBadgeSvg.ts:93
packages/frontend/src/lib/publicProfileData.ts:465 · packages/frontend/src/lib/publicProfileData.ts:528 — 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/lib/publicProfileData.ts:465
packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1512 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1512
packages/frontend/src/app/api/users/[username]/groups/route.ts:13 · packages/frontend/src/lib/publicProfileData.ts:103 — the two spans are one implementation copied and then locally edited — 97 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]/groups/route.ts:13
packages/frontend/src/lib/db/helpers.ts:437 · packages/frontend/src/lib/db/helpers.ts:473 — 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/db/helpers.ts:437
packages/frontend/src/app/api/groups/[slug]/invite/route.ts:16 · packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:18 — 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/api/groups/[slug]/invite/route.ts:16
packages/frontend/src/app/api/groups/[slug]/route.ts:86 · packages/frontend/src/app/api/groups/[slug]/route.ts:196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/frontend/src/app/api/groups/[slug]/route.ts:86
packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:152 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:142 · packages/frontend/src/lib/embed/renderTerminalEmbedSvg.ts:120 — 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/lib/embed/renderOrbitEmbedSvg.ts:152
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
(anonymous) has cyclomatic complexity 159 and cognitive complexity 272; 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:616
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
LeaderboardClient has cyclomatic complexity 53 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 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:958
planParserHighWaterSubmission has cyclomatic complexity 41 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/db/parserHighWater.ts:1348
validateSubmission has cyclomatic complexity 37 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/validation/submission.ts:377
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:577
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:915
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
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:503
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
POST has cyclomatic complexity 24 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 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:511
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
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
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:2126
applyRecountProofToCell has cyclomatic complexity 21 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/frontend/src/lib/db/parserHighWater.ts:717
TokenGraph3D has cyclomatic complexity 21 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 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/TokenGraph3D.tsx:135
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files5.7 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
packages/frontend/src/components/profile/ProfileContributionGraph.tsx has 2464 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 1740 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 1562 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 1376 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 1340 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/components/profile/ProfileEmbedDialog.tsx has 1142 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/src/app/settings/SettingsClient.tsx has 1130 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/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 849 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 840 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 835 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/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/components/layout/Navigation.tsx has 735 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/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/validation/submission.ts has 599 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/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/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/lib/moderation/heuristics.ts has 540 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/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/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/components/profile/ProfileOverview.tsx has 474 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
packages/frontend/src/lib/moderation/candidates.ts has 402 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
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 Coverage6.1 / 10Adequate✓ 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
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. (×39) — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1, packages/frontend/src/app/settings/SettingsClient.tsx:1, packages/frontend/src/components/landing/sections/HeroSection.tsx: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 package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but packages/frontend/__tests__/lib/clientRegistry.test.ts 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 Code8.6 / 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 72 application, 12 tooling and 105 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 (72 application, 12 tooling, 105 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 (×7) — packages/frontend/src/components/BlackholeHero.tsx, packages/frontend/scripts/seed-dev.ts, packages/frontend/src/lib/useSquircleBorder.ts, …
Nothing imports this binding — it is safe to review for removal. (×18) — packages/frontend/src/components/Skeleton.tsx:190, packages/frontend/src/components/Skeleton.tsx:244, packages/frontend/src/components/Skeleton.tsx:260, …
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 package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Declared in packages/frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×2)
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 any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 0/10 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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:534, packages/frontend/src/app/settings/SettingsClient.tsx:571
`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:689
`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:695
`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:732
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped7.8 / 10Strong✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`v` is text this program did not author, and it is written into a quoted attribute value through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/frontend/scripts/gallery/gallery-app.ts:48
`svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — packages/frontend/scripts/gallery/gallery-app.ts:68
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. — scripts/9router_tokscale_bridge_gjc.py:105
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×7) — packages/frontend/src/lib/useSettings.ts:85, packages/frontend/src/lib/seo/urls.ts:28, packages/frontend/src/components/profile/ProfileUsageChart.tsx:958, …
`.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — packages/frontend/scripts/gallery/gallery-app.ts:132
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.2 `!` null assertions per 1k TypeScript source lines — 9 assertion(s) across the 47338 source line(s) of the 209 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/src/app/api/submit/route.ts (2), packages/frontend/src/components/profile/ProfileContributionGraph.tsx (2), packages/frontend/src/lib/auth/github.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
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 — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 34 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 — 43 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
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 18 — an image could not be pulled) — app Pulling db Pulling db Error Get "https://registry-1.docker.io/v2/": Forbidden app Warning Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: app Pulling db Pulling app Warning Get "https://registry-1.docker.io/v2/": Forbidden db Error Get "https://registry-1.docker.io/v2/": Forbidden WARNING: Some service image(s) must be built from source by running: docker compose build app Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; 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.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, Swift, TypeScript not measured.
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+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, .ts, .tsx, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.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) — 2 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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
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): 19 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
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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
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 applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
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.
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
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.
FunctionTooLong: tokscale_core::parse_all_messages_streaming crates/tokscale-core/src/lib.rs:1694— FunctionTooLong — tokscale_core::parse_all_messages_streaming runs 2271 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 2171 over it, 22.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::parse_local_clients crates/tokscale-core/src/lib.rs:7158— FunctionTooLong — tokscale_core::parse_local_clients runs 1060 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 960 over it, 10.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: route.POST packages/frontend/src/app/api/submit/route.ts:511— FunctionTooLong — POST runs 834 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 734 over it, 8.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_models_report crates/tokscale-cli/src/main.rs:2374— 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:2085— FunctionTooLong — tokscale_core::scanner::scan_all_clients_with_env_strategy_inner runs 683 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 583 over it, 6.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_core::sessions::codex::parse_codex_reader_with_record_limit crates/tokscale-core/src/sessions/codex.rs:1072— FunctionTooLong — tokscale_core::sessions::codex::parse_codex_reader_with_record_limit runs 496 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 396 over it, 4.96× 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: LeaderboardClient.LeaderboardClient packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:958— FunctionTooLong — LeaderboardClient runs 493 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 393 over it, 4.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ProfileContributionGraph.ProfileContributionGraph packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2126— FunctionTooLong — ProfileContributionGraph runs 480 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 380 over it, 4.80× 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: ProfileEmbedDialog.ProfileEmbedDialog packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:47— FunctionTooLong — ProfileEmbedDialog runs 464 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 364 over it, 4.64× 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: ProfileUsageChart.ProfileUsageChart packages/frontend/src/components/profile/ProfileUsageChart.tsx:915— FunctionTooLong — ProfileUsageChart runs 446 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 346 over it, 4.46× 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: SettingsClient.SettingsClient packages/frontend/src/app/settings/SettingsClient.tsx:708— FunctionTooLong — SettingsClient runs 442 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 342 over it, 4.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::main crates/tokscale-cli/src/main.rs:694— 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: GroupDetailClient.GroupDetailClient packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:503— FunctionTooLong — GroupDetailClient runs 369 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 269 over it, 3.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tokscale_cli::run_clients_command crates/tokscale-cli/src/main.rs:4646— FunctionTooLong — tokscale_cli::run_clients_command runs 347 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 247 over it, 3.47× 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:771— FunctionTooLong — tokscale_core::sessions::claudecode::parse_claude_lines runs 344 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 244 over it, 3.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.
FunctionTooLong: candidates.getModerationCandidates packages/frontend/src/lib/moderation/candidates.ts:83— FunctionTooLong — getModerationCandidates runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.98× 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:3912— FunctionTooLong — tokscale_cli::run_pricing_lookup runs 287 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 187 over it, 2.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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:3280— 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: ProfilePageClient.ProfilePageClient packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:138— FunctionTooLong — ProfilePageClient runs 258 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ratchetCensus.getRatchetCensusReport packages/frontend/src/lib/reconciliation/ratchetCensus.ts:112— FunctionTooLong — getRatchetCensusReport runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.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::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::run_submit_command crates/tokscale-cli/src/main.rs:7136— FunctionTooLong — tokscale_cli::run_submit_command 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::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.
tokscale_core::sessions::codex::parse_codex_reader_with_record_limit (cognitive 397) crates/tokscale-core/src/sessions/codex.rs:1072— tokscale_core::sessions::codex::parse_codex_reader_with_record_limit has cognitive complexity 397 (threshold 15). Drivers by points: if/else 91 (354 pts), boolean chains 21, match/switch 5 (21 pts), loops 1 (nesting depth added 279). 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 320) crates/tokscale-core/src/scanner.rs:2085— tokscale_core::scanner::scan_all_clients_with_env_strategy_inner has cognitive complexity 320 (threshold 15). Drivers by points: if/else 122 (240 pts), loops 31 (65 pts), boolean chains 12, match/switch 2 (3 pts) (nesting depth added 153). Of this number, 316 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 288) crates/tokscale-core/src/lib.rs:1694— tokscale_core::parse_all_messages_streaming has cognitive complexity 288 (threshold 15). Drivers by points: if/else 171 (333 pts), loops 61 (78 pts), boolean chains 36, match/switch 12 (20 pts) (nesting depth added 187). To reduce it, split the body into named stages: move each independent 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 172) crates/tokscale-core/src/sessions/claudecode.rs:771— tokscale_core::sessions::claudecode::parse_claude_lines has cognitive complexity 172 (threshold 15). Drivers by points: if/else 40 (139 pts), match/switch 5 (19 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 116). 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 114) crates/tokscale-core/src/lib.rs:7158— tokscale_core::parse_local_clients has cognitive complexity 114 (threshold 15). Drivers by points: if/else 49 (77 pts), boolean chains 18, loops 14 (17 pts), match/switch 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 84) crates/tokscale-core/src/sessions/pi.rs:781— tokscale_core::sessions::pi::parse_pi_format_file_inner has cognitive complexity 84 (threshold 15). Drivers by points: if/else 38 (67 pts), boolean chains 12, match/switch 3 (5 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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::message_cache::read_shard_with_limit_unchecked (cognitive 77) crates/tokscale-core/src/message_cache.rs:4182— tokscale_core::message_cache::read_shard_with_limit_unchecked has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (36 pts), match/switch 15 (27 pts), boolean chains 7, loops 2 (7 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:1706— 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:849— tokscale_core::sessions::prime_agent::reconcile_prime_agent_messages has cognitive complexity 67 (threshold 15). Drivers by points: loops 18 (33 pts), if/else 12 (30 pts), match/switch 1 (3 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::prime_agent::min_cost_max_matching (cognitive 52) crates/tokscale-core/src/sessions/prime_agent.rs:632— 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:511— 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:31— 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:287— 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::parse_all_messages_streaming::load_or_parse_resumable_source (cognitive 43) crates/tokscale-core/src/lib.rs:1991— tokscale_core::parse_all_messages_streaming::load_or_parse_resumable_source has cognitive complexity 43 (threshold 15). Drivers by points: if/else 18 (33 pts), boolean chains 6, match/switch 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (tokscale_core::parse_all_messages_streaming, 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::gemini::parse_gemini_headless_jsonl (cognitive 42) crates/tokscale-core/src/sessions/gemini.rs:310— tokscale_core::sessions::gemini::parse_gemini_headless_jsonl has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
tokscale_core::content_extractor::extract_text_from_claude_message (cognitive 40) crates/tokscale-core/src/content_extractor.rs:338— tokscale_core::content_extractor::extract_text_from_claude_message has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (34 pts), loops 2 (6 pts) (nesting depth added 26). 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::run_models_report (cognitive 111) crates/tokscale-cli/src/main.rs:2374— 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 89) crates/tokscale-cli/src/main.rs:3912— tokscale_cli::run_pricing_lookup has cognitive complexity 89 (threshold 15). Drivers by points: if/else 40 (70 pts), match/switch 4 (8 pts), loops 2 (6 pts), boolean chains 5 (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_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:2032— 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 58) crates/tokscale-cli/src/main.rs:4646— tokscale_cli::run_clients_command has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (43 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:1476— 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:3592— 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 46) crates/tokscale-cli/src/main.rs:7136— tokscale_cli::run_submit_command has cognitive complexity 46 (threshold 15). Drivers by points: if/else 25 (38 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::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:1335— 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:7472— 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:7832— 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.
tokscale_cli::tui::ui::overview::render_top_models (cognitive 33) crates/tokscale-cli/src/tui/ui/overview.rs:235— tokscale_cli::tui::ui::overview::render_top_models has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (29 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Hotspot: crates/tokscale-core/src/lib.rs crates/tokscale-core/src/lib.rs:1694— crates/tokscale-core/src/lib.rs changed 117 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 277 in tokscale_core::parse_all_messages_streaming at line 1694. 71 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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:2085— crates/tokscale-core/src/scanner.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 155 in tokscale_core::scanner::scan_all_clients_with_env_strategy_inner at line 2085. 29 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-core/src/message_cache.rs crates/tokscale-core/src/message_cache.rs:4182— crates/tokscale-core/src/message_cache.rs changed 103 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in tokscale_core::message_cache::read_shard_with_limit_unchecked at line 4182. 73 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/message_cache.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/main.rs crates/tokscale-cli/src/main.rs:1247— crates/tokscale-cli/src/main.rs changed 81 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in ClientFilter::as_filter_str at line 1247. 40 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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:511— packages/frontend/src/app/api/submit/route.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 155 in route.POST at line 511. 17 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in DataLoader::aggregate_messages at line 801. 8 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/pricing/lookup.rs crates/tokscale-core/src/pricing/lookup.rs:895— crates/tokscale-core/src/pricing/lookup.rs changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in PricingLookup::lookup_auto at line 895. 38 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-core/src/sessions/codex.rs crates/tokscale-core/src/sessions/codex.rs:1072— crates/tokscale-core/src/sessions/codex.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in tokscale_core::sessions::codex::parse_codex_reader_with_record_limit at line 1072. 12 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: packages/frontend/src/lib/publicProfileData.ts packages/frontend/src/lib/publicProfileData.ts:107— packages/frontend/src/lib/publicProfileData.ts changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 158 in publicProfileData.getPublicProfileResponse at line 107. 5 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-core/src/sessions/claudecode.rs crates/tokscale-core/src/sessions/claudecode.rs:771— crates/tokscale-core/src/sessions/claudecode.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in tokscale_core::sessions::claudecode::parse_claude_lines at line 771. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/pi.rs crates/tokscale-core/src/sessions/pi.rs:781— crates/tokscale-core/src/sessions/pi.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in tokscale_core::sessions::pi::parse_pi_format_file_inner at line 781. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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:1348— packages/frontend/src/lib/db/parserHighWater.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in parserHighWater.planParserHighWaterSubmission at line 1348. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-cli/src/tui/app.rs crates/tokscale-cli/src/tui/app.rs:889— 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 889. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/clients.rs crates/tokscale-core/src/clients.rs:98— crates/tokscale-core/src/clients.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in PathRoot::resolve_with_env_strategy at line 98. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/clients.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:2032— crates/tokscale-cli/src/cursor.rs changed 18 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 2032. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-cli/src/tui/ui/widgets.rs crates/tokscale-cli/src/tui/ui/widgets.rs:849— crates/tokscale-cli/src/tui/ui/widgets.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in tokscale_cli::tui::ui::widgets::get_client_color at line 849. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/ui/widgets.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 16 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-core/src/sessions/opencode_schema.rs crates/tokscale-core/src/sessions/opencode_schema.rs:833— crates/tokscale-core/src/sessions/opencode_schema.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in SchemaAccumulator::ingest at line 833. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-core/src/pricing/mod.rs crates/tokscale-core/src/pricing/mod.rs:866— crates/tokscale-core/src/pricing/mod.rs changed 24 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-cli/src/commands/wrapped.rs crates/tokscale-cli/src/commands/wrapped.rs:154— crates/tokscale-cli/src/commands/wrapped.rs changed 17 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-cli/src/antigravity.rs crates/tokscale-cli/src/antigravity.rs:357— crates/tokscale-cli/src/antigravity.rs changed 19 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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 8 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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.
Hotspot: crates/tokscale-cli/src/tui/ui/usage.rs crates/tokscale-cli/src/tui/ui/usage.rs:1634— crates/tokscale-cli/src/tui/ui/usage.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in tokscale_cli::tui::ui::usage::render_selected_account at line 1634. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/ui/usage.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.
FileTooLong: src/main.rs crates/tokscale-cli/src/main.rs— FileTooLong — 5952 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 118 free functions. The bar is 500 significant lines; this is 5452 over it, 11.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: src/lib.rs crates/tokscale-core/src/lib.rs— FileTooLong — 5782 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 97 free functions. The bar is 500 significant lines; this is 5282 over it, 11.56× 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 — 2568 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 2068 over it, 5.14× 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/message_cache.rs crates/tokscale-core/src/message_cache.rs— FileTooLong — 2525 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 2025 over it, 5.05× 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 — 2318 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 114 free functions. The bar is 500 significant lines; this is 1818 over it, 4.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ui/usage.rs crates/tokscale-cli/src/tui/ui/usage.rs— FileTooLong — 2236 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 1736 over it, 4.47× 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: profile/ProfileContributionGraph.tsx packages/frontend/src/components/profile/ProfileContributionGraph.tsx— FileTooLong — 2171 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1671 over it, 4.34× 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 — 2054 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, 317-2957). The bar is 500 significant lines; this is 1554 over it, 4.11× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/cursor.rs crates/tokscale-cli/src/cursor.rs— FileTooLong — 1840 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 114 free functions. The bar is 500 significant lines; this is 1340 over it, 3.68× 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/scanner.rs crates/tokscale-core/src/scanner.rs— FileTooLong — 1784 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 1284 over it, 3.57× 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 — 1553 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 1053 over it, 3.11× 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 — 1534 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 1034 over it, 3.07× 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 — 1451 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 951 over it, 2.90× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: usage/codex.rs crates/tokscale-cli/src/commands/usage/codex.rs— FileTooLong — 1391 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 81 free functions. The bar is 500 significant lines; this is 891 over it, 2.78× 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 — 1343 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 46 free functions. The bar is 500 significant lines; this is 843 over it, 2.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: leaderboard/LeaderboardClient.tsx packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx— FileTooLong — 1245 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 745 over it, 2.49× 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: profile/ProfileUsageChart.tsx packages/frontend/src/components/profile/ProfileUsageChart.tsx— FileTooLong — 1189 significant lines (blank, comment-only and punctuation-only lines excluded). 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/kiro.rs crates/tokscale-core/src/sessions/kiro.rs— FileTooLong — 1170 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 670 over it, 2.34× 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: submit/route.ts packages/frontend/src/app/api/submit/route.ts— FileTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded), about 72% of them inside a single declaration: POST (511-1840). The bar is 500 significant lines; this is 654 over it, 2.31× 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: sessions/opencode_schema.rs crates/tokscale-core/src/sessions/opencode_schema.rs— FileTooLong — 1150 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 650 over it, 2.30× 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: profile/ProfileEmbedDialog.tsx packages/frontend/src/components/profile/ProfileEmbedDialog.tsx— FileTooLong — 1042 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 542 over it, 2.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: settings/SettingsClient.tsx packages/frontend/src/app/settings/SettingsClient.tsx— FileTooLong — 990 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 490 over it, 1.98× 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_core::parse_all_messages_streaming (cyclomatic 169) crates/tokscale-core/src/lib.rs:1694— tokscale_core::parse_all_messages_streaming has cyclomatic complexity 169 (threshold 15). To reduce it, separate the cases: extract each independent 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 155) crates/tokscale-core/src/scanner.rs:2085— tokscale_core::scanner::scan_all_clients_with_env_strategy_inner has cyclomatic complexity 155 (threshold 15). Of this number, 153 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 119) crates/tokscale-core/src/sessions/codex.rs:1072— tokscale_core::sessions::codex::parse_codex_reader_with_record_limit has cyclomatic complexity 119 (threshold 15). To reduce it, separate the cases: extract each independent 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 83) crates/tokscale-core/src/scanner.rs:511— tokscale_core::scanner::scan_directory has cyclomatic complexity 83 (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::parse_local_clients (cyclomatic 77) crates/tokscale-core/src/lib.rs:7158— tokscale_core::parse_local_clients has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::sessions::claudecode::parse_claude_lines (cyclomatic 56) crates/tokscale-core/src/sessions/claudecode.rs:771— tokscale_core::sessions::claudecode::parse_claude_lines has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
tokscale_core::message_cache::read_shard_with_limit_unchecked (cyclomatic 53) crates/tokscale-core/src/message_cache.rs:4182— tokscale_core::message_cache::read_shard_with_limit_unchecked has cyclomatic complexity 53 (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 49) crates/tokscale-core/src/sessions/pi.rs:781— tokscale_core::sessions::pi::parse_pi_format_file_inner has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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:1706— 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:849— 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:2334— 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::parse_all_messages_streaming::load_or_parse_resumable_source (cyclomatic 27) crates/tokscale-core/src/lib.rs:1991— 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::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::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::aggregate_model_usage_entries_with_rollup (cyclomatic 24) crates/tokscale-core/src/lib.rs:5495— tokscale_core::aggregate_model_usage_entries_with_rollup 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::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.
tokscale_core::provider_identity::inferred_provider_from_model_inner (cyclomatic 22) crates/tokscale-core/src/provider_identity.rs:268— tokscale_core::provider_identity::inferred_provider_from_model_inner 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_core::recovery::merge (cyclomatic 22) crates/tokscale-core/src/recovery.rs:362— tokscale_core::recovery::merge 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_core::sessions::opencode_schema::scan_opencode_schema_sqlite_with_session_clients (cyclomatic 22) crates/tokscale-core/src/sessions/opencode_schema.rs:1520— tokscale_core::sessions::opencode_schema::scan_opencode_schema_sqlite_with_session_clients 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::format_model_name (cyclomatic 57) crates/tokscale-cli/src/commands/wrapped.rs:1476— 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:694— 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 61) 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 46) crates/tokscale-cli/src/main.rs:3912— tokscale_cli::run_pricing_lookup has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 61) 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:2374— 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 61) 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 33) crates/tokscale-cli/src/main.rs:4646— tokscale_cli::run_clients_command 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 61) 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::run_submit_command (cyclomatic 31) crates/tokscale-cli/src/main.rs:7136— tokscale_cli::run_submit_command 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. This is NOT this file's highest cyclomatic complexity: ClientFilter::as_filter_str (cyclomatic 61) 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::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:2032— 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:6251— 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 61) 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:1634— 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.
+ 18 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×39
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/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 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/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/src/components/BreakdownPanel.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/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/GraphControls.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/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/components/DataInput.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/admin/moderation/ModerationClient.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/TokenGraph3D.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/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.
No test reaches this file scripts/generate-release-notes.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/app/(main)/groups/join/[token]/JoinGroupClient.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/seed-dev.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/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/components/StatsPanel.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/Tooltip.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/GraphContainer.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)/privacy/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.
Repeated repair: crates/tokscale-core/src/sessions/antigravity_cli.rs crates/tokscale-core/src/sessions/antigravity_cli.rs:176— crates/tokscale-core/src/sessions/antigravity_cli.rs changed 15 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is SessionModels::from_blobs at line 176), 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(claudecode): price Claude Code 1-hour cache writes at the 1-hour rate (#1374)”; “fix(antigravity-cli): date modern agy turns from steps table timestamps (#1184) (#1327)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/copilot_desktop.rs crates/tokscale-core/src/sessions/copilot_desktop.rs:148— crates/tokscale-core/src/sessions/copilot_desktop.rs changed 15 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is tokscale_core::sessions::copilot_desktop::shutdown_deltas at line 148), 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(copilot): cap cache residuals at input remainder”; “fix(copilot): bound sidecar-derived session usage”; “fix(copilot): retain shutdown model context”; “fix(copilot): conserve split session metrics”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/sessions/copilot_desktop.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 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 12 (its worst body is tokscale_cli::commands::usage::claude::usage_metrics at line 639), 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(usage): prefer fresher Claude Keychain login over stale credentials file (#1401)”; “fix(claude): persist usage cooldowns across invocations (#1314)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/utils.rs crates/tokscale-core/src/sessions/utils.rs:408— crates/tokscale-core/src/sessions/utils.rs changed 15 times in last 90 days and 9 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), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/aggregator.rs crates/tokscale-core/src/aggregator.rs:416— crates/tokscale-core/src/aggregator.rs changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is CostProvenanceAccumulator::add_provenance at line 416), 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): heal devin-cli duplicate counts from a parser recount proof (#1414)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/aggregator.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/sessionize.rs crates/tokscale-core/src/sessionize.rs:389— crates/tokscale-core/src/sessionize.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 12 (its worst body is tokscale_core::sessionize::compute_daily_active_time_with_timezone at line 389), 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(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)”; “fix(reports): preserve reasoning totals and client display metadata (#1091)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/sessionize.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/copilot.rs crates/tokscale-cli/src/commands/usage/copilot.rs:540— crates/tokscale-cli/src/commands/usage/copilot.rs changed 9 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 11 (its worst body is tokscale_cli::commands::usage::copilot::github_copilot_apps_json_probe at line 540), 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(copilot): normalize GitHub host aliases (#1455)”; “fix(copilot): resolve the gh host and key every credential source and the endpoint to it (#1438)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/usage/copilot.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/autosubmit.rs crates/tokscale-cli/src/commands/autosubmit.rs:192— crates/tokscale-cli/src/commands/autosubmit.rs changed 9 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_cli::commands::autosubmit::enable_with_scheduler_operations at line 192), 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(dsh): count the compaction summarize call, and close two hygiene gaps (#1162)”; “fix(cli): align month titles with bucket dates (#1096)”; “fix(sync): hold the antigravity and trae sync locks in the OS (#1030)”; “fix(cli): pin the timezone usage days are bucketed into (#1016)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/commands/autosubmit.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:268— crates/tokscale-core/src/pricing/aliases.rs changed 8 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 3 (its worst body is tokscale_core::pricing::aliases::resolve_alias at line 268), 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): 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)”; “fix(pricing): resolve provider-specific model aliases (#1186)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/tui/settings.rs crates/tokscale-cli/src/tui/settings.rs:686— crates/tokscale-cli/src/tui/settings.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 11 (its worst body is Settings::load_with_origin at line 686), 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(tui): follow terminal light background via COLORFGBG (#1520)”; “fix(cli): correct usage accounting, long-context pricing and sync settings (#1431)”; “fix(tui): preserve a symlinked settings.json when saving”; “fix(tui): preserve external settings edits when saving preferences (#1322)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/tui/settings.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/antigravity.rs crates/tokscale-cli/src/commands/usage/antigravity.rs:448— crates/tokscale-cli/src/commands/usage/antigravity.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is tokscale_cli::commands::usage::antigravity::race_for_quota_with at line 448), 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(http): trust webpki roots alongside native certs so SSL_CERT_FILE overrides stay additive (#1344)”; “fix(antigravity-cli): read logged ports from the head of per-session logs (#1339)”; “fix(antigravity): stop dropping a language server slower than 400ms (#1280)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/fx.rs crates/tokscale-core/src/sessions/fx.rs:263— crates/tokscale-core/src/sessions/fx.rs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is tokscale_core::sessions::fx::parse_fx_file at line 263), 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(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)”; “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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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:667— crates/tokscale-core/src/sessions/cursor.rs changed 9 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 13 (its worst body is tokscale_core::sessions::cursor::try_parse_cursor_csv_file at line 667), 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): 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)”; “fix(cursor): sync incrementally with isolated account caches (#1430)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: packages/frontend/src/lib/db/helpers.ts packages/frontend/src/lib/db/helpers.ts:425— packages/frontend/src/lib/db/helpers.ts 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 13 (its worst body is helpers.addClientCostFloor at line 425), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/senpi.rs crates/tokscale-core/src/sessions/senpi.rs:25— crates/tokscale-core/src/sessions/senpi.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is tokscale_core::sessions::senpi::parse_senpi_file at line 25), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/trae.rs crates/tokscale-cli/src/trae.rs:1247— crates/tokscale-cli/src/trae.rs changed 6 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is tokscale_cli::trae::sync::sync_variant at line 1247), 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(auth): replace credential files with private atomic writes (#1507)”; “ci(rustdoc): gate cargo doc and fix broken intra-doc links (#1307)”; “fix(cursor): use native TLS for Cursor API client (#1250) (#1252)”; “fix(sync): hold the antigravity and trae sync locks in the OS (#1030)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-cli/src/trae.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 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is getLeaderboard.resultQuery at line 165), 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)”; “fix(groups): sum only the filtered client's tokens on group period boards (#991)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/commands/usage/zai.rs crates/tokscale-cli/src/commands/usage/zai.rs:184— crates/tokscale-cli/src/commands/usage/zai.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is tokscale_cli::commands::usage::zai::build_metrics at line 184), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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-cli/src/commands/usage/codex.rs crates/tokscale-cli/src/commands/usage/codex.rs:917— crates/tokscale-cli/src/commands/usage/codex.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 14 (its worst body is tokscale_cli::commands::usage::codex::save_account_from_auth_at_path at line 917), 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)”; “fix(usage): stop tokscale from rewriting Codex's auth.json (#1017)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-core/src/pricing/openrouter.rs crates/tokscale-core/src/pricing/openrouter.rs:105— crates/tokscale-core/src/pricing/openrouter.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 13 (its worst body is tokscale_core::pricing::openrouter::get_author_provider_name at line 105), 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(pricing): prefer the standard service tier among an author's OpenRouter endpoints (#1336)”; “fix(pricing): stop pricing fetches from writing the cache when the caller opted out”; “fix(pricing): keep published cache rates so submit stops rejecting Codex usage (#1028)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/pricing/openrouter.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 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is tokscale_cli::commands::usage::amp::fetch at line 341), 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)”; “ci(test): run the suite on windows-latest (advisory) and fix the $HOME redirect (#1012)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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: crates/tokscale-core/src/sessions/roocode.rs crates/tokscale-core/src/sessions/roocode.rs:62— crates/tokscale-core/src/sessions/roocode.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is tokscale_core::sessions::roocode::parse_roo_kilo_file at line 62), 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/opencode_go.rs crates/tokscale-cli/src/commands/usage/opencode_go.rs:230— crates/tokscale-cli/src/commands/usage/opencode_go.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 6 (its worst body is tokscale_cli::commands::usage::opencode_go::fetch_blocking_with_cap at line 230), 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(cursor): use native TLS for Cursor API client (#1250) (#1252)”; “fix(cursor): key sessions by conversationId from usage-events JSON (#1247)”; “fix(usage): bound the OpenCode Go response body instead of buffering it whole”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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/tui_signal.rs crates/tokscale-core/src/tui_signal.rs:34— crates/tokscale-core/src/tui_signal.rs changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is tokscale_core::tui_signal::transition_tui_active at line 34), 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(dsh): stream large transcripts without caching partial reads (#1535)”; “fix(cli): correct usage accounting, long-context pricing and sync settings (#1431)”; “fix(codex): warn when active rollouts lack usage records (#1415)”; “fix(cache): defer TUI warnings until terminal restore (#1065)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09:00' --full-history --no-merges -- crates/tokscale-core/src/tui_signal.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 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 11 (its worst body is tokscale_cli::commands::usage::grok::fetch_network_usage at line 599), 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(cursor): use native TLS for Cursor API client (#1250) (#1252)”; “ci(test): run the suite on windows-latest (advisory) and fix the $HOME redirect (#1012)”. 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-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 02:33:55 +09:00' --until='2026-10-27 02:33:55 +09: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.
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:577-587 — 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.
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.
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.
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:1255-1265 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/commands/usage/codex.rs:1425— crates/tokscale-cli/src/commands/usage/codex.rs:1425-1435 | crates/tokscale-cli/src/commands/usage/codex.rs:1855-1865 — both copies are in the same file, so extract the 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:1996— crates/tokscale-cli/src/commands/usage/codex.rs:1996-2006 | crates/tokscale-cli/src/cursor.rs:3023-3033 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) crates/tokscale-cli/src/main.rs:3713— crates/tokscale-cli/src/main.rs:3713-3723 | crates/tokscale-cli/src/main.rs:3763-3773 — both copies are in the same file, so extract the 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/data/mod.rs:1806— crates/tokscale-cli/src/tui/data/mod.rs:1806-1816 | crates/tokscale-cli/src/tui/data/mod.rs:1838-1848 — both copies are in the same file, so extract the 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/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.
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.
Duplicated block (11 lines × 2) crates/tokscale-core/src/lib.rs:3196— crates/tokscale-core/src/lib.rs:3196-3206 | crates/tokscale-core/src/lib.rs:4911-4921 — both copies are in the same file, so extract the 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:3499— crates/tokscale-core/src/lib.rs:3499-3509 | crates/tokscale-core/src/lib.rs:3513-3523 — both copies are in the same file, so extract the 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:1066— crates/tokscale-core/src/pricing/lookup.rs:1066-1076 | crates/tokscale-core/src/pricing/lookup.rs:1109-1119 — both copies are in the same file, so extract the 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:1957— crates/tokscale-core/src/pricing/lookup.rs:1957-1967 | 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.
Duplicated block (11 lines × 2) crates/tokscale-core/src/scanner.rs:1394— crates/tokscale-core/src/scanner.rs:1394-1404 | crates/tokscale-core/src/scanner.rs:1493-1503 — both copies are in the same file, so extract the 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/main.rs:5000— crates/tokscale-cli/src/main.rs:5000-5010 | crates/tokscale-cli/src/main.rs:5012-5022 — both copies are in the same file, so extract the 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/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 6 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.
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 6 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.
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/usage/codex.rs:1386— crates/tokscale-cli/src/commands/usage/codex.rs:1386-1394 | crates/tokscale-cli/src/commands/usage/codex.rs:1818-1825 — both copies are in the same file, so extract the 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:1621— crates/tokscale-cli/src/cursor.rs:1621-1628 | 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.
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.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/tui/ui/monthly.rs:223— crates/tokscale-cli/src/tui/ui/monthly.rs:223-230 | crates/tokscale-cli/src/tui/ui/monthly.rs:436-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 (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.
Duplicated block (8 lines × 2) crates/tokscale-core/src/lib.rs:8599— crates/tokscale-core/src/lib.rs:8599-8606 | crates/tokscale-core/src/lib.rs:8727-8734 — both copies are in the same file, so extract the 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/fx.rs:304— crates/tokscale-core/src/sessions/fx.rs:304-311 | crates/tokscale-core/src/sessions/fx.rs:366-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/tokscale-core/src/sessions/antigravity_cli.rs:874— crates/tokscale-core/src/sessions/antigravity_cli.rs:874-881 | 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:200-207 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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.
Duplicated block (8 lines × 2) crates/tokscale-cli/src/main.rs:5021— crates/tokscale-cli/src/main.rs:5021-5028 | crates/tokscale-cli/src/main.rs:5034-5041 — both copies are in the same file, so extract the 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/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 6 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.
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.
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:1931-1937 — 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-cli/src/commands/usage/cursor.rs:628— crates/tokscale-cli/src/commands/usage/cursor.rs:628-634 | crates/tokscale-cli/src/commands/usage/cursor.rs:647-653 — both copies are in the same file, so extract the 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/main.rs:2634— crates/tokscale-cli/src/main.rs:2634-2641 | crates/tokscale-cli/src/main.rs:2890-2896 — both copies are in the same file, so extract the 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/main.rs:3394— crates/tokscale-cli/src/main.rs:3394-3400 | crates/tokscale-cli/src/main.rs:3711-3717 — both copies are in the same file, so extract the 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/app.rs:2832— crates/tokscale-cli/src/tui/app.rs:2832-2838 | crates/tokscale-cli/src/tui/app.rs:2840-2846 — both copies are in the same file, so extract the 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/data/mod.rs:941— crates/tokscale-cli/src/tui/data/mod.rs:941-947 | crates/tokscale-core/src/lib.rs:5521-5527 — 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-cli/src/tui/ui/daily.rs:486— crates/tokscale-cli/src/tui/ui/daily.rs:486-492 | crates/tokscale-cli/src/tui/ui/models.rs:281-287 — 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 11 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 (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.
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.
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.
Duplicated block (7 lines × 2) crates/tokscale-core/src/lib.rs:7688— crates/tokscale-core/src/lib.rs:7688-7694 | crates/tokscale-core/src/lib.rs:8039-8045 — both copies are in the same file, so extract the 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-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.
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:316-324 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (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:272-278 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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-cli/src/main.rs:5782— crates/tokscale-cli/src/main.rs:5782-5792 | crates/tokscale-cli/src/main.rs:5795-5801 — both copies are in the same file, so extract the 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-core/src/wiki.rs:161— crates/tokscale-core/src/wiki.rs:161-167 | crates/tokscale-core/src/wiki.rs:177-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/antigravity.rs:860— crates/tokscale-cli/src/antigravity.rs:860-864 | crates/tokscale-cli/src/trae.rs:1213-1217 — before extracting anything, compare `crates/tokscale-cli/src/antigravity.rs` and `crates/tokscale-cli/src/trae.rs` as WHOLE FILES: this scan already matched 6 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.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/antigravity.rs:3442— crates/tokscale-cli/src/antigravity.rs:3442-3446 | crates/tokscale-core/src/sessions/antigravity.rs:121-125 — 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/antigravity.rs:3447— crates/tokscale-cli/src/antigravity.rs:3447-3451 | crates/tokscale-core/src/sessions/antigravity.rs:126-130 — 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/report.rs:101— crates/tokscale-cli/src/commands/report.rs:101-105 | crates/tokscale-cli/src/commands/report.rs:108-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.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/main.rs:2684— crates/tokscale-cli/src/main.rs:2684-2688 | crates/tokscale-cli/src/main.rs:3051-3055 — both copies are in the same file, so extract the 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:2998— crates/tokscale-cli/src/main.rs:2998-3004 | crates/tokscale-cli/src/main.rs:3519-3523 — both copies are in the same file, so extract the 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/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 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/tui/ui/usage.rs:2344— crates/tokscale-cli/src/tui/ui/usage.rs:2344-2348 | crates/tokscale-cli/src/tui/ui/usage.rs:2388-2392 — both copies are in the same file, so extract the 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/aggregator.rs:661— crates/tokscale-core/src/aggregator.rs:661-665 | crates/tokscale-core/src/aggregator.rs:851-855 — both copies are in the same file, so extract the 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/recovery.rs:428— crates/tokscale-core/src/recovery.rs:428-432 | crates/tokscale-core/src/recovery.rs:437-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/tokscale-core/src/sessions/antigravity_cli.rs:857— crates/tokscale-core/src/sessions/antigravity_cli.rs:857-861 | crates/tokscale-core/src/sessions/grok.rs:1756-1761 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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/codebuff.rs:273— crates/tokscale-core/src/sessions/codebuff.rs:273-277 | crates/tokscale-core/src/sessions/codebuff.rs:315-322 — both copies are in the same file, so extract the 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/claudecode.rs:1458— crates/tokscale-core/src/sessions/claudecode.rs:1458-1462 | crates/tokscale-core/src/sessions/codex.rs:2178-2182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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:5946— crates/tokscale-cli/src/main.rs:5946-5950 | 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.
Duplicated block (5 lines × 2) crates/tokscale-cli/src/antigravity.rs:865— crates/tokscale-cli/src/antigravity.rs:865-870 | crates/tokscale-cli/src/trae.rs:1218-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 6 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.
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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×16
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:258-266 — 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/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.
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.
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 12 separate duplicated blocks between them, totalling at least 130 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-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.
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.
Duplicated block (9 lines × 2) crates/tokscale-core/src/lib.rs:3974— crates/tokscale-core/src/lib.rs:3974-3982 | crates/tokscale-core/src/lib.rs:7656-7664 — both copies are in the same file, so extract the 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/lib.rs:7523— crates/tokscale-core/src/lib.rs:7523-7531 | crates/tokscale-core/src/lib.rs:7543-7551 — both copies are in the same file, so extract the 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/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.
Duplicated block (9 lines × 2) crates/tokscale-core/src/scanner.rs:221— crates/tokscale-core/src/scanner.rs:221-229 | crates/tokscale-core/src/scanner.rs:244-252 — both copies are in the same file, so extract the 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.
Duplicated block (9 lines × 2) crates/tokscale-core/src/sessions/copilot_vscode.rs:220— crates/tokscale-core/src/sessions/copilot_vscode.rs:220-228 | crates/tokscale-core/src/sessions/copilot_vscode.rs:246-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.
Duplicated block (9 lines × 2) crates/tokscale-core/src/sessions/prime_agent.rs:658— crates/tokscale-core/src/sessions/prime_agent.rs:658-666 | crates/tokscale-core/src/sessions/prime_agent.rs:776-784 — both copies are in the same file, so extract the 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) 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.
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.
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 10 separate duplicated blocks between them, totalling at least 138 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/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 21 separate duplicated blocks between them, totalling at least 287 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/daily.rs:367— crates/tokscale-cli/src/tui/ui/daily.rs:367-378 | crates/tokscale-cli/src/tui/ui/minutely.rs:305-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 15 separate duplicated blocks between them, totalling at least 188 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:2320— crates/tokscale-cli/src/tui/ui/usage.rs:2320-2331 | crates/tokscale-cli/src/tui/ui/usage.rs:2366-2377 — both copies are in the same file, so extract the 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.
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.
Duplicated block (12 lines × 2) crates/tokscale-core/src/lib.rs:3704— crates/tokscale-core/src/lib.rs:3704-3715 | crates/tokscale-core/src/lib.rs:5015-5026 — both copies are in the same file, so extract the 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/lib.rs:3865— crates/tokscale-core/src/lib.rs:3865-3876 | crates/tokscale-core/src/lib.rs:7583-7594 — both copies are in the same file, so extract the 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/scanner.rs:2771— crates/tokscale-core/src/scanner.rs:2771-2782 | crates/tokscale-core/src/scanner.rs:2789-2800 — both copies are in the same file, so extract the 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/commands/usage/opencode_go.rs:195— crates/tokscale-cli/src/commands/usage/opencode_go.rs:195-206 | crates/tokscale-cli/src/cursor.rs:2307-2318 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) 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.
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.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/main.rs:2609— crates/tokscale-cli/src/main.rs:2609-2614 | crates/tokscale-cli/src/main.rs:2860-2865 — both copies are in the same file, so extract the 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-cli/src/tui/app.rs:2818— crates/tokscale-cli/src/tui/app.rs:2818-2823 | crates/tokscale-cli/src/tui/app.rs:2825-2830 — both copies are in the same file, so extract the 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-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.
Duplicated block (6 lines × 2) crates/tokscale-cli/src/tui/ui/usage.rs:2333— crates/tokscale-cli/src/tui/ui/usage.rs:2333-2339 | crates/tokscale-cli/src/tui/ui/usage.rs:2379-2384 — both copies are in the same file, so extract the 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/lib.rs:3127— crates/tokscale-core/src/lib.rs:3127-3132 | crates/tokscale-core/src/lib.rs:7175-7180 — both copies are in the same file, so extract the 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/lib.rs:7115— crates/tokscale-core/src/lib.rs:7115-7120 | crates/tokscale-core/src/lib.rs:7165-7170 — both copies are in the same file, so extract the 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/sessions/commandcode.rs:586— crates/tokscale-core/src/sessions/commandcode.rs:586-591 | crates/tokscale-core/src/sessions/zcode.rs:582-587 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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-core/src/sessions/gjc.rs:99— crates/tokscale-core/src/sessions/gjc.rs:99-104 | crates/tokscale-core/src/sessions/pi.rs:797-802 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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-core/src/wiki.rs:168— crates/tokscale-core/src/wiki.rs:168-173 | crates/tokscale-core/src/wiki.rs:184-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.
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.
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.
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 6 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×11
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.
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.
Duplicated block (10 lines × 2) crates/tokscale-cli/src/main.rs:2750— crates/tokscale-cli/src/main.rs:2750-2759 | crates/tokscale-cli/src/main.rs:2952-2961 — both copies are in the same file, so extract the 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-cli/src/tui/app.rs:2369— crates/tokscale-cli/src/tui/app.rs:2369-2378 | crates/tokscale-cli/src/tui/app.rs:2383-2392 — both copies are in the same file, so extract the 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-cli/src/tui/ui/agents.rs:92— crates/tokscale-cli/src/tui/ui/agents.rs:92-101 | crates/tokscale-cli/src/tui/ui/daily.rs:480-489 — 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 135 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 × 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 21 separate duplicated blocks between them, totalling at least 287 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 × 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.
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/aggregator.rs:670— crates/tokscale-core/src/aggregator.rs:670-679 | crates/tokscale-core/src/aggregator.rs:860-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.
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.
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.
MethodTooLong: DataLoader.aggregate_messages crates/tokscale-cli/src/tui/data/mod.rs:801— MethodTooLong — aggregate_messages runs 743 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 643 over it, 7.43× 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:895— 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:833— MethodTooLong — ingest runs 185 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 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: App.handle_key_event crates/tokscale-cli/src/tui/app.rs:889— MethodTooLong — handle_key_event runs 153 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 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: App.new_with_cached_data_and_ambient_width crates/tokscale-cli/src/tui/app.rs:441— MethodTooLong — new_with_cached_data_and_ambient_width runs 136 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 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SourceMessageCache.save_if_dirty_with_limit crates/tokscale-core/src/message_cache.rs:3876— 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.
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.
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.
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 12 separate duplicated blocks between them, totalling at least 130 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 (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.
Duplicated block (13 lines × 2) crates/tokscale-cli/src/tui/ui/stats.rs:877— crates/tokscale-cli/src/tui/ui/stats.rs:877-889 | crates/tokscale-cli/src/tui/ui/widgets.rs:542-554 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) crates/tokscale-core/src/content_extractor.rs:341— crates/tokscale-core/src/content_extractor.rs:341-353 | crates/tokscale-core/src/content_extractor.rs:364-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.
Duplicated block (13 lines × 2) crates/tokscale-core/src/lib.rs:3771— crates/tokscale-core/src/lib.rs:3771-3783 | crates/tokscale-core/src/lib.rs:3802-3814 — both copies are in the same file, so extract the 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/lib.rs:4567— crates/tokscale-core/src/lib.rs:4567-4579 | crates/tokscale-core/src/lib.rs:4590-4602 — both copies are in the same file, so extract the 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/message_cache.rs:3014— crates/tokscale-core/src/message_cache.rs:3014-3026 | crates/tokscale-core/src/message_cache.rs:3065-3077 — both copies are in the same file, so extract the 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/pricing/lookup.rs:1041— crates/tokscale-core/src/pricing/lookup.rs:1041-1053 | crates/tokscale-core/src/pricing/lookup.rs:1096-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:534— `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:571— `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:689— `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:695— `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:732— `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 })`.
ClassTooLong: App crates/tokscale-cli/src/tui/app.rs:317— ClassTooLong — 1783 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 110 methods, 2 blocks, lines 317-2957. The bar is 400 significant lines; this is 1383 over it, 4.46× 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:124— 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 124-2132. 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 — 858 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-1775. The bar is 400 significant lines; this is 458 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.
ClassTooLong: LeaderboardClient packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1— ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 93 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProfileContributionGraph packages/frontend/src/components/profile/ProfileContributionGraph.tsx:1— ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 41 methods. The bar is 400 significant lines; this is 80 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProfileEmbedDialog packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:1— ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 64 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ProfileUsageChart packages/frontend/src/components/profile/ProfileUsageChart.tsx:1— ClassTooLong — 446 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 46 over it, 1.12× 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: SettingsClient packages/frontend/src/app/settings/SettingsClient.tsx:1— ClassTooLong — 442 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 42 over it, 1.11× 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.
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 (44 of the 70 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 44 shared commits counted here, the most recent 3 are `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539); `55c19d88` feat(vibe): add client support for Mistral Vibe (#1424); `91e9225c` feat(clients): add native Aside browser usage support (#1416) — 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 (22 of the 37 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 22 shared commits counted here, the most recent 3 are `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539); `55c19d88` feat(vibe): add client support for Mistral Vibe (#1424); `91e9225c` feat(clients): add native Aside browser usage support (#1416) — 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 58% of the time (28 of the 48 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: 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 57% of the time (8 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 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 8 shared commits counted here, the most recent 3 are `82e20b0e` fix(copilot): merge duplicate OTEL snapshots across files (#1434); `7ffa5df7` feat(pi): show session titles and roll subagents into parents (#1382); `8d090448` fix(clients): Codex tier source, Antigravity ledger reconciliation, i… — 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 57% of the time (34 of the 60 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 34 shared commits counted here, the most recent 3 are `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539); `55c19d88` feat(vibe): add client support for Mistral Vibe (#1424); `91e9225c` feat(clients): add native Aside browser usage support (#1416) — 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.
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 55% of the time (33 of the 60 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 33 shared commits counted here, the most recent 3 are `a6de490f` feat(proma): account for native and mirrored Agent session usage (#1539); `55c19d88` feat(vibe): add client support for Mistral Vibe (#1424); `91e9225c` feat(clients): add native Aside browser usage support (#1416) — run `git show` on any of them.
Swallowed exception (empty catch) packages/frontend/src/lib/useSettings.ts:85— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/src/lib/seo/urls.ts:28— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/src/components/profile/ProfileUsageChart.tsx:958— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/src/app/api/submit/route.ts:1808— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/src/app/api/settings/account/route.ts:57— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/src/app/api/settings/account/route.ts:73— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) packages/frontend/scripts/gallery/gallery-app.ts:132— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) packages/cli/src/index.ts:97— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×7
Animation without a prefers-reduced-motion guard packages/frontend/src/components/BreakdownPanel.tsx:221— `span` moves (`transition: transform 150ms`) 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/DataInput.tsx:163— `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/GraphControls.tsx:243— `div` moves (`transition: transform 200ms`) 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/TokenGraph3D.tsx:25— `div` moves (`animation: ________ 2s cubic-bezier(0.4, 0, 0.6, 1) 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:181— `.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/layout/Navigation.tsx:158— `div` moves (`animation: ________ 2s cubic-bezier(0.4, 0, 0.6, 1) 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.
TooManyFields: App crates/tokscale-cli/src/tui/app.rs:317— TooManyFields — 69 stored fields beside 110 methods. The bar is 30 stored fields; this is 39 over it, 2.30× 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:300— 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 crates/tokscale-core/src/message_cache.rs:1271— 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 crates/tokscale-core/src/message_cache.rs:1129— 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.
PricingLookup::lookup_auto (cognitive 83) crates/tokscale-core/src/pricing/lookup.rs:895— 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:693— 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:425— 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:2055— 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:1373— 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.
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.
Duplicated block (14 lines × 2) crates/tokscale-core/src/lib.rs:2321— crates/tokscale-core/src/lib.rs:2321-2334 | crates/tokscale-core/src/lib.rs:2626-2639 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/tokscale-core/src/lib.rs:4683— crates/tokscale-core/src/lib.rs:4683-4697 | crates/tokscale-core/src/lib.rs:4848-4861 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) 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.
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:292-305 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
App::on_tick (cognitive 33) crates/tokscale-cli/src/tui/app.rs:704— 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:889— 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:802— 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:441— 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×4
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.
Duplicated block (10 lines × 3) crates/tokscale-cli/src/main.rs:4546— crates/tokscale-cli/src/main.rs:4546-4557 | crates/tokscale-cli/src/tui/data/mod.rs:504-515 | crates/tokscale-core/src/lib.rs:5654-5663 — 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 (10 lines × 3) crates/tokscale-cli/src/main.rs:5150— crates/tokscale-cli/src/main.rs:5150-5159 | crates/tokscale-core/src/message_cache.rs:2414-2423 | crates/tokscale-core/src/message_cache.rs:2427-2436 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (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 12 separate duplicated blocks between them, totalling at least 130 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 11 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 × 3) crates/tokscale-core/src/message_cache.rs:2726— crates/tokscale-core/src/message_cache.rs:2726-2734 | crates/tokscale-core/src/message_cache.rs:3012-3020 | crates/tokscale-core/src/message_cache.rs:3063-3071 — 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 (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 | crates/tokscale-core/src/message_cache.rs:2388-2396 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (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.
Duplicated block (8 lines × 3) crates/tokscale-cli/src/tui/ui/agents.rs:94— crates/tokscale-cli/src/tui/ui/agents.rs:94-101 | crates/tokscale-cli/src/tui/ui/daily.rs:482-489 | crates/tokscale-cli/src/tui/ui/sessions.rs:623-630 — 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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) 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.
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:638-645 | crates/tokscale-cli/src/cursor.rs:2773-2780 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) crates/tokscale-cli/src/main.rs:4997— crates/tokscale-cli/src/main.rs:4997-5004 | crates/tokscale-cli/src/main.rs:5009-5016 | crates/tokscale-cli/src/main.rs:5056-5063 — 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 (15 lines × 2 locations) packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:42— packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:42 · packages/frontend/src/lib/publicProfileDevices.ts:34 — 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 (15 lines × 2 locations) packages/frontend/src/lib/db/antigravityStateCoverage.ts:28— packages/frontend/src/lib/db/antigravityStateCoverage.ts:28 · packages/frontend/src/lib/db/antigravityTransition.ts:44 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (15 lines × 2 locations) packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:93— packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:93 · packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:129 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) packages/frontend/src/lib/publicProfileData.ts:465— packages/frontend/src/lib/publicProfileData.ts:465 · packages/frontend/src/lib/publicProfileData.ts:528 — 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.
PricingLookup::lookup_auto (cyclomatic 58) crates/tokscale-core/src/pricing/lookup.rs:895— 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:693— 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:2055— 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.
TooManyMethods: App crates/tokscale-cli/src/tui/app.rs:317— TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PricingLookup crates/tokscale-core/src/pricing/lookup.rs:124— 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.
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:2693— crates/tokscale-cli/src/main.rs:2693-2709 | crates/tokscale-cli/src/main.rs:3064-3081 — both copies are in the same file, so extract the 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:3375— crates/tokscale-cli/src/main.rs:3375-3391 | crates/tokscale-cli/src/main.rs:3689-3706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 3) crates/tokscale-cli/src/main.rs:2575— crates/tokscale-cli/src/main.rs:2575-2588 | crates/tokscale-cli/src/main.rs:3376-3389 | crates/tokscale-cli/src/main.rs:3690-3703 — 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 10 separate duplicated blocks between them, totalling at least 138 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) crates/tokscale-core/src/message_cache.rs:2561— crates/tokscale-core/src/message_cache.rs:2561-2574 | crates/tokscale-core/src/message_cache.rs:2593-2606 | crates/tokscale-core/src/message_cache.rs:2649-2662 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/tokscale-cli/src/tui/ui/footer.rs:12— crates/tokscale-cli/src/tui/ui/footer.rs:12-17 | crates/tokscale-cli/src/tui/ui/mod.rs:79-84 | crates/tokscale-cli/src/tui/ui/mod.rs:112-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.
Duplicated block (6 lines × 3) crates/tokscale-core/src/pricing/lookup.rs:1593— crates/tokscale-core/src/pricing/lookup.rs:1593-1598 | crates/tokscale-core/src/pricing/lookup.rs:1609-1614 | crates/tokscale-core/src/pricing/lookup.rs:1823-1828 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) 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:558-563 | crates/tokscale-core/src/sessions/pi.rs:442-447 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 3) 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) crates/tokscale-core/src/scanner.rs:1660— crates/tokscale-core/src/scanner.rs:1660-1664 | crates/tokscale-core/src/scanner.rs:1681-1685 | crates/tokscale-core/src/scanner.rs:1978-1982 — 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 (5 lines × 3) crates/tokscale-core/src/message_cache.rs:694— crates/tokscale-core/src/message_cache.rs:694-698 | crates/tokscale-core/src/message_cache.rs:713-717 | crates/tokscale-core/src/message_cache.rs:763-767 — 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 (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:66— packages/frontend/src/lib/db/antigravityTransition.ts:66 · 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 (17 lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/leave/route.ts:9— packages/frontend/src/app/api/groups/[slug]/leave/route.ts:9 · packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:10 — 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 (17 lines × 2 locations) packages/frontend/src/app/settings/SettingsClient.tsx:1063— packages/frontend/src/app/settings/SettingsClient.tsx:1063 · packages/frontend/src/app/settings/SettingsClient.tsx:1123 — 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 (17 lines × 2 locations) packages/frontend/src/components/landing/sections/FooterSection.tsx:11— packages/frontend/src/components/landing/sections/FooterSection.tsx:11 · packages/frontend/src/components/layout/ServiceFooter.tsx:14 — 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×2
Focus outline removed in CSS without a :focus replacement packages/frontend/src/components/profile/ProfileUsageChart.tsx:497— `select` 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.
Focus outline removed in CSS without a :focus replacement packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:285— `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.
App::handle_key_event (cyclomatic 59) crates/tokscale-cli/src/tui/app.rs:889— 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:704— 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) crates/tokscale-core/src/message_cache.rs:3876— 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 42) 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) crates/tokscale-core/src/message_cache.rs:3555— 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 42) 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) crates/tokscale-core/src/message_cache.rs:3876— 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) crates/tokscale-core/src/message_cache.rs:3555— 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· 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:1013-1101 | crates/tokscale-cli/src/tui/ui/usage.rs:2295-2355 — 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:635-647 | crates/tokscale-cli/src/cursor.rs:2771-2798 | 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:5688— crates/tokscale-core/src/lib.rs:5688-5747 | crates/tokscale-core/src/lib.rs:5810-5846 | crates/tokscale-core/src/lib.rs:5939-5982 | crates/tokscale-core/src/lib.rs:6006-6077 | crates/tokscale-core/src/lib.rs:6496-6527 — 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:1313-1336 | crates/tokscale-core/src/scanner.rs:1352-1379 | crates/tokscale-core/src/scanner.rs:1413-1437 — 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) crates/tokscale-core/src/message_cache.rs:2466— crates/tokscale-core/src/message_cache.rs:2466-2494 | crates/tokscale-core/src/message_cache.rs:2556-2584 | crates/tokscale-core/src/message_cache.rs:2588-2610 | crates/tokscale-core/src/message_cache.rs:2644-2672 — 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.
Duplicated block (24 lines × 2) crates/tokscale-cli/src/main.rs:3432— crates/tokscale-cli/src/main.rs:3432-3455 | crates/tokscale-cli/src/main.rs:3520-3543 — both copies are in the same file, so extract the 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 (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.
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:589-610 — 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.
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 (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.
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.
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.
Duplicated block (18 lines × 2) crates/tokscale-core/src/lib.rs:3737— crates/tokscale-core/src/lib.rs:3737-3754 | crates/tokscale-core/src/lib.rs:4619-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.
Duplicated block (17 lines × 2) crates/tokscale-cli/src/main.rs:2874— crates/tokscale-cli/src/main.rs:2874-2890 | crates/tokscale-cli/src/main.rs:3154-3170 — both copies are in the same file, so extract the 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-core/src/message_cache.rs:3580— crates/tokscale-core/src/message_cache.rs:3580-3596 | crates/tokscale-core/src/message_cache.rs:3903-3919 — both copies are in the same file, so extract the 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 × 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.
Duplicated block (15 lines × 3) crates/tokscale-core/src/message_cache.rs:2480— crates/tokscale-core/src/message_cache.rs:2480-2494 | crates/tokscale-core/src/message_cache.rs:2570-2584 | crates/tokscale-core/src/message_cache.rs:2658-2672 — 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 (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-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.
Duplicated block (14–15 lines × 2) crates/tokscale-core/src/lib.rs:2905— crates/tokscale-core/src/lib.rs:2905-2918 | crates/tokscale-core/src/lib.rs:2984-2998 — both copies are in the same file, so extract the 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:5158— crates/tokscale-core/src/lib.rs:5158-5172 | crates/tokscale-core/src/lib.rs:8710-8723 — both copies are in the same file, so extract the 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 × 4) crates/tokscale-cli/src/tui/app.rs:2533— crates/tokscale-cli/src/tui/app.rs:2533-2544 | crates/tokscale-cli/src/tui/app.rs:2569-2580 | crates/tokscale-cli/src/tui/app.rs:2654-2665 | crates/tokscale-cli/src/tui/app.rs:2739-2750 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) crates/tokscale-core/src/message_cache.rs:2467— crates/tokscale-core/src/message_cache.rs:2467-2478 | crates/tokscale-core/src/message_cache.rs:2557-2568 | crates/tokscale-core/src/message_cache.rs:2589-2600 | crates/tokscale-core/src/message_cache.rs:2645-2656 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 2) REDACTED:243— REDACTED:243-253 | crates/tokscale-core/src/sessions/claudecode.rs:1355-1366 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — 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:42— crates/tokscale-core/src/sessions/codebuff.rs:42-53 | crates/tokscale-core/src/sessions/freebuff.rs:120-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) crates/tokscale-cli/src/main.rs:2814— crates/tokscale-cli/src/main.rs:2814-2823 | crates/tokscale-cli/src/main.rs:3033-3043 — both copies are in the same file, so extract the 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–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.
Duplicated block (8–10 lines × 2) crates/tokscale-cli/src/commands/usage/cursor.rs:88— crates/tokscale-cli/src/commands/usage/cursor.rs:88-97 | crates/tokscale-cli/src/commands/usage/cursor.rs:151-158 — both copies are in the same file, so extract the 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–10 lines × 2) crates/tokscale-core/src/aggregator.rs:760— crates/tokscale-core/src/aggregator.rs:760-769 | crates/tokscale-core/src/aggregator.rs:813-820 — both copies are in the same file, so extract the 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–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.
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.
Duplicated block (7–8 lines × 2) crates/tokscale-cli/src/main.rs:3459— crates/tokscale-cli/src/main.rs:3459-3465 | crates/tokscale-cli/src/main.rs:3559-3566 — both copies are in the same file, so extract the 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–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.
Duplicated block (7 lines × 6) crates/tokscale-cli/src/tui/ui/daily.rs:199— crates/tokscale-cli/src/tui/ui/daily.rs:199-205 | crates/tokscale-cli/src/tui/ui/hourly.rs:155-161 | crates/tokscale-cli/src/tui/ui/minutely.rs:143-149 | crates/tokscale-cli/src/tui/ui/monthly.rs:216-222 | crates/tokscale-cli/src/tui/ui/monthly.rs:429-435 | crates/tokscale-cli/src/tui/ui/projects.rs:337-343 — 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 12 separate duplicated blocks between them, totalling at least 150 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 (7 lines × 6) crates/tokscale-core/src/lib.rs:2406— crates/tokscale-core/src/lib.rs:2406-2415 | crates/tokscale-core/src/lib.rs:3731-3741 | crates/tokscale-core/src/lib.rs:4062-4072 | crates/tokscale-core/src/lib.rs:4159-4169 | crates/tokscale-core/src/lib.rs:4613-4623 | crates/tokscale-core/src/lib.rs:4905-4911 — 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 (18 lines × 2 locations) packages/frontend/src/app/device/DeviceClient.tsx:289— packages/frontend/src/app/device/DeviceClient.tsx:289 · packages/frontend/src/app/device/DeviceClient.tsx:321 — 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.
Duplicated block (14 lines × 2 locations) packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1512— packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1512 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) packages/frontend/src/lib/db/helpers.ts:437— packages/frontend/src/lib/db/helpers.ts:437 · packages/frontend/src/lib/db/helpers.ts:473 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (13 lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/invite/route.ts:16— packages/frontend/src/app/api/groups/[slug]/invite/route.ts:16 · packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:18 — 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 (13 lines × 2 locations) packages/frontend/src/app/api/groups/[slug]/route.ts:86— packages/frontend/src/app/api/groups/[slug]/route.ts:86 · packages/frontend/src/app/api/groups/[slug]/route.ts:196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×2
Untrusted text written into markup unescaped packages/frontend/scripts/gallery/gallery-app.ts:48— `v` is text this program did not author, and it is written into a quoted attribute value through markup built here with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped packages/frontend/scripts/gallery/gallery-app.ts:68— `svg` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
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>.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 68 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
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.
route.POST (cyclomatic 155) packages/frontend/src/app/api/submit/route.ts:511— route.POST has cyclomatic complexity 155 (threshold 15). Of this number, 24 points are the body's own statements and 131 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
publicProfileData.getPublicProfileResponse (cyclomatic 111) packages/frontend/src/lib/publicProfileData.ts:107— publicProfileData.getPublicProfileResponse has cyclomatic complexity 111 (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 shape REPEATS in the file: one other method here (publicProfileData.getPublicProfileResponse::mergeClientModel) 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.
LeaderboardClient.LeaderboardClient (cyclomatic 95) packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:958— LeaderboardClient.LeaderboardClient has cyclomatic complexity 95 (threshold 15). Of this number, 55 points are the body's own statements and 40 belong to 16 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProfileContributionGraph.ProfileContributionGraph (cyclomatic 86) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2126— ProfileContributionGraph.ProfileContributionGraph has cyclomatic complexity 86 (threshold 15). Of this number, 17 points are the body's own statements and 69 belong to 19 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.
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.
GroupDetailClient.GroupDetailClient (cyclomatic 70) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:503— GroupDetailClient.GroupDetailClient has cyclomatic complexity 70 (threshold 15). Of this number, 29 points are the body's own statements and 41 belong to 15 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProfileUsageChart.ProfileUsageChart (cyclomatic 52) packages/frontend/src/components/profile/ProfileUsageChart.tsx:915— ProfileUsageChart.ProfileUsageChart has cyclomatic complexity 52 (threshold 15). Of this number, 29 points are the body's own statements and 23 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GroupManagement.GroupManagement (cyclomatic 50) packages/frontend/src/components/leaderboard/GroupManagement.tsx:195— GroupManagement.GroupManagement has cyclomatic complexity 50 (threshold 15). Of this number, 20 points are the body's own statements and 30 belong to 11 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SettingsClient.SettingsClient (cyclomatic 45) packages/frontend/src/app/settings/SettingsClient.tsx:708— SettingsClient.SettingsClient has cyclomatic complexity 45 (threshold 15). Of this number, 16 points are the body's own statements and 29 belong to 10 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check-release-workflow-safety.main (cyclomatic 43) scripts/check-release-workflow-safety.py:408— check-release-workflow-safety.main has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
parserHighWater.planParserHighWaterSubmission (cyclomatic 42) packages/frontend/src/lib/db/parserHighWater.ts:1348— parserHighWater.planParserHighWaterSubmission has cyclomatic complexity 42 (threshold 15). Of this number, 40 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TokenGraph3D.TokenGraph3D (cyclomatic 41) packages/frontend/src/components/TokenGraph3D.tsx:135— TokenGraph3D.TokenGraph3D has cyclomatic complexity 41 (threshold 15). Of this number, 21 points are the body's own statements and 20 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
submission.validateSubmission (cyclomatic 39) packages/frontend/src/lib/validation/submission.ts:377— submission.validateSubmission has cyclomatic complexity 39 (threshold 15). Of this number, 37 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SchemaAccumulator::ingest (cyclomatic 36) crates/tokscale-core/src/sessions/opencode_schema.rs:833— SchemaAccumulator::ingest has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GroupsBrowser.GroupsBrowser (cyclomatic 35) packages/frontend/src/app/(main)/leaderboard/GroupsBrowser.tsx:243— GroupsBrowser.GroupsBrowser has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 9 function items inside it that branch (handleTabChange, a function literal at line 273, a function literal at line 305, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProfileContributionGraph.createContributionCalendar (cyclomatic 35) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:577— ProfileContributionGraph.createContributionCalendar has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
route.PATCH (cyclomatic 33) packages/frontend/src/app/api/groups/[slug]/route.ts:83— route.PATCH 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.
ProfilePageClient.ProfilePageClient (cyclomatic 27) packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:138— ProfilePageClient.ProfilePageClient has cyclomatic complexity 27 (threshold 15). Of this number, 19 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TokenGraph2D.TokenGraph2D (cyclomatic 27) packages/frontend/src/components/TokenGraph2D.tsx:28— TokenGraph2D.TokenGraph2D has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 42, a function literal at line 106, getCSSVar, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ProfileEmbedDialog.ProfileEmbedDialog (cyclomatic 27) packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:47— ProfileEmbedDialog.ProfileEmbedDialog has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 90, setCompactForView, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
parserHighWater.allocateIncrements (cyclomatic 27) packages/frontend/src/lib/db/parserHighWater.ts:1044— parserHighWater.allocateIncrements has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
renderProfileEmbedSvg.renderProfileCardSvg (cyclomatic 26) packages/frontend/src/lib/embed/renderProfileEmbedSvg.ts:41— renderProfileEmbedSvg.renderProfileCardSvg has cyclomatic complexity 26 (threshold 15). Of this number, 22 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, 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.
route.GET (cyclomatic 25) REDACTED:117— route.GET 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.
route.PATCH (cyclomatic 24) packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:17— route.PATCH has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
route.POST (cyclomatic 22) packages/frontend/src/app/api/groups/[slug]/invite/route.ts:71— route.POST has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
submission.normalizeLegacySources (cyclomatic 22) packages/frontend/src/lib/validation/submission.ts:167— submission.normalizeLegacySources has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
route.POST (cyclomatic 21) packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:12— route.POST has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
index.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.
GraphControls.GraphControls (cyclomatic 20) packages/frontend/src/components/GraphControls.tsx:250— GraphControls.GraphControls has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
parserHighWater.applyRecountProofToCell (cyclomatic 20) packages/frontend/src/lib/db/parserHighWater.ts:717— parserHighWater.applyRecountProofToCell has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
renderIsometric3DSvg.renderIsometric3DEmbedSvg (cyclomatic 20) packages/frontend/src/lib/embed/renderIsometric3DSvg.ts:127— renderIsometric3DSvg.renderIsometric3DEmbedSvg has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
renderOrbitEmbedSvg.renderOrbitEmbedSvg (cyclomatic 19) packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:40— renderOrbitEmbedSvg.renderOrbitEmbedSvg 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.
publicProfileData.getPublicProfileResponse::mergeClientModel (cyclomatic 19) packages/frontend/src/lib/publicProfileData.ts:366— publicProfileData.getPublicProfileResponse::mergeClientModel has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (publicProfileData.getPublicProfileResponse) 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.
9router_tokscale_bridge_gjc.convert_usage_history_row (cyclomatic 18) scripts/9router_tokscale_bridge_gjc.py:245— 9router_tokscale_bridge_gjc.convert_usage_history_row has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ModerationClient.ModerationClient (cyclomatic 18) packages/frontend/src/app/admin/moderation/ModerationClient.tsx:57— ModerationClient.ModerationClient has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (applyAction, a function literal at line 152, a function literal at line 63). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
usageChartData.fillMissingUsageDays (cyclomatic 18) packages/frontend/src/components/profile/usageChartData.ts:412— usageChartData.fillMissingUsageDays has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
antigravityTransition.planAntigravityTransition (cyclomatic 18) packages/frontend/src/lib/db/antigravityTransition.ts:85— antigravityTransition.planAntigravityTransition has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
micodeTransition.planMiCodeTransition (cyclomatic 18) packages/frontend/src/lib/db/micodeTransition.ts:71— micodeTransition.planMiCodeTransition has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
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.
getUserEmbedStats.fetchUserEmbedStats (cyclomatic 17) packages/frontend/src/lib/embed/getUserEmbedStats.ts:51— getUserEmbedStats.fetchUserEmbedStats has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
renderBlueprintEmbedSvg.renderBlueprintEmbedSvg (cyclomatic 17) packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:41— renderBlueprintEmbedSvg.renderBlueprintEmbedSvg has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
migrate-core.runMigrations (cyclomatic 17) packages/frontend/scripts/migrate-core.ts:19— migrate-core.runMigrations has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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.
ProfileOverview.ProfileOverview (cyclomatic 17) packages/frontend/src/components/profile/ProfileOverview.tsx:356— ProfileOverview.ProfileOverview has cyclomatic complexity 17 (threshold 15). Of this number, 15 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.
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:420— 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.
JoinGroupClient.JoinGroupClient (cyclomatic 16) packages/frontend/src/app/(main)/groups/join/[token]/JoinGroupClient.tsx:126— JoinGroupClient.JoinGroupClient has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
page.LeaderboardWithPreferences (cyclomatic 16) packages/frontend/src/app/(main)/leaderboard/page.tsx:116— page.LeaderboardWithPreferences has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, 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.
route.normalizeSubmissionData (cyclomatic 16) packages/frontend/src/app/api/submit/route.ts:365— route.normalizeSubmissionData 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.
SettingsClient.DangerConfirmationModal (cyclomatic 16) packages/frontend/src/app/settings/SettingsClient.tsx:578— SettingsClient.DangerConfirmationModal has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
embedDialogOptions.buildProfileEmbedLinks (cyclomatic 16) packages/frontend/src/components/profile/embedDialogOptions.ts:84— embedDialogOptions.buildProfileEmbedLinks 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.
returnTo.sanitizeAuthReturnTo (cyclomatic 16) packages/frontend/src/lib/auth/returnTo.ts:8— returnTo.sanitizeAuthReturnTo has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
parserHighWater.modelsForHighWater (cyclomatic 16) packages/frontend/src/lib/db/parserHighWater.ts:293— parserHighWater.modelsForHighWater has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
renderProfileBadgeSvg.isFullWidth (cyclomatic 16) packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts:48— renderProfileBadgeSvg.isFullWidth has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
invites.createGroupInvite (cyclomatic 16) packages/frontend/src/lib/groups/invites.ts:107— invites.createGroupInvite has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, 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.
heuristics.scoreCandidate (cyclomatic 16) packages/frontend/src/lib/moderation/heuristics.ts:436— heuristics.scoreCandidate 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.
route.POST (cognitive 269) packages/frontend/src/app/api/submit/route.ts:511— route.POST has cognitive complexity 269 (threshold 15). Drivers by points: if/else 59 (130 pts), loops 24 (52 pts), ternaries 26 (46 pts), boolean chains 31, error handling 8 (10 pts) (nesting depth added 121). Of this number, 24 points are the body's own statements and 245 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
publicProfileData.getPublicProfileResponse (cognitive 181) packages/frontend/src/lib/publicProfileData.ts:107— publicProfileData.getPublicProfileResponse has cognitive complexity 181 (threshold 15). Drivers by points: boolean chains 101, if/else 33 (80 pts), loops 11 (29 pts), ternaries 17 (18 pts), error handling 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. This shape REPEATS in the file: one other method here (publicProfileData.getPublicProfileResponse::mergeClientModel) 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.
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.
ProfileContributionGraph.ProfileContributionGraph (cognitive 134) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2126— ProfileContributionGraph.ProfileContributionGraph has cognitive complexity 134 (threshold 15). Drivers by points: ternaries 32 (72 pts), if/else 26 (35 pts), boolean chains 25, loops 1 (2 pts) (nesting depth added 50). Most of this is not in the body itself: 14 of the 134 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 2575, a function literal at line 2513, handleCellPointerLeave, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LeaderboardClient.LeaderboardClient (cognitive 82) packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:958— LeaderboardClient.LeaderboardClient has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 43, ternaries 17 (21 pts), if/else 18 (nesting depth added 4). Of this number, 48 points are the body's own statements and 34 belong to 16 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GroupDetailClient.GroupDetailClient (cognitive 67) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:503— GroupDetailClient.GroupDetailClient has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 27, if/else 18 (19 pts), ternaries 10 (17 pts), error handling 4 (nesting depth added 8). Of this number, 23 points are the body's own statements and 44 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
submission.validateSubmission (cognitive 60) packages/frontend/src/lib/validation/submission.ts:377— submission.validateSubmission has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 7, loops 5 (6 pts), ternaries 2 (6 pts) (nesting depth added 25). Of this number, 59 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-release-workflow-safety.main (cognitive 57) scripts/check-release-workflow-safety.py:408— check-release-workflow-safety.main has cognitive complexity 57 (threshold 15). Drivers by points: if/else 34 (49 pts), loops 4, boolean chains 2, error handling 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsClient.SettingsClient (cognitive 54) packages/frontend/src/app/settings/SettingsClient.tsx:708— SettingsClient.SettingsClient has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 11 (18 pts), boolean chains 13, error handling 4 (nesting depth added 10). Most of this is not in the body itself: 14 of the 54 points are its own statements and the rest belongs to 10 function items inside it that branch (handleSaveDeviceName, a function literal at line 732, handleCreateToken, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SchemaAccumulator::ingest (cognitive 52) crates/tokscale-core/src/sessions/opencode_schema.rs:833— SchemaAccumulator::ingest has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33 (45 pts), match/switch 6, 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.
parserHighWater.planParserHighWaterSubmission (cognitive 51) packages/frontend/src/lib/db/parserHighWater.ts:1348— parserHighWater.planParserHighWaterSubmission has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 19 (25 pts), if/else 12 (17 pts), boolean chains 9 (nesting depth added 11). Of this number, 49 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupsBrowser.GroupsBrowser (cognitive 50) packages/frontend/src/app/(main)/leaderboard/GroupsBrowser.tsx:243— GroupsBrowser.GroupsBrowser has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 18 (31 pts), if/else 11 (13 pts), boolean chains 5, loops 1 (nesting depth added 15). Of this number, 24 points are the body's own statements and 26 belong to 9 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.
ProfileUsageChart.ProfileUsageChart (cognitive 48) packages/frontend/src/components/profile/ProfileUsageChart.tsx:915— ProfileUsageChart.ProfileUsageChart has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 21 (25 pts), boolean chains 11, if/else 8 (9 pts), error handling 2, match/switch 1 (nesting depth added 5). Of this number, 27 points are the body's own statements and 21 belong to 12 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TokenGraph3D.TokenGraph3D (cognitive 46) packages/frontend/src/components/TokenGraph3D.tsx:135— TokenGraph3D.TokenGraph3D has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 18 (25 pts), if/else 10 (12 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 10). Of this number, 20 points are the body's own statements and 26 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ProfileContributionGraph.createContributionCalendar (cognitive 42) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:577— ProfileContributionGraph.createContributionCalendar has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 13, if/else 6 (13 pts), ternaries 10 (13 pts), loops 3 (nesting depth added 10). Of this number, 39 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parserHighWater.allocateIncrements (cognitive 37) packages/frontend/src/lib/db/parserHighWater.ts:1044— parserHighWater.allocateIncrements has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 8 (13 pts), loops 6 (7 pts), boolean chains 3 (nesting depth added 14). Of this number, 18 points are the body's own statements and 19 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
route.PATCH (cognitive 36) packages/frontend/src/app/api/groups/[slug]/route.ts:83— route.PATCH has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 6, error handling 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupManagement.GroupManagement (cognitive 36) packages/frontend/src/components/leaderboard/GroupManagement.tsx:195— GroupManagement.GroupManagement has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 18, if/else 9, ternaries 5 (7 pts), error handling 2 (nesting depth added 2). Most of this is not in the body itself: 14 of the 36 points are its own statements and the rest belongs to 11 function items inside it that branch (mutate, a function literal at line 231, confirmAction, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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:420— 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.
ModerationClient.ModerationClient (cognitive 31) packages/frontend/src/app/admin/moderation/ModerationClient.tsx:57— ModerationClient.ModerationClient has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (23 pts), if/else 5 (6 pts), error handling 2 (nesting depth added 14). Most of this is not in the body itself: 4 of the 31 points are its own statements and the rest belongs to 3 function items inside it that branch (applyAction, a function literal at line 152, a function literal at line 63). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TokenGraph2D.TokenGraph2D (cognitive 28) packages/frontend/src/components/TokenGraph2D.tsx:28— TokenGraph2D.TokenGraph2D has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 6, loops 4 (5 pts), ternaries 1 (3 pts) (nesting depth added 6). None of this is in the body itself: all 28 points belong to 5 function items inside it that branch (a function literal at line 42, a function literal at line 106, a function literal at line 131, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
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.
heuristics.scoreCandidate (cognitive 26) packages/frontend/src/lib/moderation/heuristics.ts:436— heuristics.scoreCandidate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
migrate-core.runMigrations (cognitive 25) packages/frontend/scripts/migrate-core.ts:19— migrate-core.runMigrations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 3 (5 pts), loops 2, ternaries 2, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (acquireAdvisoryLock, runMigrate). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
route.normalizeSubmissionData (cognitive 25) packages/frontend/src/app/api/submit/route.ts:365— route.normalizeSubmissionData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileEmbedDialog.ProfileEmbedDialog (cognitive 25) packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:47— ProfileEmbedDialog.ProfileEmbedDialog has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 10, error handling 1, ternaries 1. Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 90, setCompactForView, a function literal at line 82, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
generate-release-notes.generateReleaseNotes (cognitive 25) scripts/generate-release-notes.ts:166— generate-release-notes.generateReleaseNotes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (8 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
check-release-workflow-safety.parse_needs (cognitive 24) scripts/check-release-workflow-safety.py:374— check-release-workflow-safety.parse_needs has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
route.PATCH (cognitive 24) packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts:17— route.PATCH has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, ternaries 2 (3 pts), error handling 2, loops 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 11 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
helpers.mergeClientBreakdownsWithRegressionGuard (cognitive 24) packages/frontend/src/lib/db/helpers.ts:174— helpers.mergeClientBreakdownsWithRegressionGuard has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
route.GET (cognitive 23) REDACTED:117— route.GET has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 6 (7 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionModels::from_blobs (cognitive 22) crates/tokscale-core/src/sessions/antigravity_cli.rs:176— 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.
renderProfileEmbedSvg.renderProfileCardSvg (cognitive 22) packages/frontend/src/lib/embed/renderProfileEmbedSvg.ts:41— renderProfileEmbedSvg.renderProfileCardSvg has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 20 (22 pts) (nesting depth added 2). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
embedDialogOptions.buildProfileEmbedLinks (cognitive 22) packages/frontend/src/components/profile/embedDialogOptions.ts:84— embedDialogOptions.buildProfileEmbedLinks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 2, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parserHighWater.applyRecountProofToCell (cognitive 22) packages/frontend/src/lib/db/parserHighWater.ts:717— parserHighWater.applyRecountProofToCell has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderIsometric3DSvg.renderIsometric3DEmbedSvg (cognitive 22) packages/frontend/src/lib/embed/renderIsometric3DSvg.ts:127— renderIsometric3DSvg.renderIsometric3DEmbedSvg has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (14 pts), loops 3 (4 pts), if/else 1 (3 pts), boolean chains 1 (nesting depth added 5). Of this number, 20 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
getUserEmbedStats.fetchUserEmbedStats (cognitive 21) packages/frontend/src/lib/embed/getUserEmbedStats.ts:51— getUserEmbedStats.fetchUserEmbedStats has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (9 pts), if/else 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsClient.DangerConfirmationModal (cognitive 21) packages/frontend/src/app/settings/SettingsClient.tsx:578— SettingsClient.DangerConfirmationModal has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 4 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 596, 633). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
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.
renderOrbitEmbedSvg.renderOrbitEmbedSvg (cognitive 20) packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:40— renderOrbitEmbedSvg.renderOrbitEmbedSvg has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 16 (18 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
route.POST (cognitive 20) packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts:12— route.POST has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, error handling 3 (nesting depth added 1). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: 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.
helpers.addClientCostFloor (cognitive 20) packages/frontend/src/lib/db/helpers.ts:425— helpers.addClientCostFloor has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 5, if/else 3, loops 1 (2 pts) (nesting depth added 7). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
9router_tokscale_bridge_gjc.convert_usage_history_row (cognitive 19) scripts/9router_tokscale_bridge_gjc.py:245— 9router_tokscale_bridge_gjc.convert_usage_history_row has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
check-workflow-toolchain-paths.path_filters (cognitive 19) scripts/check-workflow-toolchain-paths.py:96— check-workflow-toolchain-paths.path_filters has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
antigravityStateCoverage.legacyLedgerCoverage (cognitive 19) packages/frontend/src/lib/db/antigravityStateCoverage.ts:176— antigravityStateCoverage.legacyLedgerCoverage has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (8 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
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.
embedShared.layoutContributions (cognitive 18) packages/frontend/src/lib/embed/embedShared.ts:403— embedShared.layoutContributions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 3 (6 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProfileOverview.ProfileOverview (cognitive 18) packages/frontend/src/components/profile/ProfileOverview.tsx:356— ProfileOverview.ProfileOverview has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 7, error handling 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 2 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.
antigravityStateCoverage.antigravityPriorCoverage (cognitive 18) packages/frontend/src/lib/db/antigravityStateCoverage.ts:233— antigravityStateCoverage.antigravityPriorCoverage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
publicProfileData.getPublicProfileResponse::mergeClientModel (cognitive 18) packages/frontend/src/lib/publicProfileData.ts:366— publicProfileData.getPublicProfileResponse::mergeClientModel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (publicProfileData.getPublicProfileResponse) 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.
AttributionIndex::load (cognitive 17) crates/tokscale-core/src/sessions/opencodex.rs:164— 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.
check-release-workflow-safety.strip_yaml_comment (cognitive 17) scripts/check-release-workflow-safety.py:46— check-release-workflow-safety.strip_yaml_comment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BreakdownPanel.ClientSection (cognitive 17) packages/frontend/src/components/BreakdownPanel.tsx:240— BreakdownPanel.ClientSection has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, loops 2 (4 pts), if/else 2 (3 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
antigravityTransition.planAntigravityTransition (cognitive 17) packages/frontend/src/lib/db/antigravityTransition.ts:85— antigravityTransition.planAntigravityTransition has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 5, if/else 4 (nesting depth added 3). Of this number, 12 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sourceBreakdown.scopeBreakdownToDirectives (cognitive 17) packages/frontend/src/lib/leaderboard/sourceBreakdown.ts:38— sourceBreakdown.scopeBreakdownToDirectives has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
renderBlueprintEmbedSvg.renderBlueprintEmbedSvg (cognitive 16) packages/frontend/src/lib/embed/renderBlueprintEmbedSvg.ts:41— renderBlueprintEmbedSvg.renderBlueprintEmbedSvg has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 3 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JoinGroupClient.JoinGroupClient (cognitive 16) packages/frontend/src/app/(main)/groups/join/[token]/JoinGroupClient.tsx:126— JoinGroupClient.JoinGroupClient has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (acceptInvite, a function literal at line 136, a function literal at line 141, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
route.POST (cognitive 16) packages/frontend/src/app/api/groups/[slug]/invite/route.ts:71— route.POST has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, error handling 3, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DataInput.DataInput (cognitive 16) packages/frontend/src/components/DataInput.tsx:219— DataInput.DataInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5, ternaries 3 (5 pts), boolean chains 4, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 224, 246, 288). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
usageChartData.aggregateDailyUsage (cognitive 16) packages/frontend/src/components/profile/usageChartData.ts:253— usageChartData.aggregateDailyUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 7). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parserHighWater.modelsForHighWater (cognitive 16) packages/frontend/src/lib/db/parserHighWater.ts:293— parserHighWater.modelsForHighWater has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, loops 4 (6 pts), if/else 2 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
dailyBreakdownReported.foldContributionsIntoReportedRows (cognitive 16) packages/frontend/src/lib/db/dailyBreakdownReported.ts:104— dailyBreakdownReported.foldContributionsIntoReportedRows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFunctions: tokscale_cli::commands::usage::copilot crates/tokscale-cli/src/commands/usage/copilot.rs:49— TooManyFunctions — 39 free functions. The bar is 30 free functions; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Near-duplicate member family (4 members, 16 shared lines) · ×1
Near-duplicate member family (4 members, 16 shared lines) crates/tokscale-cli/src/tui/app.rs:2514— crates/tokscale-cli/src/tui/app.rs:2514-2551 | crates/tokscale-cli/src/tui/app.rs:2553-2587 | crates/tokscale-cli/src/tui/app.rs:2640-2671 | crates/tokscale-cli/src/tui/app.rs:2697-2755 — These 4 members are variants of one another: a block of 16 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:3288— crates/tokscale-cli/src/main.rs:3288-3590 | crates/tokscale-cli/src/main.rs:3600-3869 — 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 (25 shared 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 variants of one another: 25 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:2295— crates/tokscale-cli/src/tui/ui/usage.rs:2295-2355 | crates/tokscale-cli/src/tui/ui/usage.rs:2362-2407 — 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.
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 13 separate duplicated blocks between them, totalling at least 215 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 (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 21 separate duplicated blocks between them, totalling at least 287 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 (36 lines × 2) crates/tokscale-cli/src/main.rs:3396— crates/tokscale-cli/src/main.rs:3396-3431 | crates/tokscale-cli/src/main.rs:3476-3511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34 lines × 2) crates/tokscale-cli/src/tui/data/mod.rs:1309— crates/tokscale-cli/src/tui/data/mod.rs:1309-1342 | crates/tokscale-cli/src/tui/data/mod.rs:1404-1437 — both copies are in the same file, so extract the 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 (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 13 separate duplicated blocks between them, totalling at least 215 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 (27 lines × 2) crates/tokscale-cli/src/main.rs:3301— crates/tokscale-cli/src/main.rs:3301-3327 | crates/tokscale-cli/src/main.rs:3613-3639 — both copies are in the same file, so extract the 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 (26 lines × 3) crates/tokscale-core/src/message_cache.rs:1027— crates/tokscale-core/src/message_cache.rs:1027-1052 | crates/tokscale-core/src/message_cache.rs:1170-1195 | crates/tokscale-core/src/message_cache.rs:1313-1338 — 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 (13–24 lines × 8) crates/tokscale-cli/src/tui/ui/agents.rs:138— crates/tokscale-cli/src/tui/ui/agents.rs:138-150 | crates/tokscale-cli/src/tui/ui/daily.rs:262-274 | crates/tokscale-cli/src/tui/ui/daily.rs:523-535 | crates/tokscale-cli/src/tui/ui/hourly.rs:202-225 | crates/tokscale-cli/src/tui/ui/minutely.rs:193-205 | crates/tokscale-cli/src/tui/ui/models.rs:325-337 | crates/tokscale-cli/src/tui/ui/monthly.rs:263-275 | crates/tokscale-cli/src/tui/ui/monthly.rs:483-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 135 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 (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.
Duplicated block (23 lines × 2) crates/tokscale-core/src/aggregator.rs:604— crates/tokscale-core/src/aggregator.rs:604-626 | crates/tokscale-core/src/aggregator.rs:796-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.
Duplicated block (17–23 lines × 2) crates/tokscale-core/src/lib.rs:5817— crates/tokscale-core/src/lib.rs:5817-5833 | crates/tokscale-core/src/lib.rs:5946-5968 — both copies are in the same file, so extract the 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 (21 lines × 2) crates/tokscale-core/src/lib.rs:2351— crates/tokscale-core/src/lib.rs:2351-2371 | crates/tokscale-core/src/lib.rs:2389-2409 — both copies are in the same file, so extract the 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–21 lines × 2) crates/tokscale-core/src/lib.rs:4201— crates/tokscale-core/src/lib.rs:4201-4221 | crates/tokscale-core/src/lib.rs:4233-4249 — both copies are in the same file, so extract the 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 (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:1013-1032 | crates/tokscale-cli/src/tui/data/mod.rs:1055-1074 | crates/tokscale-cli/src/tui/data/mod.rs:1114-1133 | crates/tokscale-cli/src/tui/data/mod.rs:1156-1175 | crates/tokscale-cli/src/tui/data/mod.rs:1196-1215 | crates/tokscale-cli/src/tui/data/mod.rs:1243-1262 | crates/tokscale-cli/src/tui/data/mod.rs:1288-1307 | crates/tokscale-cli/src/tui/data/mod.rs:1336-1355 | crates/tokscale-cli/src/tui/data/mod.rs:1383-1402 | crates/tokscale-cli/src/tui/data/mod.rs:1431-1450 | crates/tokscale-cli/src/tui/data/mod.rs:1536-1555 — 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.
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 135 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 (20 lines × 2) crates/tokscale-cli/src/main.rs:2763— crates/tokscale-cli/src/main.rs:2763-2782 | crates/tokscale-cli/src/main.rs:2969-2988 — both copies are in the same file, so extract the 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–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:1945-1958 — 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 (18 lines × 5) crates/tokscale-cli/src/tui/ui/daily.rs:234— crates/tokscale-cli/src/tui/ui/daily.rs:234-251 | crates/tokscale-cli/src/tui/ui/hourly.rs:174-191 | crates/tokscale-cli/src/tui/ui/minutely.rs:165-182 | crates/tokscale-cli/src/tui/ui/monthly.rs:235-252 | crates/tokscale-cli/src/tui/ui/monthly.rs:455-472 — 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 12 separate duplicated blocks between them, totalling at least 150 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–18 lines × 2) crates/tokscale-core/src/lib.rs:4522— crates/tokscale-core/src/lib.rs:4522-4539 | crates/tokscale-core/src/lib.rs:4663-4674 — both copies are in the same file, so extract the 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 × 4) crates/tokscale-core/src/message_cache.rs:4341— crates/tokscale-core/src/message_cache.rs:4341-4357 | crates/tokscale-core/src/message_cache.rs:4371-4387 | crates/tokscale-core/src/message_cache.rs:4401-4417 | crates/tokscale-core/src/message_cache.rs:4438-4454 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (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.
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.
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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–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 15 separate duplicated blocks between them, totalling at least 188 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 3) crates/tokscale-cli/src/main.rs:768— crates/tokscale-cli/src/main.rs:768-783 | crates/tokscale-cli/src/main.rs:809-823 | crates/tokscale-cli/src/main.rs:847-861 — 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 (16 lines × 3) crates/tokscale-core/src/lib.rs:4195— crates/tokscale-core/src/lib.rs:4195-4210 | crates/tokscale-core/src/lib.rs:4227-4242 | crates/tokscale-core/src/lib.rs:4255-4270 — 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 (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.
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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) crates/tokscale-cli/src/main.rs:2647— crates/tokscale-cli/src/main.rs:2647-2661 | crates/tokscale-cli/src/main.rs:2715-2729 | crates/tokscale-cli/src/main.rs:2908-2922 | crates/tokscale-cli/src/main.rs:3094-3108 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–15 lines × 2) crates/tokscale-cli/src/cursor.rs:3061— crates/tokscale-cli/src/cursor.rs:3061-3073 | 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.
Duplicated block (14 lines × 5) crates/tokscale-core/src/lib.rs:2406— crates/tokscale-core/src/lib.rs:2406-2419 | crates/tokscale-core/src/lib.rs:3732-3745 | crates/tokscale-core/src/lib.rs:4063-4076 | crates/tokscale-core/src/lib.rs:4160-4173 | crates/tokscale-core/src/lib.rs:4614-4627 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (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 21 separate duplicated blocks between them, totalling at least 287 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 (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 12 separate duplicated blocks between them, totalling at least 150 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 (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 135 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 (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 6 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–13 lines × 2) crates/tokscale-core/src/sessions/antigravity_cli.rs:862— crates/tokscale-core/src/sessions/antigravity_cli.rs:862-872 | crates/tokscale-core/src/sessions/grok.rs:1762-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.
Duplicated block (10–12 lines × 5) crates/tokscale-core/src/lib.rs:5691— crates/tokscale-core/src/lib.rs:5691-5700 | crates/tokscale-core/src/lib.rs:5813-5822 | crates/tokscale-core/src/lib.rs:5942-5951 | crates/tokscale-core/src/lib.rs:6011-6022 | crates/tokscale-core/src/lib.rs:6499-6508 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crates/tokscale-cli/src/main.rs:2691— crates/tokscale-cli/src/main.rs:2691-2702 | crates/tokscale-cli/src/main.rs:2871-2882 | crates/tokscale-cli/src/main.rs:3062-3073 — 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 (11–12 lines × 3) crates/tokscale-cli/src/main.rs:3401— crates/tokscale-cli/src/main.rs:3401-3412 | crates/tokscale-cli/src/main.rs:3481-3492 | crates/tokscale-cli/src/main.rs:3774-3784 — 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–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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 6) crates/tokscale-core/src/lib.rs:2411— crates/tokscale-core/src/lib.rs:2411-2421 | crates/tokscale-core/src/lib.rs:3737-3747 | crates/tokscale-core/src/lib.rs:4068-4078 | crates/tokscale-core/src/lib.rs:4165-4175 | crates/tokscale-core/src/lib.rs:4413-4423 | crates/tokscale-core/src/lib.rs:4619-4629 — 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 (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:638-647 | 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.
Duplicated block (9–10 lines × 3) crates/tokscale-cli/src/tui/ui/usage.rs:1021— crates/tokscale-cli/src/tui/ui/usage.rs:1021-1029 | crates/tokscale-cli/src/tui/ui/usage.rs:1654-1663 | crates/tokscale-cli/src/tui/ui/usage.rs:2303-2311 — 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 (9–10 lines × 2) crates/tokscale-cli/src/commands/wrapped.rs:1168— crates/tokscale-cli/src/commands/wrapped.rs:1168-1176 | crates/tokscale-cli/src/commands/wrapped.rs:1204-1213 — both copies are in the same file, so extract the 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 (3–10 lines × 3) crates/tokscale-core/src/lib.rs:5602— crates/tokscale-core/src/lib.rs:5602-5604 | crates/tokscale-core/src/lib.rs:5775-5784 | crates/tokscale-core/src/lib.rs:5890-5896 — 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 (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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 3) crates/tokscale-core/src/sessions/claudecode.rs:2026— crates/tokscale-core/src/sessions/claudecode.rs:2026-2034 | crates/tokscale-core/src/sessions/codebuff.rs:41-48 | crates/tokscale-core/src/sessions/freebuff.rs:119-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
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 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 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 12 separate duplicated blocks between them, totalling at least 150 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/tokscale-core/src/cc_mirror.rs:24— crates/tokscale-core/src/cc_mirror.rs:24-31 | crates/tokscale-core/src/scanner.rs:1314-1321 | crates/tokscale-core/src/scanner.rs:1353-1360 | crates/tokscale-core/src/scanner.rs:1414-1421 — 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.
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 15 separate duplicated blocks between them, totalling at least 188 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 × 16) crates/tokscale-core/src/lib.rs:7709— crates/tokscale-core/src/lib.rs:7709-7714 | crates/tokscale-core/src/lib.rs:7750-7755 | crates/tokscale-core/src/lib.rs:7781-7786 | crates/tokscale-core/src/lib.rs:7796-7801 | crates/tokscale-core/src/lib.rs:7823-7828 | crates/tokscale-core/src/lib.rs:7844-7849 | crates/tokscale-core/src/lib.rs:7865-7870 | crates/tokscale-core/src/lib.rs:7883-7888 | crates/tokscale-core/src/lib.rs:7950-7955 | crates/tokscale-core/src/lib.rs:7965-7970 | crates/tokscale-core/src/lib.rs:7980-7985 | crates/tokscale-core/src/lib.rs:7995-8000 | crates/tokscale-core/src/lib.rs:8010-8015 | crates/tokscale-core/src/lib.rs:8025-8030 | crates/tokscale-core/src/lib.rs:8131-8136 | crates/tokscale-core/src/lib.rs:8447-8452 — 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 × 10) crates/tokscale-core/src/lib.rs:7884— crates/tokscale-core/src/lib.rs:7884-7889 | crates/tokscale-core/src/lib.rs:7951-7956 | crates/tokscale-core/src/lib.rs:7966-7971 | crates/tokscale-core/src/lib.rs:7981-7986 | crates/tokscale-core/src/lib.rs:7996-8001 | crates/tokscale-core/src/lib.rs:8011-8016 | crates/tokscale-core/src/lib.rs:8026-8031 | crates/tokscale-core/src/lib.rs:8041-8046 | crates/tokscale-core/src/lib.rs:8132-8137 | crates/tokscale-core/src/lib.rs:8448-8453 — all 10 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:1014-1019 | crates/tokscale-cli/src/tui/ui/usage.rs:2296-2301 — 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 12 separate duplicated blocks between them, totalling at least 150 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 × 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 10 separate duplicated blocks between them, totalling at least 138 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 × 4) crates/tokscale-cli/src/main.rs:2617— crates/tokscale-cli/src/main.rs:2617-2622 | crates/tokscale-cli/src/main.rs:2691-2696 | crates/tokscale-cli/src/main.rs:2871-2876 | crates/tokscale-cli/src/main.rs:3062-3067 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–6 lines × 4) crates/tokscale-cli/src/tui/app.rs:2524— crates/tokscale-cli/src/tui/app.rs:2524-2529 | crates/tokscale-cli/src/tui/app.rs:2560-2565 | crates/tokscale-cli/src/tui/app.rs:2647-2650 | crates/tokscale-cli/src/tui/app.rs:2730-2735 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (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 12 separate duplicated blocks between them, totalling at least 150 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 × 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.
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.
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:131— 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 3 sibling directories (19 clone groups) packages/frontend/src/app/api/users/[username]/devices/[deviceId]/route.ts:75— 19 duplicated blocks under packages/frontend/src/ have copies in at least two of the sibling directories app, components, lib — 7 of them are reported below, and 12 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 19 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 19 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 19 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 (16 clone groups) REDACTED:24— 16 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 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 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 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 16 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/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.
R10 · Code Duplication· Duplicated block with local edits (204 matched lines × 2 locations) · ×1
Duplicated block with local edits (204 matched lines × 2 locations) packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:469— packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:469 · packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:920 — the two spans are one implementation copied and then locally edited — 1177 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.
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 (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.
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 (35 matched lines × 2 locations) · ×1
Duplicated block with local edits (35 matched lines × 2 locations) packages/frontend/src/components/TokenGraph2D.tsx:103— packages/frontend/src/components/TokenGraph2D.tsx:103 · packages/frontend/src/components/TokenGraph3D.tsx:225 — 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 (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.
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.
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:495 — 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 × 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.
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:511 — 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.
R10 · Code Duplication· Duplicated block with local edits (15 matched lines × 2 locations) · ×1
Duplicated block with local edits (15 matched lines × 2 locations) packages/frontend/src/components/landing/hooks/useSquircleClip.ts:104— packages/frontend/src/components/landing/hooks/useSquircleClip.ts:104 · packages/frontend/src/lib/useSquircleBorder.ts:103 — the two spans are one implementation copied and then locally edited — 118 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 (14 matched lines × 2 locations) · ×1
Duplicated block with local edits (14 matched lines × 2 locations) packages/frontend/src/app/api/users/[username]/groups/route.ts:13— packages/frontend/src/app/api/users/[username]/groups/route.ts:13 · packages/frontend/src/lib/publicProfileData.ts:103 — the two spans are one implementation copied and then locally edited — 97 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 (13 lines × 3 locations) packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:152— packages/frontend/src/lib/embed/renderOrbitEmbedSvg.ts:152 · packages/frontend/src/lib/embed/renderReceiptEmbedSvg.ts:142 · packages/frontend/src/lib/embed/renderTerminalEmbedSvg.ts:120 — 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.
Complex function (anonymous) (cyclomatic 159, cognitive 272) packages/frontend/src/app/api/submit/route.ts:616— (anonymous) has cyclomatic complexity 159 and cognitive complexity 272; 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.
Complex function LeaderboardClient (cyclomatic 53, cognitive 45) packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:958— LeaderboardClient has cyclomatic complexity 53 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 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 planParserHighWaterSubmission (cyclomatic 41, cognitive 50) packages/frontend/src/lib/db/parserHighWater.ts:1348— planParserHighWaterSubmission has cyclomatic complexity 41 and cognitive complexity 50; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function validateSubmission (cyclomatic 37, cognitive 66) packages/frontend/src/lib/validation/submission.ts:377— validateSubmission has cyclomatic complexity 37 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function 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:577— 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 ProfileUsageChart (cyclomatic 32, cognitive 29) packages/frontend/src/components/profile/ProfileUsageChart.tsx:915— 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 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 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:503— 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 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.
R2 · Cyclomatic Complexity· Complex function POST (cyclomatic 24, cognitive 24) · ×1
Complex function POST (cyclomatic 24, cognitive 24) packages/frontend/src/app/api/submit/route.ts:511— POST has cyclomatic complexity 24 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 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 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 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 ProfileContributionGraph (cyclomatic 23, cognitive 18) packages/frontend/src/components/profile/ProfileContributionGraph.tsx:2126— 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 applyRecountProofToCell (cyclomatic 21, cognitive 23) packages/frontend/src/lib/db/parserHighWater.ts:717— applyRecountProofToCell has cyclomatic complexity 21 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function TokenGraph3D (cyclomatic 21, cognitive 22) packages/frontend/src/components/TokenGraph3D.tsx:135— TokenGraph3D has cyclomatic complexity 21 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 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.
R3 · Large Files· packages/frontend/src/components/profile/ProfileContributionGraph.tsx · ×1
packages/frontend/src/components/profile/ProfileContributionGraph.tsx: 2464 lines of code packages/frontend/src/components/profile/ProfileContributionGraph.tsx:1— packages/frontend/src/components/profile/ProfileContributionGraph.tsx has 2464 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: 1740 lines of code packages/frontend/src/app/api/submit/route.ts:1— packages/frontend/src/app/api/submit/route.ts has 1740 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: 1562 lines of code packages/frontend/src/lib/db/parserHighWater.ts:1— packages/frontend/src/lib/db/parserHighWater.ts has 1562 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: 1376 lines of code packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1— packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx has 1376 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: 1340 lines of code packages/frontend/src/components/profile/ProfileUsageChart.tsx:1— packages/frontend/src/components/profile/ProfileUsageChart.tsx has 1340 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: 1142 lines of code packages/frontend/src/components/profile/ProfileEmbedDialog.tsx:1— packages/frontend/src/components/profile/ProfileEmbedDialog.tsx has 1142 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: 1130 lines of code packages/frontend/src/app/settings/SettingsClient.tsx:1— packages/frontend/src/app/settings/SettingsClient.tsx has 1130 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: 849 lines of code packages/frontend/src/lib/db/schema.ts:1— packages/frontend/src/lib/db/schema.ts has 849 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: 840 lines of code packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx:1— packages/frontend/src/app/(main)/groups/[slug]/GroupDetailClient.tsx has 840 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: 835 lines of code packages/frontend/src/app/u/[username]/ProfilePageClient.tsx:1— packages/frontend/src/app/u/[username]/ProfilePageClient.tsx has 835 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/components/layout/Navigation.tsx · ×1
packages/frontend/src/components/layout/Navigation.tsx: 735 lines of code packages/frontend/src/components/layout/Navigation.tsx:1— packages/frontend/src/components/layout/Navigation.tsx has 735 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/validation/submission.ts · ×1
packages/frontend/src/lib/validation/submission.ts: 599 lines of code packages/frontend/src/lib/validation/submission.ts:1— packages/frontend/src/lib/validation/submission.ts has 599 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/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/lib/moderation/heuristics.ts · ×1
packages/frontend/src/lib/moderation/heuristics.ts: 540 lines of code packages/frontend/src/lib/moderation/heuristics.ts:1— packages/frontend/src/lib/moderation/heuristics.ts has 540 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/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/components/profile/ProfileOverview.tsx · ×1
packages/frontend/src/components/profile/ProfileOverview.tsx: 474 lines of code packages/frontend/src/components/profile/ProfileOverview.tsx:1— packages/frontend/src/components/profile/ProfileOverview.tsx has 474 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: 402 lines of code packages/frontend/src/lib/moderation/candidates.ts:1— packages/frontend/src/lib/moderation/candidates.ts has 402 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage· This test file cannot be loaded · ×1
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.
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 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 (~392 LoC) packages/frontend/src/components/BlackholeHero.tsx— no import path from any entry point (72 application, 12 tooling, 105 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 (~230 LoC) packages/frontend/scripts/seed-dev.ts— no import path from any entry point (72 application, 12 tooling, 105 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 (~146 LoC) packages/frontend/src/lib/useSquircleBorder.ts— no import path from any entry point (72 application, 12 tooling, 105 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 (~120 LoC) packages/frontend/src/components/TabBar.tsx— no import path from any entry point (72 application, 12 tooling, 105 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 (~86 LoC) packages/frontend/src/components/Switch.tsx— no import path from any entry point (72 application, 12 tooling, 105 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 (72 application, 12 tooling, 105 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 (~30 LoC) packages/frontend/scripts/migrate-prod.ts— no import path from any entry point (72 application, 12 tooling, 105 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@resvg/resvg-js' — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@neondatabase/serverless' — Declared in packages/frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@radix-ui/react-tooltip' — Declared in packages/frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Swallowed exception (caught, then discarded) scripts/9router_tokscale_bridge_gjc.py:105— `except Exception` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
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:1100— `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:1149— `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:1316— `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:1355— `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:1416— `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:1524— `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:230— `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:47— `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:256— `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:427— `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:125— `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:274— `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/mux.rs:54— `parse_mux_file` turns every `Err` into `vec![]` — 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 packages/frontend/src/app/api/groups/[slug]/invite/route.ts:92— `!body || typeof body !== "object" || Array.isArray(body)` appears character-identically in 5 files — packages/frontend/src/app/api/groups/[slug]/invite/route.ts, packages/frontend/src/app/api/groups/[slug]/members/[userId]/role/route.ts, packages/frontend/src/app/api/groups/[slug]/route.ts, packages/frontend/src/app/api/groups/[slug]/transfer-ownership/route.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/app/api/groups/[slug]/invite/route.ts:31— `!membership || membership.role === "member"` appears character-identically in 2 files — packages/frontend/src/app/api/groups/[slug]/invite/route.ts, packages/frontend/src/app/api/groups/[slug]/route.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/lib/db/antigravityTransition.ts:73— `Number.isSafeInteger(before) && Number.isSafeInteger(after) && before >= 0 && after >= before` appears character-identically in 2 files — packages/frontend/src/lib/db/antigravityTransition.ts, packages/frontend/src/lib/db/micodeTransition.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/lib/db/antigravityTransition.ts:96— `args.submittedClients.has(client) || ownValue(args.incomingVersions, client) !== undefined` appears character-identically in 2 files — packages/frontend/src/lib/db/antigravityTransition.ts, packages/frontend/src/lib/db/micodeTransition.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx:1219— `event.key === "Enter" || event.key === " "` appears character-identically in 2 files — packages/frontend/src/app/(main)/leaderboard/LeaderboardClient.tsx, packages/frontend/src/components/profile/ProfileContributionGraph.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/components/profile/ProfileOverview.tsx:34— `period === "this-month" || period === "last-month"` appears character-identically in 3 files — packages/frontend/src/components/profile/ProfileOverview.tsx, packages/frontend/src/lib/publicProfileData.ts, packages/frontend/src/lib/reportingPeriods.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/lib/db/antigravityStateCoverage.ts:252— `state.stateVersion != null && state.stateVersion !== PARSER_HIGH_WATER_STATE_VERSION` appears character-identically in 2 files — packages/frontend/src/lib/db/antigravityStateCoverage.ts, packages/frontend/src/lib/db/parserHighWater.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/frontend/src/components/TokenGraph2D.tsx:122— `weekIndex < 0 || weekIndex >= weeksData.length || dayIndex < 0 || dayIndex >= 7` appears character-identically in 2 files — packages/frontend/src/components/TokenGraph2D.tsx, packages/frontend/src/components/TokenGraph3D.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate scripts/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:609— `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:3396— `input == 0 && output == 0 && cache_read == 0 && reasoning == 0` appears character-identically in 2 files — crates/tokscale-cli/src/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:1916— `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/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/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/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.
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, 50 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-core/src/bucket_tz.rs, crates/tokscale-cli/src/commands/codex_activity.rs, packages/frontend/src/components/layout/Navigation.tsx, crates/tokscale-core/src/paths.rs, packages/benchmarks/runner.ts (+42 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 5 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 (57 single-owned of 320 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; 320 of the 404 production source files in this repository met that bar). They are anonymized user #2 (3 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)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: packages/frontend/src/lib/reconciliation/ratchetCensus.ts, packages/frontend/src/app/api/groups/[slug]/members/route.ts, packages/frontend/src/app/api/settings/submitted-data/route.ts, scripts/9router_tokscale_bridge_gjc.py, crates/tokscale-cli/src/tui/keymap.rs, packages/frontend/src/lib/embed/renderProfileBadgeSvg.ts, scripts/check-workflow-toolchain-paths.py.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 5 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `crates/tokscale-core` (150755 LoC, 238 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 — 4 of 320 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; 320 of the 404 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/scripts/gallery/build-gallery.ts, packages/frontend/scripts/gallery/gallery-app.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/5 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 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 '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.
Unused export 'CUBE_GAP' packages/frontend/src/lib/constants.ts:20— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'calculateCanvasWidth' · ×1
Unused export 'calculateCanvasWidth' packages/frontend/src/lib/constants.ts:232— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'calculateCanvasHeight' · ×1
Unused export 'calculateCanvasHeight' packages/frontend/src/lib/constants.ts:235— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'TOOLTIP_DELAY' · ×1
Unused export 'TOOLTIP_DELAY' packages/frontend/src/lib/constants.ts:239— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'THEME_TRANSITION_DURATION' · ×1
Unused export 'THEME_TRANSITION_DURATION' packages/frontend/src/lib/constants.ts:240— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'INTERACTION_DEBOUNCE' · ×1
Unused export 'INTERACTION_DEBOUNCE' packages/frontend/src/lib/constants.ts:241— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'requireGroupRole' · ×1
Unused export 'requireGroupRole' packages/frontend/src/lib/groups/permissions.ts:22— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'canManageGroupMember' · ×1
Unused export 'canManageGroupMember' packages/frontend/src/lib/groups/permissions.ts:36— Nothing imports this binding — it is safe to review for removal.
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 0/10 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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 (`!`) reduce the strict null checking score — ~0.2 `!` null assertions per 1k TypeScript source lines — 9 assertion(s) across the 47338 source line(s) of the 209 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/src/app/api/submit/route.ts (2), packages/frontend/src/components/profile/ProfileContributionGraph.tsx (2), packages/frontend/src/lib/auth/github.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.
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: 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.4 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.0 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.
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 2 file(s) — `packages/benchmarks/runner.ts`, `packages/frontend/src/components/profile/usageChartData.ts` — 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 01a18062-62c7-76e1-99be-ff0b4a3e831d · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 96 · Warnings: 1211 · Recommendations: 93 · Info: 18 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 28-10-2026 @ 02:41 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.